Visit our ReadTheDocs.
specdal
is a Python package for loading and manipulating field
spectroscopy data. It currently supports readers for ASD, SVC, and PSR
spectrometers. specdal
provides useful functions and command line
scripts for processing and aggregating the data.
- Command line interface
- specdal_info: lightweight script to read and display content of spectral files
- specdal_pipeline: default script to convert spectral files into datasets and figures
- Python interface
- readers for .asd, .sig, .sed spectral files - Pico files (WIP)
- spectral functions that operate on pandas objects
- interpolation
- jump_correction
- joining proximal measurements (WIP)
Spectrum
andCollection
classes which wrap around pandas objects to provide simpler interface for spectral functions
- GUI (under development)
See the Jupyter notebooks here.
SpecDAL can be installed from PyPI using pip. For a more detailed walkthrough, see https://specdal-test.readthedocs.io/en/latest/installation.html
Warning: This method of installation will override any other versions of SpecDAL in your current environment. A virtual environment can be used to preserve other installations.
SpecDAL can also be installed from source. Open a terminal and run the command:
git clone https://github.com/EnSpec/SpecDAL.git && pip install SpecDAL/
The SpecDAL python package and specdal_pipeline
command-line tool will be
installed on your system (see specdal_pipeline --help
for usage).
For a description of all command line arguments: specdal_pipeline --help
.
To produce an individual plot and textfile for every spectrum file
in directory /path/to/spectra/
and store the results in specdal_output/
:
specdal_pipeline -o specdal_output /path/to/spectra/
To only output whole-dataset images and files:
specdal_pipeline -oi -o specdal_output /path/to/spectra/
To only output images, with no data files:
specdal_pipeline -od -o specdal_output /path/to/spectra/
To group input files by the first 3 underscore-separated components
of their filename (such that foo_bar_baz_001.asd
and
foo_bar_baz_002.asd
will appear in one group, and
foo_bar_qux_001.asd
in another):
specdal_pipeline -g -gi 0 1 2 -- /path/to/spectra/
To also output the mean and median of every group of spectra:
specdal_pipeline -g -gi 0 1 2 -gmean -gmedian /path/to/spectra/
To remove all white reference spectra from the output dataset (leaves input files intact):
specdal_pipeline --filter_white /path/to/spectra/
To remove all white reference spectra from the dataset, as well as spectra with a 750-1200 nm reflectance that is greater than 1 standard deviation from the mean, or with a 500-600 nm reflectance that is greater than 2 standard devations from the mean:
specdal_pipeline --filter_white --filter_std 750 1200 1 500 600 2 -- /path/to/spectra/
To perform the filtering above, and then group the remaining spectra by filename:
specdal_pipeline --filter_white --filter_std 750 1200 1 500 600 2
-g -gi 0 1 2 /path/to/spectra/
To group the spectra by filename, and then perform filtering on each group:
specdal_pipeline --filter_white --filter_std 750 1200 1 500 600 2
-g -gi 0 1 2 --filter_on group /path/to/spectra/