Giter Site home page Giter Site logo

cpkm / beamtools Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4.28 MB

Suite of tools and methods for the analysis and simulation of optical beam. Available on PyPI

Home Page: https://pypi.org/project/beamtools/

License: MIT License

Python 100.00%
ultrafast-pulses optics physics-simulation ultrafast-optics physics optical-engineering analysis

beamtools's Introduction

beamtools

The beamtools package is a collection of methods to assist with several aspects of optical system design and analysis.

Importing data

One of the most useful methods in the package is import_data_file which can be used to seamlessly import a variety of data types.

Importing data with beamtools.import_data_file()

Once of the most useful methods in the package is import_data_file which can be used to seamlessly import a variety of data types.

import beamtools as bt

#data from an ocean optics spectrometer
file = 'testdata.csv'
type = 'oo_spec'

data = bt.import_data_file(file,type)

Data imported by import_data_file is returned as a DataObject. In this example, data.wavelength and data.intensity returns numpy arrays of the wavelength and intensity data imported from the file. Any header information is stored in data.header. The header syntax for each file is defined in file_formats.py.

Data Objects

All raw data in the package is handle via a DataObj where the data is stored as object attributes. Data objects are created from dictionaries (set of key/value pairs) and the Data Object attributes are defined by the dictionary keys. The class definition can be found in .import_data_file.py. All DataObj instances posses the class method fields(). Calling DataObj.fields() returns a list of the onjects attributes. This can be used to view the names available data arrays.

File formats

A list of file formats can be found in file_formats.py. I have already included many common file types. More can be added to the package in the future by creating additional dictionary entries following the format and keywords given. Each file format includes a key named alias. These values comprise a set of alternate names which can be used anywhere in the package when specifying a file type.

Common methods

beamtools.pulse module

The beamtools.pulse module contains many methods for analysing optical pulse. This includes the analysis of spectra and autocorrelation traces.

beamtools.upp module

The ultrafast pulse propagation module, imported as beamtools.ufpp possess numerous methods pertaining to the numerical propogation of ultrafast pulses. This includes nonlinear fiber-optic equations, fiber amplification, and several simulated fiber-optic components.

beamtools.grating module

beamtools's People

Contributors

cpkm avatar

Watchers

 avatar

beamtools's Issues

Fiber() z array calc not consistent and excludes last point

calculation of zgrid, initializeGrid(), does not properly handle the calculation. It is not consistent in the abs and rel definitions (consistent input yields different arrays). Also, calculation under estimates number of points by 1.

Change default data object to namedtuple.

Currently, imported data from import_data_file returns a homemade data object named objdict. This can be safely removed and replaced with the use of namedtuples, which offer the same functionality, namely, the ability to call fields as attributes, e.g. data.x instead of data['x'].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.