Skip to content
forked from EnSpec/SpecDAL

Website landing page for SpecDAL project. https://specdal.github.io now redirects here.

License

Notifications You must be signed in to change notification settings

tuncaemre/SpecDAL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visit our ReadTheDocs.

Introduction

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.

Features

  1. 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
  2. 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 and Collection classes which wrap around pandas objects to provide simpler interface for spectral functions
  3. GUI (under development)

Tutorials

See the Jupyter notebooks here.

Installation

SpecDAL can be installed from PyPI using pip. For a more detailed walkthrough, see https://specdal-test.readthedocs.io/en/latest/installation.html

Installation from Source

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).

Example 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/

About

Website landing page for SpecDAL project. https://specdal.github.io now redirects here.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 70.1%
  • Python 29.8%
  • Other 0.1%