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:
- Horiba (tested on the MacroRAM and LabRAM HR Evolution)
- OpenRAMAN
- Renishaw (tested on the inVia Qontor)
- Wasatch (tested on the WP785X)
This package also facilitates the calibration of spectral data output by the OpenRAMAN. The calibration procedure consists of two steps:
- A rough calibration based on a broadband excitation light source (e.g. Neon lamp)
- 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.
The package can be installed directly from the GitHub repository via pip
:
pip install git+https://github.com/Arcadia-Science/ramanalysis.git
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.
- Add a reader for CRS data from Leica LIF files using
readlif
. - Integrate with
RamanSPy
to easily convertRamanSpectrum
instances toramanspy
Spectrum
orSpectralImage
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)
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.