Wasatch.PY
Python application driver for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
wasatch.SpectrometerSettings.SpectrometerSettings Class Reference

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)
 

Public Attributes

 detector_serial_number
 
 device_id
 
 eeprom
 
 firmware_requirements
 
 fpga_firmware_version
 
 fpga_options
 
 hardware_info
 
 lock_wavecal
 
 microcontroller_firmware_version
 
 microcontroller_serial_number
 
 num_connected_devices
 
 raman_intensity_factors
 
 state
 
 wavelengths
 
 wavenumbers
 

Detailed Description

Encapsulate a spectrometer's state, including compiled firmware (FPGAOptions), non-volatile configuration (EEPROM) and volatile state (SpectrometerState).

This class serves two goals:

  1. A picklable object that can be passed between the spectrometer process and the GUI, containing everything the GUI might need to know in convenient form.
  2. A place where the GUI can store settings of MANY different connected spectrometers, and quickly switch between them.

Constructor & Destructor Documentation

◆ __init__()

wasatch.SpectrometerSettings.SpectrometerSettings.__init__ ( self,
device_id = None,
d = None )
Parameters
device_id(Input) where the spectrometer was found (optional)
d(Input) input dictionary (optional)

Member Function Documentation

◆ default_detector_setpoint_degC()

wasatch.SpectrometerSettings.SpectrometerSettings.default_detector_setpoint_degC ( self)

◆ dump()

wasatch.SpectrometerSettings.SpectrometerSettings.dump ( self)

◆ excitation()

wasatch.SpectrometerSettings.SpectrometerSettings.excitation ( self)

◆ full_model()

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.

◆ get_vertical_roi()

wasatch.SpectrometerSettings.SpectrometerSettings.get_vertical_roi ( self)
Todo
return ROI

◆ get_wavecal_coeffs()

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

◆ has_excitation()

wasatch.SpectrometerSettings.SpectrometerSettings.has_excitation ( self)

◆ has_marker()

wasatch.SpectrometerSettings.SpectrometerSettings.has_marker ( self)
Todo
add this to EEPROM.feature_mask if we decide to keep the feature

◆ has_vertical_roi()

wasatch.SpectrometerSettings.SpectrometerSettings.has_vertical_roi ( self)

◆ init_regions()

wasatch.SpectrometerSettings.SpectrometerSettings.init_regions ( self)

called by FID.post_connect

◆ is_andor()

wasatch.SpectrometerSettings.SpectrometerSettings.is_andor ( self)

◆ is_arm()

wasatch.SpectrometerSettings.SpectrometerSettings.is_arm ( self)

◆ is_gen15()

wasatch.SpectrometerSettings.SpectrometerSettings.is_gen15 ( self)

◆ is_gen2()

wasatch.SpectrometerSettings.SpectrometerSettings.is_gen2 ( self)

◆ is_imx()

wasatch.SpectrometerSettings.SpectrometerSettings.is_imx ( self)

◆ is_imx392()

wasatch.SpectrometerSettings.SpectrometerSettings.is_imx392 ( self)

◆ is_ingaas()

wasatch.SpectrometerSettings.SpectrometerSettings.is_ingaas ( self)

◆ is_micro()

wasatch.SpectrometerSettings.SpectrometerSettings.is_micro ( self)

◆ is_mml()

wasatch.SpectrometerSettings.SpectrometerSettings.is_mml ( self)

◆ is_non_raman()

wasatch.SpectrometerSettings.SpectrometerSettings.is_non_raman ( self)

◆ is_sig()

wasatch.SpectrometerSettings.SpectrometerSettings.is_sig ( self)

◆ is_sml()

wasatch.SpectrometerSettings.SpectrometerSettings.is_sml ( self)

◆ is_spi()

wasatch.SpectrometerSettings.SpectrometerSettings.is_spi ( self)

◆ is_xs()

wasatch.SpectrometerSettings.SpectrometerSettings.is_xs ( self)

◆ load_from_dict()

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.

◆ pixels()

wasatch.SpectrometerSettings.SpectrometerSettings.pixels ( self)

◆ set_num_connected_devices()

wasatch.SpectrometerSettings.SpectrometerSettings.set_num_connected_devices ( self,
n )

◆ set_single_region()

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.

◆ set_wavecal_coeffs()

wasatch.SpectrometerSettings.SpectrometerSettings.set_wavecal_coeffs ( self,
coeffs )

◆ set_wavenumber_correction()

wasatch.SpectrometerSettings.SpectrometerSettings.set_wavenumber_correction ( self,
cm )

◆ supports_feature()

wasatch.SpectrometerSettings.SpectrometerSettings.supports_feature ( self,
feature )

◆ to_dict()

wasatch.SpectrometerSettings.SpectrometerSettings.to_dict ( self)

◆ to_json()

wasatch.SpectrometerSettings.SpectrometerSettings.to_json ( self)

◆ update_from_json()

wasatch.SpectrometerSettings.SpectrometerSettings.update_from_json ( self,
s )

◆ update_raman_intensity_factors()

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).

◆ update_wavecal()

wasatch.SpectrometerSettings.SpectrometerSettings.update_wavecal ( self,
coeffs = None )
Discussion re: SPI models

(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.

Todo
update for DetectorRegions

Member Data Documentation

◆ detector_serial_number

wasatch.SpectrometerSettings.SpectrometerSettings.detector_serial_number

◆ device_id

wasatch.SpectrometerSettings.SpectrometerSettings.device_id

◆ eeprom

wasatch.SpectrometerSettings.SpectrometerSettings.eeprom

◆ firmware_requirements

wasatch.SpectrometerSettings.SpectrometerSettings.firmware_requirements

◆ fpga_firmware_version

wasatch.SpectrometerSettings.SpectrometerSettings.fpga_firmware_version

◆ fpga_options

wasatch.SpectrometerSettings.SpectrometerSettings.fpga_options

◆ hardware_info

wasatch.SpectrometerSettings.SpectrometerSettings.hardware_info

◆ lock_wavecal

wasatch.SpectrometerSettings.SpectrometerSettings.lock_wavecal

◆ microcontroller_firmware_version

wasatch.SpectrometerSettings.SpectrometerSettings.microcontroller_firmware_version

◆ microcontroller_serial_number

wasatch.SpectrometerSettings.SpectrometerSettings.microcontroller_serial_number

◆ num_connected_devices

wasatch.SpectrometerSettings.SpectrometerSettings.num_connected_devices

◆ raman_intensity_factors

wasatch.SpectrometerSettings.SpectrometerSettings.raman_intensity_factors

◆ state

wasatch.SpectrometerSettings.SpectrometerSettings.state

◆ wavelengths

wasatch.SpectrometerSettings.SpectrometerSettings.wavelengths

◆ wavenumbers

wasatch.SpectrometerSettings.SpectrometerSettings.wavenumbers

The documentation for this class was generated from the following file: