RamanPy is a Python-based tool for capturing, visualizing, and analyzing USB-UVC Raman spectrometer data. It provides real-time spectrum visualization, dark frame correction, and spectrum overlay comparison.
It focuses on being easily configurable and editable. I found existing general UVC spectrometer implementations to be too obtuse.

- Real-time camera-based spectral data acquisition
- Wavelength and wavenumber calibration
- Fluorescence baseline removal option
- Dark frame subtraction for improved signal quality
- Spectrum saving with timestamp
- Multi-spectrum overlay visualization and comparison
- Python 3.6+
- Connected camera (webcam or spectrometer camera)
- Dependencies listed in
requirements.txt - Likely only works on Linux without modification (using V4L2 as it provides far less compressed data)
-
Clone this repository:
git clone https://github.com/yourusername/RamanPy.git cd RamanPy -
Install the required dependencies:
pip install -r requirements.txt
Run the main script to start capturing spectral data:
python RamanPy/main.pyControls:
- Press
sto save the current spectrum - Press
qto quit the application
The script will show two windows:
- The camera feed with the spectral region highlighted
- A real-time plot of the spectrum
Adjust these parameters in main.py to configure your setup:
# Camera settings
length = 1920 # Camera width resolution
height = 1080 # Camera height resolution
# Analysis settings
laser_wavelength = 532 # Excitation wavelength in nm
crop_y1, crop_y2 = 0.53, 0.64 # Vertical region to analyze (as fraction of height)
rolling = 1 # Number of frames to average
baselineRemoval = False # Enable/disable fluorescence baseline removal
# Calibration (wavelength = m*pixel + b)
calibrate = [0.5378783977636364, 251.83884117409121] # [m, b] coefficientsAfter collecting spectra, use the drawing tool to visualize and compare multiple spectra:
python RamanPy/draw.pyThis will open a file selection dialog where you can choose one or more spectrum files to visualize.
Spectra are saved as CSV files with the following columns:
- Wavelength (nm)
- Wavenumber (cm⁻¹)
- Intensity (arbitrary units)
The system will automatically use dark_frame.csv if present in the working directory to provide background subtraction.
This project is licensed under the MIT License - see the LICENSE file for details.
idk i just used this for caypt cause theremino isnt good for this type of thing.
COUGH QUANTUM FINGERPTIN COUGH
if you do end up using this feel free to chat my discord is luyu_wu