A user-friendly PyQt5-based application for controlling line spectrometers, acquiring spectral data, performing Raman shift conversions with calibration, preprocessing spectra, managing a reference database, and searching for spectral matches. Optimized for Raman spectroscopy workflows. The app is specifically optimized for Hamamatsu CCD sensors and has been tested with the IRM785 spectrometer from Imai Optics. It supports DIY Raman systems based on Hamamatsu CCDs (see separate GitHub repository for details). It also allows laser control for Imai Optics probe YM_RPL_785_500.
Raman Open Forge Imai provides an integrated interface for spectrometer operation and data analysis. It handles device communication via serial port, real-time spectrum acquisition, advanced preprocessing using the ramanspy library, software/hardware calibration, and a database management for storing and querying reference spectra.
The application is designed to streamline Raman spectroscopy tasks, from data collection to identification.
Key capabilities include device parameter control, background subtraction, Raman shift calibration to correct peak positions, spectral preprocessing pipelines, peak detection, database management, and similarity-based searches with multiple metrics.
Ramanbase.org integration
We provide .ipynb showing how to make custom reference databases based on ramanbase.org spectra for working with the app. An example of a small-scale database is presented here (to work, it should be unzipped and renamed to rbase_specdictcur.pkl) and a larger processed database covering ~85k spectra can be downloaded here.
Key capabilities include:
- Device control (integration time, averaging, gain, offset, laser voltage (if probe is present), smoothing).
- Spectrum acquisition (single or continuous mode) with background subtraction.
- Conversion to Raman shifts with optional quadratic software calibration to correct peak positions.
- Advanced preprocessing: cropping, denoising (SavGol), baseline correction (ASLS), normalization.
- Peak detection and export.
- Spectral database management (add, delete, load/save as pickle files).
- Database search using similarity metrics (SAD, SID, MAE, MSE, IUR for peaks).
- Interactive plotting with zoom, reference overlay, and export options.
- Scan and connect to serial ports (e.g., USB spectrometers).
- Set integration time (1–60,000 ms), hardware averaging (1–255).
- Advanced settings: gain (0–255), offset (-255–255), laser voltage (0–5000 mV), trigger out (HIGH/LOW), smoothing level (1–10).
- Read current device parameters on connection.
- Save parameters to device flash.
- Single acquisition or continuous mode with pause.
- Background spectrum acquisition and automatic subtraction.
- Real-time FPS display and acquisition count.
- Raw spectrum plotting with optional auto-zoom.
- Toggle conversion to Raman shifts using excitation wavelength (adjustable, default 785 nm).
- Software calibration: polynomial fit on observed vs expected shifts (from table input).
- Hardware calibration: read/write coefficients for wavelength, Raman shift, and intensity groups.
- Preview calibrated axis and save to device flash.
- Load/save calibration files as CSV.
Pipeline based on ramanspy:
-
Crop region (min/max shift).
-
Savitzky-Golay denoising.
-
ASLS baseline correction.
-
Normalization (MinMax).
-
Peak finding with prominence and width thresholds.
-
Processed spectrum plotting with peak labels.
-
Export processed data and peaks as CSV.
- Load/save databases as pickle files (.pkl).
- Add current spectrum to database with custom name.
- Delete spectra from database.
- Create new empty database.
- Auto-load default database on startup.
- Reload current database.
- Enable/disable search in processing panel.
- Metrics: SAD, SID, MAE, MSE, IUR (peak-based intersection over union with tolerance).
- Preprocess database spectra option.
- Minimum axis overlap threshold.
- Top-N results display and download as CSV.
- Reference plotting from search results or entire database.
- Includes interface for interaction with motorized XY stages based on two stepper motors (e.g. https://aliexpress.ru/item/32790147861.html?spm=a2g2w.orderdetail.0.0.13d54aa6a1Z1IZ&sku_id=63501886881&_ga=2.106962242.135651944.1772988164-1631170546.1742897773).
- Manual navigation and automated Raman probe scan runs.

- Interactive plots using pyqtgraph.
- Overlay reference spectra (green line).
- Auto-zoom with margin; default views for wavelength (796–1119 nm) and Raman (0–2000 cm⁻¹).
- Peak lines and labels (dashed red).
- Log widget for application events.
- Main window: control buttons, plot, log.
- Docks: Process Spectra (left), Calibration (right), Manage Database (left), Advanced Settings (right).
- Status bar with FPS and acquisition count.
git clone [https://github.com/yourusername/line-spectra-viewer.git](https://github.com/ACDBio/raman-open-forge-imai)
cd raman-open-forge-imai
pip install PyQt5 pyqtgraph numpy scipy pandas ramanspy pyserial
python3 Main.pyHere we illustrate the usage of the software in the process of soft Raman shift calibration.
Obtaining acetone spectrum (the probe YM_RPL_785_500 and 3d printed quartz cuvette holder was used), comparison with the reference database spectrum,
peak search and software calibration based on the obtained data using a polynomial fit
(the reference DB acetone spectrum peaks were determined prior to the procedure with the same software)

Searching spectra similar to the measured DMSO spectrum using IUR procedure and plotting the found spectrum along with the measured one.
Note: IUR is sensitive to tolerance — adjust settings for your database and hardware.

Special thanks to Imai Optics for supporting the project by providing a discount on YM_RPL_785_500, which was instrumental in testing and validating the software. Their high-quality equipment ensured reliable performance during development. Also thyanks to ramanbase.org developers and contributors and ramanspy developers. Grok4, ChatGpt, Claude assisted the development.
Contributions are welcome! Please submit issues or pull requests for bugs, features, or improvements. The software is at the active development stage. This project is licensed under the MIT License - see the LICENSE file for details.<|control12|># Line Spectra Viewer

