|
Wasatch.PY
Python application driver for Wasatch Photonics spectrometers
|
Encapsulate a spectrometer's state, including compiled firmware (FPGAOptions), non-volatile configuration (EEPROM) and volatile state (SpectrometerState). More...
Public Member Functions | |
| __init__ (self, device_id=None, d=None) | |
| default_detector_setpoint_degC (self) | |
| dump (self) | |
| excitation (self) | |
| full_model (self) | |
| Originally model names fit within the 16-char EEPROM field of that name. | |
| get_vertical_roi (self) | |
| get_wavecal_coeffs (self) | |
| has_excitation (self) | |
| has_marker (self) | |
| has_vertical_roi (self) | |
| init_regions (self) | |
| called by FID.post_connect | |
| is_andor (self) | |
| is_arm (self) | |
| is_gen15 (self) | |
| is_gen2 (self) | |
| is_imx (self) | |
| is_imx392 (self) | |
| is_ingaas (self) | |
| is_micro (self) | |
| is_mml (self) | |
| is_non_raman (self) | |
| is_sig (self) | |
| is_sml (self) | |
| is_spi (self) | |
| is_xs (self) | |
| load_from_dict (self, d) | |
| Assuming that we've loaded a Measurement from JSON, or received a Measurement-like structure externally via JSON, update whatever we can from it. | |
| pixels (self) | |
| set_num_connected_devices (self, n) | |
| set_single_region (self, n) | |
| Note regions are internally 0-indexed (0-3), although EEPROM fields are 1-indexed. | |
| set_wavecal_coeffs (self, coeffs) | |
| set_wavenumber_correction (self, cm) | |
| supports_feature (self, feature) | |
| to_dict (self) | |
| to_json (self) | |
| update_from_json (self, s) | |
| update_raman_intensity_factors (self) | |
| update_wavecal (self, coeffs=None) | |
Encapsulate a spectrometer's state, including compiled firmware (FPGAOptions), non-volatile configuration (EEPROM) and volatile state (SpectrometerState).
This class serves two goals:
| wasatch.SpectrometerSettings.SpectrometerSettings.__init__ | ( | self, | |
| device_id = None, | |||
| d = None ) |
| device_id | (Input) where the spectrometer was found (optional) |
| d | (Input) input dictionary (optional) |
| wasatch.SpectrometerSettings.SpectrometerSettings.default_detector_setpoint_degC | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.dump | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.excitation | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.full_model | ( | self | ) |
Originally model names fit within the 16-char EEPROM field of that name.
Now that we're extending model names to 30 characters, append the value of EEPROM.productConfiguration if non-empty.
| wasatch.SpectrometerSettings.SpectrometerSettings.get_wavecal_coeffs | ( | self | ) |
Return a list of coefficients from EEPROM that define the mapping from pixels to wavelengths. The coefficients are returned in ascending degree. [A, B, C, D] <--> W(x) = A + B*x + C*x**2 + D*x**3
| wasatch.SpectrometerSettings.SpectrometerSettings.has_excitation | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.has_marker | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.has_vertical_roi | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.init_regions | ( | self | ) |
called by FID.post_connect
| wasatch.SpectrometerSettings.SpectrometerSettings.is_andor | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_arm | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_gen15 | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_gen2 | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_imx | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_imx392 | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_ingaas | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_micro | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_mml | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_non_raman | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_sig | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_sml | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_spi | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.is_xs | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.load_from_dict | ( | self, | |
| d ) |
Assuming that we've loaded a Measurement from JSON, or received a Measurement-like structure externally via JSON, update whatever we can from it.
| wasatch.SpectrometerSettings.SpectrometerSettings.pixels | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.set_num_connected_devices | ( | self, | |
| n ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.set_single_region | ( | self, | |
| n ) |
Note regions are internally 0-indexed (0-3), although EEPROM fields are 1-indexed.
If you want to actually send the ROI downstream to the spectrometer, call this method on FeatureIdentificationDevice.
| wasatch.SpectrometerSettings.SpectrometerSettings.set_wavecal_coeffs | ( | self, | |
| coeffs ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.set_wavenumber_correction | ( | self, | |
| cm ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.supports_feature | ( | self, | |
| feature ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.to_dict | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.to_json | ( | self | ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.update_from_json | ( | self, | |
| s ) |
| wasatch.SpectrometerSettings.SpectrometerSettings.update_raman_intensity_factors | ( | self | ) |
@todo Note that WasatchNET.Util.applyRamanCorrection() only generates
factors from (roiStart, roiEnd), whereas this function generates
them for the whole detector. They're only valid within the ROI,
and should only be applied within the ROI, so this is generating
more than we need (wasting memory and risking bugs).
| wasatch.SpectrometerSettings.SpectrometerSettings.update_wavecal | ( | self, | |
| coeffs = None ) |
(We don't currently have any software issues in this respect, but retaining this discussion in case it again becomes useful.)
All of our silicon-based spectrometers output a cropped set of "active" pixels, omitting any "optically-masked / dark" pixels at the ends. (Theoretically we could output those as well, allowing an EDC feature, but that's another discussion).
The point is, it's not "unusual" that our new SiG spectrometer is only outputting 1920 active of 1952 physical pixels, nor is it unusual that the wavecal is based on all active output pixels. That's in fact the norm.
What's unusual is that this spectrometer uses the horizontal ROI fields on the EEPROM to TELL the spectrometer where the active region (or ROI of interest) lies.
Therefore, while most of our spectrometers assume the horizontal ROI is zero-indexed at the beginning of the ACTIVE region, and therefore used to crop the array of ACTIVE pixels being output, in this case the horizontal ROI is zero-indexed at the beginning of the PHYSICAL region, and therefore HAS ALREADY been used to crop the spectrum down to the active region.
(The current unit uses EEPROM subformat 1, meaning region_count remains 0 and pixels() will always return active_pixels_horizontal (1920). Even if we were in subformat 4, detector_regions.total_pixels() should still sum to 1920.)
Conclusion: testing confirms the wavecal is correctly generated and applied in both wavelength and wavenumber space on both USB and SPI interfaces.
| wasatch.SpectrometerSettings.SpectrometerSettings.detector_serial_number |
| wasatch.SpectrometerSettings.SpectrometerSettings.device_id |
| wasatch.SpectrometerSettings.SpectrometerSettings.eeprom |
| wasatch.SpectrometerSettings.SpectrometerSettings.firmware_requirements |
| wasatch.SpectrometerSettings.SpectrometerSettings.fpga_firmware_version |
| wasatch.SpectrometerSettings.SpectrometerSettings.fpga_options |
| wasatch.SpectrometerSettings.SpectrometerSettings.hardware_info |
| wasatch.SpectrometerSettings.SpectrometerSettings.lock_wavecal |
| wasatch.SpectrometerSettings.SpectrometerSettings.microcontroller_firmware_version |
| wasatch.SpectrometerSettings.SpectrometerSettings.microcontroller_serial_number |
| wasatch.SpectrometerSettings.SpectrometerSettings.num_connected_devices |
| wasatch.SpectrometerSettings.SpectrometerSettings.raman_intensity_factors |
| wasatch.SpectrometerSettings.SpectrometerSettings.state |
| wasatch.SpectrometerSettings.SpectrometerSettings.wavelengths |
| wasatch.SpectrometerSettings.SpectrometerSettings.wavenumbers |