From dd9f6afab504d38a6d8ed1b111262b42a2964cc6 Mon Sep 17 00:00:00 2001 From: Kyle Manchee Date: Thu, 8 Jun 2017 20:54:22 -0400 Subject: [PATCH] Updated Readme --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 34d5240..69b45d8 100644 --- a/README.md +++ b/README.md @@ -1 +1,20 @@ -# beamtools \ No newline at end of file +# beamtools +The *beamtools* package is a collection of methods to assist with several aspects of optical system design and analysis. +## Data Objects +All raw data in the package is handle via a DataObject 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 `DataObject` instances posses the class method `fields()`. Calling `DataObject.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. +## Importing data +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`.