Skip to content

Package for loading and processing spectral data from Arcadia's Raman spectroscopy instruments.

License

Notifications You must be signed in to change notification settings

Arcadia-Science/ramanalysis

Repository files navigation

ramanalysis

This repository contains a Python package called ramanalysis, the main purpose of which is to facilitate reading Raman spectroscopy data from a variety of instruments by unifying the way the spectral data is loaded. This package currently supports loading spectral data from four different Raman spectrometer manufacturers:

This package also facilitates the calibration of spectral data output by the OpenRAMAN. The calibration procedure consists of two steps:

  1. A rough calibration based on a broadband excitation light source (e.g. Neon lamp)
  2. A fine calibration based on Raman-scattered light from a standard sample (e.g. acetonitrile)

Both calibration steps can be run automatically when spectra of neon and acetonitrile are provided (see Usage). This automated procedure builds upon the calibration procedure implemented by @sunandascript. For more information on the calibration procedure, see this blog post by the creator of the OpenRAMAN.

Installation

The package can be installed directly from the GitHub repository via pip:

pip install git+https://github.com/Arcadia-Science/ramanalysis.git

Usage

Read and calibrate spectral data from an OpenRAMAN CSV file.

from pathlib import Path
from ramanalysis import RamanSpectrum

# Set file paths to the CSV files for your sample and calibration data
example_data_directory = Path("./ramanalysis/tests/example_data/OpenRAMAN/")
csv_filepath_sample = next(example_data_directory.glob("*CC-125*.csv"))
csv_filepath_excitation_calibration = next(example_data_directory.glob("*neon*.csv"))
csv_filepath_emission_calibration = next(example_data_directory.glob("*aceto*.csv"))

# Read and calibrate the spectral data from your sample
spectrum = RamanSpectrum.from_openraman_csvfiles(
    csv_filepath_sample,
    csv_filepath_excitation_calibration,
    csv_filepath_emission_calibration,
)

See examples for more example usage.

Roadmap

  1. Add a reader for CRS data from Leica LIF files using readlif.
  2. Integrate with RamanSPy to easily convert RamanSpectrum instances to ramanspy Spectrum or SpectralImage instances and vice versa. Would look something like this:
    spectrum = RamanSpectrum.from_openraman_csvfiles(
         csv_filepath_sample,
         csv_filepath_excitation_calibration,
         csv_filepath_emission_calibration,
     )
    
    ramanspy_spectrum = spectrum.to_ramanspy_spectrum()
    ramanalysis_spectrum = RamanSpectrum.from_ramanspy_spectrum(ramanspy_spectrum)

Contributing

If you are interested in contributing to this package, please check out the developer notes. See how we recognize feedback and contributions to our code.

About

Package for loading and processing spectral data from Arcadia's Raman spectroscopy instruments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published