Current Raman Application Version 20250117
The latest version is named Labram110.py.
You can download the source code here
It uses these two other source files which I did not write myself:
detect_peaks.py // peak detection
TabPanes.py // tab panes for the user interface
It also can call these apps:
CrystalSleuth // Bob Downs, RRUFF Project database lookup and matching
web browser // used to pull up RRUFF spectra for comparison
The app generates/requires these supporting text files:
Aramis.cfg // stores the settings configuration
E0-Ne-spectrum20230110.rruff // Neon calibration data file in rruff format
chemdata.txt // Lookup data for mineral chemistry
rztemp.out // when using CrystalSleuth baseline correction
rztemp.txt // when using CrystalSleuth baseline correction
temp.ruff // for transfering the app's spectrum to CrystalSleuth.
Other file:
changelog.txt // defunct
default.cfg // A set of default configurations
/MCU folder // microcode for the Arduino Mega and Chipkit Mega MCU
that are called by the app via pyserial.
combine28.ino // controls all the opto-mechanics in the Horiba Aramis Labram
mayhew7.ino // controls the Hamamatsu CCD detector and Mayhew's ADC
It can save spectra in a RRUFF compatible format allowing the spectra
to be loaded into CrystalSleuth either manually or automatically as desired.
Conversely it allows RRUFF spectra to be loaded for various purposes.
I prepared some FITS functions but never employed them.
Some features:
* controls an Arduino Mega with a stack of Adafruit motor controllers for the optomechanics.
* controls a Chipkit Mega with Mayhew ADC shield to control the Hamamatsu TEC CCD head.
* maintains a neon calibration file for spectrum scales.
* Launches CrystalSleuth and injects the current spectrum into it for RRUFF database matching.
* Can use CrystalSleuth for baseline correction.
* generate strip charts for more resolved spectra.
* creates sound files of the (vibrational) spectra.
* saves annotated images of the spectra.
* saves photos of the specimen.
* looks up chemistry of minerals.
* looks up RRuff spectra of minerals.
There's a developer's log file (readme.txt) that logs changes to the app.
Later entries reflect my declining abilities maintaining the software and hardware.
There's also a user's manual in HTML format for an earlier version of the app.
Many of the UI components have hover-over help labels.
Other separate python programs exist for miscellaneous purposes:
* python program that globs and converts all RRUFF mineral spectra into sound files.
* experiments on improving Crystalsleuth's RRUFF database matching.
* test programs etc.
Other separate MCU programs exist for miscellaneous purposes:
* testing/adjusting servo mechanisms
* testing CCD functions etc.
Comments
* There's a TESTMODE toggle in the app code. It allows the app to be run
without access to the Horiba Raman Microscope. All calls to the MCUs are hijacked.
This allows the user interface to be used with user-supplied spectra in RRUFF file format.
Set
TESTMODE=True
to turn on test mode.
* Bugs have creeped into the calbration and/or wavenumber scale.
These need to be found and corrected.
CONTROLS TAB
On startup it sets configurable parameters to their defaults or to their last saved values.
Mirrors, beamsplitters, slits, confocal pinhole, shutters, etc are moved to their appropriate positions.
These actions are indicated in the Status Message area of the user interface.
The "RRUFF" button will look up the specified mineral online at the RRUFF database.
The "Chemistry" buttons will display mineral chemistry from various sources.
The "Sleds" button control whether the confocal spatial filter and/or the pinhole are inserted.
The "cm-1" button initiates a scan using the start and stop values
interpreted as wavenumber shifts. The other two buttons interpret them
as stepper motor steps or wavelengths in nanometers.
The "Flush" button flushes the CCD to remove ghosts.
The "Darktest" button is used to check for light leaks in the spectrograph.
"MegaVer" and "ChipVer" buttons display the versions of the Arduino Mega or
Digilent ChipKit MCU microcodes.
The "Listen" button will play the vibrational spectrum as a musical chord (the frequency
of each note in the chord corresponding to a detected peak's wavenumber shift).
The "CrystalSleuth" button will inject the current spectrum
(or cropped spectrum" into CrystalSleuth for database matching
using CrystalSleuth's inner product algorithm. At one point they
were working on using wavelets for matching but I don't think they
ever implemented it.
BROAD SCAN TAB
The "Crop" button will allow a section of the spectrum to be cropped.
This cropped spectrum can then be submitted for matching against the RRUFF database.
The "Normal" button will display a normalized spectrum.
The "Process" check box globally allows any post-processing or not.
The "S-G" check box turns on Savitzgy-Golay smoothing.
The "B-ALA" check box turns on Asymmetric Least Squares baseline correction.
The "Razor" checkbox turns on CrystalSleuth's baseline correction.
The "Raman Bands" check box turns on labels for some known bands.
The "Peak Coords" check box turns on labels for peak information.
The "Show frames" check box turns on alternate coloring of the CCD frames in the spectrum.
The "Neon" check box turns on ?? display of the calibration neon spectrum ?? I forget.
The "Replot" button will replot the spectrum with the currently selected options.
The "Strip" button will display a long strip chart of the spectrum.
The parameters for spectrum processing can be set on the right side:
smoothing
baseline correction
peak detection
CONFIG TAB
These are the current settings for the Raman microscope
they can be saved manually or automatically restored on
startup.
In the center are manually entered information for documentation
purposes that are printed directly into the spectra images.
On the right are the calibration settings.
A neon lamp is used.
I think the Horiba Labram just used a single silicon peak?
PHOTO TAB
Photos of the actual speciman can be saved.
Screen shots of the user interface (tabs) are below:




Pull-down menus:

