This class encapsulates Dieter's Auto-Raman algorithm, which optimizes integration time (and gain on XS series spectrometers) to achieve a target window of counts, then uses the configured measurement time to maximize scan averaging at with those acquisition parameters.
More...
|
| | __init__ (self, wasatch_device) |
| |
| | bump_progress_bar (self) |
| |
| | from_db_to_linear (self, x) |
| |
| | from_linear_to_db (self, x) |
| |
| | get_auto_spectrum (self, request) |
| |
| | get_avg_spectrum (self, int_time, gain_db, num_avg, throwaway=True, first=None, label="unknown") |
| | Takes a single throwaway, then averages num_avg spectra.
|
| |
| | get_laser_warning_delay_sec (self) |
| | wrappers over stupidly complicated WasatchDevice interface
|
| |
| | get_spectrum (self) |
| |
| | inter_spectrum_delay (self) |
| |
| | measure (self, auto_raman_request) |
| |
| | measure_firmware (self, auto_raman_request) |
| |
| | measure_software (self, auto_raman_request) |
| |
| | save (self, spectrum, label=None) |
| | Save each spectrum in row-ordered CSV if debug environment variable enabled.
|
| |
| | set_gain_db (self, db) |
| |
| | set_integration_time_ms (self, ms) |
| |
| | set_laser_enable (self, flag) |
| |
This class encapsulates Dieter's Auto-Raman algorithm, which optimizes integration time (and gain on XS series spectrometers) to achieve a target window of counts, then uses the configured measurement time to maximize scan averaging at with those acquisition parameters.
As calling software will not necessarily expect the configured "default" integration time and gain to change, the class restores those to previous levels after a measurement.
- Design Considerations
Mark made the following changes from Dieter's original algo:
- don't take throwaways during averaged signal or dark collections, as acquisition parameters aren't changing and sensor should be stable
- don't include laser warning delay when computing num_avg, since laser is already enabled and firing
Mark also made the following decisions regarding ENLIGHTEN integration:
- return the optimized integration time and gain back to ENLIGHTEN in the Reading object so they will be the new GUI settings if the user simply hits "Play" to resume free-running spectra.
- ENLIGHTEN will override the init_int_time and init_gain defaults in AutoRamanRequest so that if the user hits "Auto-Raman Measurement" a second time, the previous settings will be used as the new starting point, and (ideally) the initial spectrum will determine that no further optimization is required.
Points to consider:
- consider rolling the "last optimization" measurement directly into the averaged sample spectra (since it had its own throwaway and presumably represents a "stable" reading). This could potentially allow for one more averaged dark, depending on max_ms.
- ENLIGHTEN's laser button should still be able to turn the laser OFF at any point.