Wasatch.NET 2.4.14
.NET application driver for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Package Functions | Package Attributes | Properties | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
WasatchNET.Spectrometer Class Reference

Encapsulates a logical Wasatch Photonics spectrometer for communication. More...

Inheritance diagram for WasatchNET.Spectrometer:
[legend]
Collaboration diagram for WasatchNET.Spectrometer:
[legend]

Public Types

enum  LaserPowerResolution { LASER_POWER_RESOLUTION_100 , LASER_POWER_RESOLUTION_1000 , LASER_POWER_RESOLUTION_MANUAL }
 When setting laser power as a percentage (see setLaserPowerPercentage), this enum determines the possible resolution (granularity) of the selectable power. More...
 
enum  UntetheredCaptureStatus {
  IDLE = 0 , DARK = 1 , WARMUP = 2 , SAMPLE = 3 ,
  PROCESSING = 4 , ERROR = 5
}
 

Public Member Functions

void cancelCurrentAcquisition ()
 
virtual void changeSPITrigger (bool edge, bool firmwareThrow)
 
virtual void close ()
 
double[] correctRamanIntensity (double[] spectrum)
 Performs SRM correction on the given spectrum using the ROI and coefficients on EEPROM. Non-ROI pixels are not corrected. If ROI or relative intensity coefficients appear invalid, original spectrum is returned.
 
void dontCache (Opcodes op)
 
bool eraseStorage ()
 
void flushReaders ()
 
ushort getDAC_UNUSED ()
 
virtual ushort[] getFrame ()
 
virtual double[] getSpectrum (bool forceNew=false)
 Take a single complete spectrum, including any configured scan averaging, boxcar, dark subtraction, inversion, binning, and optionally relative intensity correction.
 
byte[] getStorage (UInt16 page)
 
UntetheredCaptureStatus getUntetheredCaptureStatus ()
 
bool haveCache (Opcodes op)
 
virtual bool loadFromJSON (string pathname)
 
virtual bool reconnect ()
 
virtual void regenerateWavelengths ()
 
bool resetFPGA ()
 
bool sendFeedback (UInt16 sequence)
 
bool sendSWTrigger ()
 
bool setDFUMode ()
 Put the ARM microcontroller into DFU mode for firmware update.
 
virtual bool setLaserPowerPercentage (float perc)
 
void useCache (Opcodes op)
 
void close ()
 
double[] getSpectrum (bool forceNew)
 Take a single complete spectrum, including any configured scan averaging, boxcar and dark subtraction.
 
bool reconnect ()
 
void regenerateWavelengths ()
 
bool setDFUMode ()
 Put the ARM microcontroller into DFU mode for firmware update.
 
bool setLaserPowerPercentage (float perc)
 Set laser power to the specified percentage.
 

Public Attributes

int acquisitionMaxRetries = 2
 If a call to Spectrometer.getSpectrum() fails, how many internal (within WasatchNET) retries should be attempted (includes re-sending an ACQUIRE opcode).
 
int delayAfterBulkEndpointErrorMS = 100
 If there is an error reading one of the bulk endpoints, pause this many milliseconds in hopes of the bus resetting itself (does not automatically retry).
 
bool fastAreaScan = false
 
float lastDetectorTemperatureDegC = UNINITIALIZED_TEMPERATURE_DEG_C
 A cached value of the last-measured detector temperature. This is automatically updated following spectral reads if readTemperatureAfterSpectrum is set.
 
int multiChannelPosition = -1
 If the spectrometer is deployed in a multi-channel configuration, this provides a place to store an integral position in the Spectrometer object. (defaults to -1, an invalid position)
 
bool readTemperatureAfterSpectrum = false
 If enabled, Wasatch.NET will automatically read the detector temperature following every successful call to getSpectrum(). That temperature can then be read from lastDetectorTemperatureDegC, without inducing any spectrometer communications.
 

Static Public Attributes

const byte DEVICE_TO_HOST = 0xc0
 
const byte HOST_TO_DEVICE = 0x40
 
const int LEGACY_VERTICAL_PIXELS = 70
 for Stroker Area Scan
 
const ushort SPECTRUM_START_MARKER = 0xffff
 
const float UNINITIALIZED_TEMPERATURE_DEG_C = -999
 

Protected Member Functions

void correctBadPixels (ref double[] spectrum)
 If a spectrometer has bad_pixels configured in the EEPROM, then average over them in the driver.
 
virtual double[] getAreaScanLightweight ()
 
virtual double[] getSpectrumRaw (bool skipTrigger=false)
 just the bytes, ma'am
 

Protected Attributes

bool accessoryEnabled_ = false
 
object acquisitionLock = new object()
 synchronizes getSpectrum, integrationTimeMS, scanAveraging, dark and boxcarHalfWidth
 
object adcLock = new object()
 
bool areaScanEnabled_ = false
 
uint boxcarHalfWidth_
 
bool currentAcquisitionCancelled
 
double[] dark_
 
bool detectorTECEnabled_
 
float detectorTECSetpointDegC_ = UNINITIALIZED_TEMPERATURE_DEG_C
 
ushort detectorTECSetpointRaw_
 
uint integrationTimeMS_
 
bool lampEnabled_ = false
 
bool laserEnabled_
 
bool laserHasFired_
 
UInt64 laserModulationPeriod_
 
UInt64 laserModulationPulseWidth_
 
float laserPowerSetpointMW_ = 0
 
byte laserTemperatureSetpointRaw_
 
Logger logger = Logger.getInstance()
 
double[] reference_
 
uint scanAveraging_ = 1
 
TRIGGER_SOURCE triggerSource_ = TRIGGER_SOURCE.INTERNAL
 

Package Functions

byte[] getCmd (Opcodes opcode, int len, ushort wIndex=0, int fullLen=0)
 Execute a request-response control transaction using the given opcode.
 
byte[] getCmd2 (Opcodes opcode, int len, ushort wIndex=0, int fakeBufferLengthARM=0)
 Execute a request-response transfer with a "second-tier" request.
 
virtual bool open ()
 
bool sendCmd (Opcodes opcode, ushort wValue=0, ushort wIndex=0, byte[] buf=null)
 send a single control transfer command (response not checked)
 
bool sendCmd2 (Opcodes opcode, ushort wIndex=0, byte[] buf=null)
 send a single 2nd-tier control transfer command (response not checked)
 
 Spectrometer (UsbRegistry usbReg)
 

Package Attributes

Dictionary< Opcodes, byte > cmd = OpcodeHelper.getInstance().getDict()
 
bool shuttingDown = false
 
SpectrometerUptime uptime
 

Properties

virtual bool accessoryEnabled [get, set]
 Determines whether or not the Gen1.5 accessory connector's features can be used.
 
int acquireCount = 0 [get, protected set]
 Allows application to track how many ACQUIRE_SPECTRUM commands have been sent to the spectrometer (including throwaways and retries).
 
uint? acquisitionTimeoutMS [get, set]
 Convenience accessor to set an explicit acquisition timeout.

 
uint acquisitionTimeoutRelativeMS [set]
 Allows the NEXT acquisition timeout to be set relative to "now" as an offiset in milliseconds.
 
DateTime? acquisitionTimeoutTimestamp = null [get, set]
 Allows the NEXT acquisition timeout to be set to an explicit objective future timestamp.
 
ushort actualFrames [get]
 How many frames have been read since last power cycle (has overflow)
 
uint actualIntegrationTimeUS [get]
 Return integration time + clock-out time (and laser pulse time if externally triggered).
 
ushort adcRaw [get]
 
virtual bool areaScanEnabled [get, set]
 Configure detector for 2D image mode.
 
bool autoTrigger [get, set]
 Whether the driver should automatically send a software trigger on calls to getSpectrum() when triggerSource is set to INTERNAL. (defaults true)
 
virtual bool batteryCharging [get]
 
virtual float batteryPercentage [get]
 
uint batteryStateRaw [get]
 
virtual uint boxcarHalfWidth [get, set]
 Perform post-acquisition high-frequency smoothing by averaging together "n" pixels to either side of each acquired pixel; zero to disable (default).
 
virtual bool continuousAcquisitionEnable [get, set]
 After the first trigger is received, no further triggers are required; spectrometer will enter free-running mode.
 
virtual byte continuousFrames [get, set]
 When not using "continous acquisitions" with external triggers, how many spectra to acquire per trigger event.
 
virtual double[] dark [get, set]
 Perform automatic dark subtraction by setting this property to an acquired dark spectrum; leave "null" to disable.
 
virtual float detectorGain [get, set]
 Maps to an FPGA register inside the spectrometer used to scale pixels read from the ADC to optimize dynamic range.
 
virtual float detectorGainOdd [get, set]
 (InGaAs-only) Companion property to detectorGain, which on InGaAs detectors applies only to even-numbered pixels.
 
virtual short detectorOffset [get, set]
 Maps to an FPGA register inside the spectrometer used to offset the pixels (dark baseline) read from the ADC to optimize dynamic range.
 
virtual short detectorOffsetOdd [get, set]
 (InGaAs-only) Companion property to detectorOffset, which on InGaAs detectors applies only to even-numbered pixels.
 
ushort detectorSensingThreshold [get, set]
 
bool detectorSensingThresholdEnabled [get, set]
 
virtual UInt16 detectorStartLine [get, set]
 
virtual UInt16 detectorStopLine [get, set]
 
virtual bool detectorTECEnabled [get, set]
 
virtual float detectorTECSetpointDegC [get, set]
 
virtual ushort detectorTECSetpointRaw [get, set]
 
double detectorTemperatureCacheTimeMS = 1000 [get, set]
 
virtual float detectorTemperatureDegC [get]
 
virtual ushort detectorTemperatureRaw [get]
 
EEPROM eeprom [get, protected set]
 configuration settings stored in the spectrometer's EEPROM
 
bool errorOnTimeout = true [get, set]
 Whether an ERROR should be logged on a timeout event (default true)
 
virtual float excitationWavelengthNM [get, set]
 
FeatureIdentification featureIdentification [get, set]
 metadata inferred from the spectrometer's USB PID
 
virtual string firmwareRevision [get]
 
FPGAOptions fpgaOptions [get, private set]
 set of compilation options used to compile the FPGA firmware in this spectrometer
 
virtual string fpgaRevision [get]
 
FRAM fram [get, protected set]
 
virtual bool hasLaser [get]
 
bool hasMarker [get, set]
 Some spectrometers send a start-of-frame marker in the first pixel of the spectrum.
 
bool hasSecondaryADC = false [get, set]
 This should be replaced with an FGPACompilationFlag or EEPROM field at some point.
 
virtual bool highGainModeEnabled [get, set]
 
HORIZONTAL_BINNING horizontalBinning [get, set]
 
string id [get]
 couples serial number with channel position
 
virtual uint integrationTimeMS [get, set]
 Current integration time in milliseconds.
 
virtual bool isARM [get]
 
bool isGen15 [get]
 Whether the spectrometer uses a "Gen 1.5" accessory connector.
 
virtual bool isInGaAs [get]
 
bool isOCT = false [get, protected set]
 Optical Coherence Tomography (OCT) spectrometers differ from "standard" spectrometers in several respects, such as producing both 2D and 3D imagery.
 
bool isSiG [get]
 
bool isSPI = false [get, protected set]
 Whether the spectrometer uses Serial Peripheral Interface (as opposed to USB for instance).
 
bool isStroker = false [get, protected set]
 Stroker is a legacy board firmware with older PID (not 0x1000, 0x2000 or 0x4000), doesn't conform to Feature Identification Device (FID) Protocol, and lacking an EEPROM.
 
virtual bool lampEnabled [get, set]
 Whether the lamp attached via Gen 1.5 attachment has been requested to be turned on by the software and firmware.
 
virtual bool laserEnabled [get, set]
 Whether the laser has been REQUESTED TO FIRE by the software and firmware.
 
virtual bool laserFiring [get]
 Whether the laser is ACTUALLY FIRING, according to the laser driver and laser interlock board.
 
virtual bool laserInterlockEnabled [get]
 True if the laser can fire (interlock circuit is CLOSED), false if the laser cannot fire (interlock circuit is OPEN).

 
UInt64 laserModulationDuration [get, set]
 If you only want the laser to be modulated for a portion of each acquisition (rare), how long in microseconds should the laser be modulated during each integration.
 
bool laserModulationEnabled [get, set]
 
bool laserModulationLinkedToIntegrationTime [get, set]
 
virtual UInt64 laserModulationPeriod [get, set]
 When defining the laser modulation duty cycle, the length (period) of the duty cycle in microsec.
 
UInt64 laserModulationPulseDelay [get, set]
 If you want the laser modulation to start part-way through an acquisition, this defines the delay in microseconds from the beginning of the integration until laser modulation begins.
 
virtual UInt64 laserModulationPulseWidth [get, set]
 When defining the laser modulation duty cycle, the length (width) of the period during which the laser is enabled.
 
virtual LaserPowerResolution laserPowerResolution = LaserPowerResolution.LASER_POWER_RESOLUTION_1000 [get, set]
 
virtual float laserPowerSetpointMW [get, set]
 Use this to set the laser output power in milliWatts.
 
bool laserRampingEnabled [get, set]
 disabled to deconflict area scan
 
virtual float laserTemperatureDegC [get]
 convert the raw laser temperature reading into degrees centigrade
 
virtual ushort laserTemperatureRaw [get]
 Synonym for primaryADC.
 
virtual byte laserTemperatureSetpointRaw [get, set]
 FACTORY ONLY.
 
double[] lastSpectrum [get, protected set]
 Useful if you lost the results of getSpectrum, or if you want to peek into ongoing multi-acquisition tasks like scan averaging or optimization.
 
uint lineLength [get]
 
int linesPerFrame [get, protected set]
 
string model [get]
 spectrometer model
 
bool multiChannelSelected [get, set]
 Multichannel convenience accessor (default false)
 
bool optActualIntegrationTime [get]
 
bool optAreaScan [get]
 Whether area scan mode is supported.
 
bool optCFSelect [get]
 Internal firmware name for the highGainModeEnabled feature available on InGaAs detectors.
 
FPGA_DATA_HEADER optDataHeaderTag [get]
 
bool optHorizontalBinning [get]
 
FPGA_INTEG_TIME_RES optIntegrationTimeResolution [get]
 
FPGA_LASER_CONTROL optLaserControl [get]
 
FPGA_LASER_TYPE optLaserType [get]
 
double[] pixelAxis [get]
 convenience accesor for pixel axis (lazy-loaded), for parallelism with wavelengths and wavenumbers
 
uint pixels [get, protected set]
 how many pixels does the spectrometer have (spectrum length)
 
ushort primaryADC [get]
 
bool ramanIntensityCorrectionEnabled [get, set]
 Whether to correct the y-axis using SRM-derived correction factors, stored as coefficients on the spectrometer.
 
virtual double[] reference [get, set]
 Simplify reference-based techniques (absorbance, reflectance, transmission etc) by allowing a reference to be stored with the Spectrometer, similar to dark.

 
virtual uint scanAveraging [get, set]
 How many acquisitions to average together (0 or 1 for no averaging). (default 1)
 
bool scanAveragingIsContinuous [get, set]
 Whether the "scanAveraging" property should automatically configure continuousAcquisitionEnable and continuousFrames. (default false)
 
virtual ushort secondaryADC [get]
 This is provided for spectrometers with a secondary ADC connected to an external laser, photodiode or what-have-you. Attempts to read it on spectrometers where it has not been configured can result in indeterminate behavior; therefore, hasSecondaryADC is provided to allow callers to selectively enable this function if they believe they are using supported hardware.
 
byte selectedADC [get, set]
 
virtual string serialNumber [get]
 spectrometer serial number
 
int shiftedMarkerCount = 0 [get, private set]
 For spectrometer firmware providing "start of spectrum markers", provides a count of how many INCORRECT markers were found in the MOST RECENT spectrum.
 
int spectrumCount = 0 [get, protected set]
 Allows application to track how many successful (non-null) calls have been made to getSpectrum (whether averaged or otherwise).
 
bool throwawayADCRead = true [get, set]
 Whether the driver should automatically perform a throwaway ADC read when changing the selected ADC. (defaults true)
 
bool throwawayAfterIntegrationTime [get, set]
 Whether the driver should automatically generate a throwaway "stability" measurement after changing integration time. (defaults false)
 
uint triggerDelay [get, set]
 A configurable delay from when an inbound trigger signal is received by the spectrometer, until the triggered acquisition actually starts.
 
EXTERNAL_TRIGGER_OUTPUT triggerOutput [get, set]
 
virtual TRIGGER_SOURCE triggerSource [get, set]
 Whether acquisitions are triggered "internally" (via the ACQUIRE opcode sent by software) or "externally" (via an electrical signal wired to the accessory connector).
 
string uniqueKey [get, set]
 
bool untetheredAcquisitionEnabled = false [get, set]
 Untethered operation requires an argument to ACQUIRE, and polls before reading spectrum.
 
bool useReadoutMutex [get, set]
 Whether to synchronize all spectral reads with a class-level (static) mutex.

 
double[] wavelengths [get, protected set]
 pre-populated array of wavelengths (nm) by pixel, generated from eeprom.wavecalCoeffs
 
double[] wavenumbers [get, protected set]
 pre-populated array of Raman shifts in wavenumber (1/cm) by pixel, generated from wavelengths[] and excitationNM
 
- Properties inherited from WasatchNET.ISpectrometer
bool accessoryEnabled [get, set]
 Determines whether or not the Gen1.5 accessory connector's features can be used.
 
ushort actualFrames [get]
 How many frames have been read since last power cycle (has overflow)
 
uint actualIntegrationTimeUS [get]
 Return integration time + clock-out time (and laser pulse time if externally triggered).
 
bool areaScanEnabled [get, set]
 Configure detector for 2D image mode.
 
bool batteryCharging [get]
 
float batteryPercentage [get]
 
uint batteryStateRaw [get]
 
uint boxcarHalfWidth [get, set]
 Perform post-acquisition high-frequency smoothing by averaging together "n" pixels to either side of each acquired pixel; zero to disable (default).
 
bool continuousAcquisitionEnable [get, set]
 After the first trigger is received, no further triggers are required; spectrometer will enter free-running mode.
 
byte continuousFrames [get, set]
 When not using "continous acquisitions" with external triggers, how many spectra to acquire per trigger event.
 
double[] dark [get, set]
 Perform automatic dark subtraction by setting this property to an acquired dark spectrum; leave "null" to disable.
 
float detectorGain [get, set]
 Maps to an FPGA register inside the spectrometer used to scale pixels read from the ADC to optimize dynamic range.
 
float detectorGainOdd [get, set]
 (InGaAs-only) Companion property to detectorGain, which on InGaAs detectors applies only to even-numbered pixels.
 
short detectorOffset [get, set]
 Maps to an FPGA register inside the spectrometer used to offset the pixels (dark baseline) read from the ADC to optimize dynamic range.
 
short detectorOffsetOdd [get, set]
 (InGaAs-only) Companion property to detectorOffset, which on InGaAs detectors applies only to even-numbered pixels.
 
ushort detectorSensingThreshold [get, set]
 
bool detectorSensingThresholdEnabled [get, set]
 
bool detectorTECEnabled [get, set]
 
float detectorTECSetpointDegC [get, set]
 
ushort detectorTECSetpointRaw [get, set]
 
double detectorTemperatureCacheTimeMS [get, set]
 
float detectorTemperatureDegC [get]
 
ushort detectorTemperatureRaw [get]
 
EEPROM eeprom [get]
 configuration settings stored in the spectrometer's EEPROM
 
float excitationWavelengthNM [get, set]
 
FeatureIdentification featureIdentification [get]
 metadata inferred from the spectrometer's USB PID
 
string firmwareRevision [get]
 
FPGAOptions fpgaOptions [get]
 set of compilation options used to compile the FPGA firmware in this spectrometer
 
string fpgaRevision [get]
 
bool hasLaser [get]
 
bool hasSecondaryADC [get, set]
 This should be replaced with an FGPACompilationFlag or EEPROM field at some point.
 
bool highGainModeEnabled [get, set]
 
uint integrationTimeMS [get, set]
 Current integration time in milliseconds.
 
bool isARM [get]
 
bool isGen15 [get]
 
bool isInGaAs [get]
 
bool isSiG [get]
 
bool isSPI [get]
 
bool lampEnabled [get, set]
 Whether the lamp attached via Gen 1.5 attachment has been requested to be turned on by the software and firmware.
 
bool laserEnabled [get, set]
 Whether the laser has been REQUESTED TO FIRE by the software and firmware.
 
bool laserFiring [get]
 Whether the laser is ACTUALLY FIRING, according to the laser driver and laser interlock board.
 
bool laserInterlockEnabled [get]
 True if the laser can fire (interlock circuit is CLOSED), false if the laser cannot fire (interlock circuit is OPEN).

 
UInt64 laserModulationDuration [get, set]
 If you only want the laser to be modulated for a portion of each acquisition (rare), how long in microseconds should the laser be modulated during each integration.
 
bool laserModulationEnabled [get, set]
 
bool laserModulationLinkedToIntegrationTime [get, set]
 
UInt64 laserModulationPeriod [get, set]
 When defining the laser modulation duty cycle, the length (period) of the duty cycle in microsec.
 
UInt64 laserModulationPulseDelay [get, set]
 If you want the laser modulation to start part-way through an acquisition, this defines the delay in microseconds from the beginning of the integration until laser modulation begins.
 
UInt64 laserModulationPulseWidth [get, set]
 When defining the laser modulation duty cycle, the length (width) of the period during which the laser is enabled.
 
Spectrometer.LaserPowerResolution laserPowerResolution [get, set]
 
bool laserRampingEnabled [get, set]
 
float laserTemperatureDegC [get]
 convert the raw laser temperature reading into degrees centigrade
 
ushort laserTemperatureRaw [get]
 Synonym for primaryADC.
 
byte laserTemperatureSetpointRaw [get, set]
 FACTORY ONLY.
 
uint lineLength [get]
 
string model [get]
 spectrometer model
 
bool optActualIntegrationTime [get]
 
bool optAreaScan [get]
 Whether area scan mode is supported.
 
bool optCFSelect [get]
 Internal firmware name for the highGainModeEnabled feature available on InGaAs detectors.
 
FPGA_DATA_HEADER optDataHeaderTag [get]
 
bool optHorizontalBinning [get]
 
FPGA_INTEG_TIME_RES optIntegrationTimeResolution [get]
 
FPGA_LASER_CONTROL optLaserControl [get]
 
FPGA_LASER_TYPE optLaserType [get]
 
uint pixels [get]
 how many pixels does the spectrometer have (spectrum length)
 
ushort primaryADC [get]
 
bool ramanIntensityCorrectionEnabled [get, set]
 
uint scanAveraging [get, set]
 How many acquisitions to average together (zero for no averaging)
 
ushort secondaryADC [get]
 This is provided for spectrometers with a secondary ADC connected to an external laser, photodiode or what-have-you. Attempts to read it on spectrometers where it has not been configured can result in indeterminate behavior; therefore, hasSecondaryADC is provided to allow callers to selectively enable this function if they believe they are using supported hardware.
 
string serialNumber [get]
 spectrometer serial number
 
uint triggerDelay [get, set]
 A configurable delay from when an inbound trigger signal is received by the spectrometer, until the triggered acquisition actually starts.
 
EXTERNAL_TRIGGER_OUTPUT triggerOutput [get, set]
 
TRIGGER_SOURCE triggerSource [get, set]
 Whether acquisitions are triggered "internally" (via the ACQUIRE opcode sent by software) or "externally" (via an electrical signal wired to the accessory connector).
 
double[] wavelengths [get]
 pre-populated array of wavelengths (nm) by pixel, generated from eeprom.wavecalCoeffs
 
double[] wavenumbers [get]
 pre-populated array of Raman shifts in wavenumber (1/cm) by pixel, generated from wavelengths[] and excitationNM
 

Private Member Functions

void configureContinuousAcquisition ()
 
uint[] correctIngaasEvenOdd (uint[] spectrum)
 
int generateTimeoutMS ()
 
string generateUniqueKey (UsbRegistry usbRegistry)
 This generates a string identifier for the spectrometer which should be enough to distinguish it from others with the same VID/PID using nothing but UsbRegistry information (e.g. bus address). Note that this is to be used for recognizing previously-opened spectrometers BEFORE reading their EEPROM.
 
void performThrowawaySpectrum ()
 Generate a throwaway spectrum, such as following a change in integration time on spectrometers requiring such.
 
uint[] readImage (UsbEndpointReader spectralReader, int pixelsPerEndpoint)
 
uint[] readSubspectrum (UsbEndpointReader spectralReader, int pixelsPerEndpoint)
 
uint[] readSubspectrumLightweight (UsbEndpointReader spectralReader, int pixelsPerEndpoint)
 
uint[] readSubspectrumStroker (UsbEndpointReader spectralReader, int pixelsPerEndpoint)
 
string stringifyPacket (UsbSetupPacket packet)
 
ushort swapBytes (ushort raw)
 Although most values read from the spectrometer are little-endian by design, a few are big-endian.
 
bool waitForUntetheredData ()
 
Returns
true if poll was successful (data ready), false on error

 
void waitForUsbAvailable ()
 

Private Attributes

bool _ramanIntensityCorrectionEnabled = false
 
bool adcHasBeenSelected_
 
HashSet< OpcodesarmInvertedRetvals = OpcodeHelper.getInstance().getArmInvertedRetvals()
 
bool autoTrigger_ = true
 
uint batteryStateRaw_ = 0
 
DateTime? batteryStateTimestamp_ = null
 
object commsLock = new object()
 synchronizes getCmd, getCmd2, sendCmd
 
bool continuousAcquisitionEnable_
 
byte continuousFrames_
 
float detectorGain_
 
float detectorGainOdd_
 
short detectorOffset_
 
short detectorOffsetOdd_
 
ushort detectorSensingThreshold_
 
bool detectorSensingThresholdEnabled_
 
ushort detectorStartLine_ = 0
 
ushort detectorStopLine_ = 0
 
ushort detectorTemperatureRaw_ = 0
 
DateTime detectorTemperatureRawTimestamp = DateTime.Now
 
List< UsbEndpointReader > endpoints = new List<UsbEndpointReader>()
 
string firmwareRevision_
 
string fpgaRevision_
 
bool hasMarker_
 
bool highGainModeEnabled_
 
HORIZONTAL_BINNING horizontalBinning_
 
UInt64 laserModulationDuration_
 
bool laserModulationEnabled_
 
bool laserModulationLinkedToIntegrationTime_
 
UInt64 laserModulationPulseDelay_
 
DateTime lastUsbTimestamp = DateTime.Now
 
uint lineLength_
 
HashSet< OpcodesnoCache = new HashSet<Opcodes>()
 
bool optActualIntegrationTime_
 
bool optAreaScan_
 
bool optCFSelect_
 
FPGA_DATA_HEADER optDataHeaderTag_ = FPGA_DATA_HEADER.ERROR
 
bool optHorizontalBinning_
 
FPGA_INTEG_TIME_RES optIntegrationTimeResolution_ = FPGA_INTEG_TIME_RES.ERROR
 
FPGA_LASER_CONTROL optLaserControl_ = FPGA_LASER_CONTROL.ERROR
 
FPGA_LASER_TYPE optLaserType_ = FPGA_LASER_TYPE.ERROR
 
double[] pixelAxis_ = null
 
int pixelsPerEndpoint = 0
 
HashSet< OpcodesreadOnce = new HashSet<Opcodes>()
 
bool scanAveragingIsContinuous_
 
byte selectedADC_
 
UsbEndpointReader spectralReader82
 
UsbEndpointReader spectralReader86
 
ulong throwawaySum = 0
 
uint triggerDelay_
 
EXTERNAL_TRIGGER_OUTPUT triggerOutput_ = EXTERNAL_TRIGGER_OUTPUT.ERROR
 
UsbDevice usbDevice
 
UsbRegistry usbRegistry
 
bool usingDualEndpoints
 
IUsbDevice wholeUsbDevice
 

Static Private Attributes

static Mutex readoutMutex = new Mutex()
 

Detailed Description

Encapsulates a logical Wasatch Photonics spectrometer for communication.

For WP spectrometer API, see ENG-0001 "WP Raman USB Interface Specification r1.4"

NOT rigorously tested for thread-safety. It MAY be thread-safe, it WILL be thread-safe, but currently it is not GUARANTEED thread-safe.

Currently the only supported bus is USB (using LibUsbDotNet). There are relatively few accesses to the raw USB objects in this implementation, so it should be fairly easy to refactor to support Bluetooth, Ethernet etc when I get test units.

<todo> Should really just add getAreaScan() method, which correctly does everything for whatever spectrometer is connected, returning the 2D array. </todo>

Member Enumeration Documentation

◆ LaserPowerResolution

When setting laser power as a percentage (see setLaserPowerPercentage), this enum determines the possible resolution (granularity) of the selectable power.

  • 100 = 1% resolution (74.4% would round down to 74% power), using pulse period of 100us
  • 1000 = 0.1% resolution (74.4% would yield 74.4% power), use pulse period of 1000us
  • MANUAL = "use whatever laserModulationPulseWidth has been set by the caller"
Enumerator
LASER_POWER_RESOLUTION_100 
LASER_POWER_RESOLUTION_1000 
LASER_POWER_RESOLUTION_MANUAL 

◆ UntetheredCaptureStatus

Enumerator
IDLE 
DARK 
WARMUP 
SAMPLE 
PROCESSING 
ERROR 

Constructor & Destructor Documentation

◆ Spectrometer()

WasatchNET.Spectrometer.Spectrometer ( UsbRegistry  usbReg)
inlinepackage

Member Function Documentation

◆ cancelCurrentAcquisition()

void WasatchNET.Spectrometer.cancelCurrentAcquisition ( )

◆ changeSPITrigger()

virtual void WasatchNET.Spectrometer.changeSPITrigger ( bool  edge,
bool  firmwareThrow 
)
inlinevirtual

Reimplemented in WasatchNET.SPISpectrometer.

◆ close()

virtual void WasatchNET.Spectrometer.close ( )
inlinevirtual

◆ configureContinuousAcquisition()

void WasatchNET.Spectrometer.configureContinuousAcquisition ( )
inlineprivate

◆ correctBadPixels()

void WasatchNET.Spectrometer.correctBadPixels ( ref double[]  spectrum)
inlineprotected

If a spectrometer has bad_pixels configured in the EEPROM, then average over them in the driver.


◆ correctIngaasEvenOdd()

uint[] WasatchNET.Spectrometer.correctIngaasEvenOdd ( uint[]  spectrum)
inlineprivate

◆ correctRamanIntensity()

double[] WasatchNET.Spectrometer.correctRamanIntensity ( double[]  spectrum)

Performs SRM correction on the given spectrum using the ROI and coefficients on EEPROM. Non-ROI pixels are not corrected. If ROI or relative intensity coefficients appear invalid, original spectrum is returned.

Returns
The given spectrum, with ROI srm-corrected, as an array of doubles

◆ dontCache()

void WasatchNET.Spectrometer.dontCache ( Opcodes  op)
inline

◆ eraseStorage()

bool WasatchNET.Spectrometer.eraseStorage ( )
inline

◆ flushReaders()

void WasatchNET.Spectrometer.flushReaders ( )
inline

◆ generateTimeoutMS()

int WasatchNET.Spectrometer.generateTimeoutMS ( )
inlineprivate

◆ generateUniqueKey()

string WasatchNET.Spectrometer.generateUniqueKey ( UsbRegistry  usbRegistry)
inlineprivate

This generates a string identifier for the spectrometer which should be enough to distinguish it from others with the same VID/PID using nothing but UsbRegistry information (e.g. bus address). Note that this is to be used for recognizing previously-opened spectrometers BEFORE reading their EEPROM.

Parameters
usbRegistry
Returns

◆ getAreaScanLightweight()

virtual double[] WasatchNET.Spectrometer.getAreaScanLightweight ( )
inlineprotectedvirtual

◆ getCmd()

byte[] WasatchNET.Spectrometer.getCmd ( Opcodes  opcode,
int  len,
ushort  wIndex = 0,
int  fullLen = 0 
)
inlinepackage

Execute a request-response control transaction using the given opcode.

Parameters
opcodethe opcode of the desired request
lenthe number of needed return bytes
wIndexan optional numeric argument used by some opcodes
fullLenthe actual number of expected return bytes (not all needed)

not sure fullLen is actually required...testing

Returns
the array of returned bytes (null on error)

◆ getCmd2()

byte[] WasatchNET.Spectrometer.getCmd2 ( Opcodes  opcode,
int  len,
ushort  wIndex = 0,
int  fakeBufferLengthARM = 0 
)
inlinepackage

Execute a request-response transfer with a "second-tier" request.

Parameters
opcodethe wValue to send along with the "second-tier" command
lenhow many bytes of response are expected
Returns
array of returned bytes (null on error)

◆ getDAC_UNUSED()

ushort WasatchNET.Spectrometer.getDAC_UNUSED ( )
inline

◆ getFrame()

virtual ushort[] WasatchNET.Spectrometer.getFrame ( )
inlinevirtual

◆ getSpectrum()

virtual double[] WasatchNET.Spectrometer.getSpectrum ( bool  forceNew = false)
inlinevirtual

Take a single complete spectrum, including any configured scan averaging, boxcar, dark subtraction, inversion, binning, and optionally relative intensity correction.

Parameters
forceNewnot used in base class (provided for specialized subclasses)
Returns
The acquired spectrum as an array of doubles

Implements WasatchNET.ISpectrometer.

Reimplemented in WasatchNET.BoulderSpectrometer, WasatchNET.HOCTSpectrometer, WasatchNET.MockSpectrometer, and WasatchNET.SPISpectrometer.

◆ getSpectrumRaw()

virtual double[] WasatchNET.Spectrometer.getSpectrumRaw ( bool  skipTrigger = false)
inlineprotectedvirtual

just the bytes, ma'am

Parameters
skipTriggerallows getSpectrum to suppress SW triggers when scanAveraging, on scans after the first, if scanAveragingIsContinuous

Reimplemented in WasatchNET.BoulderSpectrometer, WasatchNET.MockSpectrometer, and WasatchNET.SPISpectrometer.

◆ getStorage()

byte[] WasatchNET.Spectrometer.getStorage ( UInt16  page)
inline

◆ getUntetheredCaptureStatus()

UntetheredCaptureStatus WasatchNET.Spectrometer.getUntetheredCaptureStatus ( )
inline

◆ haveCache()

bool WasatchNET.Spectrometer.haveCache ( Opcodes  op)
inline

◆ loadFromJSON()

virtual bool WasatchNET.Spectrometer.loadFromJSON ( string  pathname)
inlinevirtual

◆ open()

virtual bool WasatchNET.Spectrometer.open ( )
inlinepackagevirtual

◆ performThrowawaySpectrum()

void WasatchNET.Spectrometer.performThrowawaySpectrum ( )
inlineprivate

Generate a throwaway spectrum, such as following a change in integration time on spectrometers requiring such.

If the caller doesn't want to block on this, they can always change integrationTimeMS within a Task.Run closure.

<todo> Consider simply disabling this feature (returning from this function) if autoTrigger is disabled or using HW triggering. In such cases, if the user wants a throwaway, they can generate it themselves. </todo>

◆ readImage()

uint[] WasatchNET.Spectrometer.readImage ( UsbEndpointReader  spectralReader,
int  pixelsPerEndpoint 
)
inlineprivate

◆ readSubspectrum()

uint[] WasatchNET.Spectrometer.readSubspectrum ( UsbEndpointReader  spectralReader,
int  pixelsPerEndpoint 
)
inlineprivate

◆ readSubspectrumLightweight()

uint[] WasatchNET.Spectrometer.readSubspectrumLightweight ( UsbEndpointReader  spectralReader,
int  pixelsPerEndpoint 
)
inlineprivate

◆ readSubspectrumStroker()

uint[] WasatchNET.Spectrometer.readSubspectrumStroker ( UsbEndpointReader  spectralReader,
int  pixelsPerEndpoint 
)
inlineprivate

◆ reconnect()

virtual bool WasatchNET.Spectrometer.reconnect ( )
inlinevirtual

◆ regenerateWavelengths()

virtual void WasatchNET.Spectrometer.regenerateWavelengths ( )
inlinevirtual

◆ resetFPGA()

bool WasatchNET.Spectrometer.resetFPGA ( )
inline

◆ sendCmd()

bool WasatchNET.Spectrometer.sendCmd ( Opcodes  opcode,
ushort  wValue = 0,
ushort  wIndex = 0,
byte[]  buf = null 
)
inlinepackage

send a single control transfer command (response not checked)

Parameters
opcodethe desired command
wValuean optional secondary argument used by most commands
wIndexan optional tertiary argument used by some commands
bufa data buffer used by some commands
Returns
true on success, false on error

<todo>should support return code checking...most cmd opcodes return a success/failure byte</todo>

◆ sendCmd2()

bool WasatchNET.Spectrometer.sendCmd2 ( Opcodes  opcode,
ushort  wIndex = 0,
byte[]  buf = null 
)
inlinepackage

send a single 2nd-tier control transfer command (response not checked)

Parameters
opcodethe desired command
wIndexan optional secondary argument used by some 2nd-tier commands
bufa data buffer used by some commands
Returns
true on success, false on error

<todo>should support return code checking...most cmd opcodes return a success/failure byte</todo>

◆ sendFeedback()

bool WasatchNET.Spectrometer.sendFeedback ( UInt16  sequence)
inline

◆ sendSWTrigger()

bool WasatchNET.Spectrometer.sendSWTrigger ( )
inline

◆ setDFUMode()

bool WasatchNET.Spectrometer.setDFUMode ( )
inline

Put the ARM microcontroller into DFU mode for firmware update.

Will not work on FX2. Cannot be "undone" from software (power-cycle the spectrometer to reset out of DFU mode). Not recommended for the faint of heart.

Implements WasatchNET.ISpectrometer.

◆ setLaserPowerPercentage()

virtual bool WasatchNET.Spectrometer.setLaserPowerPercentage ( float  perc)
inlinevirtual
Parameters
perca normalized floating-point percentage from 0.0 to 1.0 (100%)

Not implemented as a property because it truly isn't; it's a complex combination of actual spectrometer properties.

Technically you don't need to call this function at all, and can set the laserModulationPulseWidth, laserModulationPulsePeriod and laserModulationEnabled properties directly if you wish.

Alternately, you can use the laserPowerSetpointMW property to set laser power in mW, provided a suitable laser power calibration is loaded onto the EEPROM.

Implements WasatchNET.ISpectrometer.

Reimplemented in WasatchNET.BoulderSpectrometer, WasatchNET.MockSpectrometer, and WasatchNET.SPISpectrometer.

◆ stringifyPacket()

string WasatchNET.Spectrometer.stringifyPacket ( UsbSetupPacket  packet)
inlineprivate

◆ swapBytes()

ushort WasatchNET.Spectrometer.swapBytes ( ushort  raw)
inlineprivate

Although most values read from the spectrometer are little-endian by design, a few are big-endian.

Parameters
rawinput value in one endian
Returns
same value with the bytes reversed

◆ useCache()

void WasatchNET.Spectrometer.useCache ( Opcodes  op)
inline

◆ waitForUntetheredData()

bool WasatchNET.Spectrometer.waitForUntetheredData ( )
inlineprivate

Returns
true if poll was successful (data ready), false on error

◆ waitForUsbAvailable()

void WasatchNET.Spectrometer.waitForUsbAvailable ( )
inlineprivate

Member Data Documentation

◆ _ramanIntensityCorrectionEnabled

bool WasatchNET.Spectrometer._ramanIntensityCorrectionEnabled = false
private

◆ accessoryEnabled_

bool WasatchNET.Spectrometer.accessoryEnabled_ = false
protected

◆ acquisitionLock

object WasatchNET.Spectrometer.acquisitionLock = new object()
protected

synchronizes getSpectrum, integrationTimeMS, scanAveraging, dark and boxcarHalfWidth

◆ acquisitionMaxRetries

int WasatchNET.Spectrometer.acquisitionMaxRetries = 2

If a call to Spectrometer.getSpectrum() fails, how many internal (within WasatchNET) retries should be attempted (includes re-sending an ACQUIRE opcode).

◆ adcHasBeenSelected_

bool WasatchNET.Spectrometer.adcHasBeenSelected_
private

◆ adcLock

object WasatchNET.Spectrometer.adcLock = new object()
protected

◆ areaScanEnabled_

bool WasatchNET.Spectrometer.areaScanEnabled_ = false
protected

◆ armInvertedRetvals

HashSet<Opcodes> WasatchNET.Spectrometer.armInvertedRetvals = OpcodeHelper.getInstance().getArmInvertedRetvals()
private

◆ autoTrigger_

bool WasatchNET.Spectrometer.autoTrigger_ = true
private

◆ batteryStateRaw_

uint WasatchNET.Spectrometer.batteryStateRaw_ = 0
private

◆ batteryStateTimestamp_

DateTime? WasatchNET.Spectrometer.batteryStateTimestamp_ = null
private

◆ boxcarHalfWidth_

uint WasatchNET.Spectrometer.boxcarHalfWidth_
protected

◆ cmd

Dictionary<Opcodes, byte> WasatchNET.Spectrometer.cmd = OpcodeHelper.getInstance().getDict()
package

◆ commsLock

object WasatchNET.Spectrometer.commsLock = new object()
private

synchronizes getCmd, getCmd2, sendCmd

◆ continuousAcquisitionEnable_

bool WasatchNET.Spectrometer.continuousAcquisitionEnable_
private

◆ continuousFrames_

byte WasatchNET.Spectrometer.continuousFrames_
private

◆ currentAcquisitionCancelled

bool WasatchNET.Spectrometer.currentAcquisitionCancelled
protected

◆ dark_

double [] WasatchNET.Spectrometer.dark_
protected

◆ delayAfterBulkEndpointErrorMS

int WasatchNET.Spectrometer.delayAfterBulkEndpointErrorMS = 100

If there is an error reading one of the bulk endpoints, pause this many milliseconds in hopes of the bus resetting itself (does not automatically retry).

◆ detectorGain_

float WasatchNET.Spectrometer.detectorGain_
private

◆ detectorGainOdd_

float WasatchNET.Spectrometer.detectorGainOdd_
private

◆ detectorOffset_

short WasatchNET.Spectrometer.detectorOffset_
private

◆ detectorOffsetOdd_

short WasatchNET.Spectrometer.detectorOffsetOdd_
private

◆ detectorSensingThreshold_

ushort WasatchNET.Spectrometer.detectorSensingThreshold_
private

◆ detectorSensingThresholdEnabled_

bool WasatchNET.Spectrometer.detectorSensingThresholdEnabled_
private

◆ detectorStartLine_

ushort WasatchNET.Spectrometer.detectorStartLine_ = 0
private

◆ detectorStopLine_

ushort WasatchNET.Spectrometer.detectorStopLine_ = 0
private

◆ detectorTECEnabled_

bool WasatchNET.Spectrometer.detectorTECEnabled_
protected

◆ detectorTECSetpointDegC_

float WasatchNET.Spectrometer.detectorTECSetpointDegC_ = UNINITIALIZED_TEMPERATURE_DEG_C
protected

◆ detectorTECSetpointRaw_

ushort WasatchNET.Spectrometer.detectorTECSetpointRaw_
protected

◆ detectorTemperatureRaw_

ushort WasatchNET.Spectrometer.detectorTemperatureRaw_ = 0
private

◆ detectorTemperatureRawTimestamp

DateTime WasatchNET.Spectrometer.detectorTemperatureRawTimestamp = DateTime.Now
private

◆ DEVICE_TO_HOST

const byte WasatchNET.Spectrometer.DEVICE_TO_HOST = 0xc0
static

◆ endpoints

List<UsbEndpointReader> WasatchNET.Spectrometer.endpoints = new List<UsbEndpointReader>()
private

◆ fastAreaScan

bool WasatchNET.Spectrometer.fastAreaScan = false

◆ firmwareRevision_

string WasatchNET.Spectrometer.firmwareRevision_
private

◆ fpgaRevision_

string WasatchNET.Spectrometer.fpgaRevision_
private

◆ hasMarker_

bool WasatchNET.Spectrometer.hasMarker_
private

◆ highGainModeEnabled_

bool WasatchNET.Spectrometer.highGainModeEnabled_
private

◆ horizontalBinning_

HORIZONTAL_BINNING WasatchNET.Spectrometer.horizontalBinning_
private

◆ HOST_TO_DEVICE

const byte WasatchNET.Spectrometer.HOST_TO_DEVICE = 0x40
static

◆ integrationTimeMS_

uint WasatchNET.Spectrometer.integrationTimeMS_
protected

◆ lampEnabled_

bool WasatchNET.Spectrometer.lampEnabled_ = false
protected

◆ laserEnabled_

bool WasatchNET.Spectrometer.laserEnabled_
protected

◆ laserHasFired_

bool WasatchNET.Spectrometer.laserHasFired_
protected

◆ laserModulationDuration_

UInt64 WasatchNET.Spectrometer.laserModulationDuration_
private

◆ laserModulationEnabled_

bool WasatchNET.Spectrometer.laserModulationEnabled_
private

◆ laserModulationLinkedToIntegrationTime_

bool WasatchNET.Spectrometer.laserModulationLinkedToIntegrationTime_
private

◆ laserModulationPeriod_

UInt64 WasatchNET.Spectrometer.laserModulationPeriod_
protected

◆ laserModulationPulseDelay_

UInt64 WasatchNET.Spectrometer.laserModulationPulseDelay_
private

◆ laserModulationPulseWidth_

UInt64 WasatchNET.Spectrometer.laserModulationPulseWidth_
protected

◆ laserPowerSetpointMW_

float WasatchNET.Spectrometer.laserPowerSetpointMW_ = 0
protected

◆ laserTemperatureSetpointRaw_

byte WasatchNET.Spectrometer.laserTemperatureSetpointRaw_
protected

◆ lastDetectorTemperatureDegC

float WasatchNET.Spectrometer.lastDetectorTemperatureDegC = UNINITIALIZED_TEMPERATURE_DEG_C

A cached value of the last-measured detector temperature. This is automatically updated following spectral reads if readTemperatureAfterSpectrum is set.

◆ lastUsbTimestamp

DateTime WasatchNET.Spectrometer.lastUsbTimestamp = DateTime.Now
private

◆ LEGACY_VERTICAL_PIXELS

const int WasatchNET.Spectrometer.LEGACY_VERTICAL_PIXELS = 70
static

for Stroker Area Scan

◆ lineLength_

uint WasatchNET.Spectrometer.lineLength_
private

◆ logger

Logger WasatchNET.Spectrometer.logger = Logger.getInstance()
protected

◆ multiChannelPosition

int WasatchNET.Spectrometer.multiChannelPosition = -1

If the spectrometer is deployed in a multi-channel configuration, this provides a place to store an integral position in the Spectrometer object. (defaults to -1, an invalid position)

This may be populated from EEPROM.UserText or other sources. This value is not used by anything except MultiChannelWrapper and end-user code.

◆ noCache

HashSet<Opcodes> WasatchNET.Spectrometer.noCache = new HashSet<Opcodes>()
private

◆ optActualIntegrationTime_

bool WasatchNET.Spectrometer.optActualIntegrationTime_
private

◆ optAreaScan_

bool WasatchNET.Spectrometer.optAreaScan_
private

◆ optCFSelect_

bool WasatchNET.Spectrometer.optCFSelect_
private

◆ optDataHeaderTag_

FPGA_DATA_HEADER WasatchNET.Spectrometer.optDataHeaderTag_ = FPGA_DATA_HEADER.ERROR
private

◆ optHorizontalBinning_

bool WasatchNET.Spectrometer.optHorizontalBinning_
private

◆ optIntegrationTimeResolution_

FPGA_INTEG_TIME_RES WasatchNET.Spectrometer.optIntegrationTimeResolution_ = FPGA_INTEG_TIME_RES.ERROR
private

◆ optLaserControl_

FPGA_LASER_CONTROL WasatchNET.Spectrometer.optLaserControl_ = FPGA_LASER_CONTROL.ERROR
private

◆ optLaserType_

FPGA_LASER_TYPE WasatchNET.Spectrometer.optLaserType_ = FPGA_LASER_TYPE.ERROR
private

◆ pixelAxis_

double [] WasatchNET.Spectrometer.pixelAxis_ = null
private

◆ pixelsPerEndpoint

int WasatchNET.Spectrometer.pixelsPerEndpoint = 0
private

◆ readOnce

HashSet<Opcodes> WasatchNET.Spectrometer.readOnce = new HashSet<Opcodes>()
private

◆ readoutMutex

Mutex WasatchNET.Spectrometer.readoutMutex = new Mutex()
staticprivate

◆ readTemperatureAfterSpectrum

bool WasatchNET.Spectrometer.readTemperatureAfterSpectrum = false

If enabled, Wasatch.NET will automatically read the detector temperature following every successful call to getSpectrum(). That temperature can then be read from lastDetectorTemperatureDegC, without inducing any spectrometer communications.

Many customer applications wish to monitor detector temperature. However, attempting to read temperature asynchronously from the spectrometer over USB can complicate timing in the midst of acquisitions. This provides a controlled process to obtain fairly- current temperature without adding interrupts to the USB communciation cycle. (It's also very similar to what ENLIGHTEN does)

◆ reference_

double [] WasatchNET.Spectrometer.reference_
protected

◆ scanAveraging_

uint WasatchNET.Spectrometer.scanAveraging_ = 1
protected

◆ scanAveragingIsContinuous_

bool WasatchNET.Spectrometer.scanAveragingIsContinuous_
private

◆ selectedADC_

byte WasatchNET.Spectrometer.selectedADC_
private

◆ shuttingDown

bool WasatchNET.Spectrometer.shuttingDown = false
package

◆ spectralReader82

UsbEndpointReader WasatchNET.Spectrometer.spectralReader82
private

◆ spectralReader86

UsbEndpointReader WasatchNET.Spectrometer.spectralReader86
private

◆ SPECTRUM_START_MARKER

const ushort WasatchNET.Spectrometer.SPECTRUM_START_MARKER = 0xffff
static

◆ throwawaySum

ulong WasatchNET.Spectrometer.throwawaySum = 0
private

◆ triggerDelay_

uint WasatchNET.Spectrometer.triggerDelay_
private

◆ triggerOutput_

EXTERNAL_TRIGGER_OUTPUT WasatchNET.Spectrometer.triggerOutput_ = EXTERNAL_TRIGGER_OUTPUT.ERROR
private

◆ triggerSource_

TRIGGER_SOURCE WasatchNET.Spectrometer.triggerSource_ = TRIGGER_SOURCE.INTERNAL
protected

◆ UNINITIALIZED_TEMPERATURE_DEG_C

const float WasatchNET.Spectrometer.UNINITIALIZED_TEMPERATURE_DEG_C = -999
static

◆ uptime

SpectrometerUptime WasatchNET.Spectrometer.uptime
package

◆ usbDevice

UsbDevice WasatchNET.Spectrometer.usbDevice
private

◆ usbRegistry

UsbRegistry WasatchNET.Spectrometer.usbRegistry
private

◆ usingDualEndpoints

bool WasatchNET.Spectrometer.usingDualEndpoints
private

◆ wholeUsbDevice

IUsbDevice WasatchNET.Spectrometer.wholeUsbDevice
private

Property Documentation

◆ accessoryEnabled

virtual bool WasatchNET.Spectrometer.accessoryEnabled
getset

Determines whether or not the Gen1.5 accessory connector's features can be used.

<todo> Cache getter and use actual command once implemented...for now it only exists in software </todo>

Implements WasatchNET.ISpectrometer.

◆ acquireCount

int WasatchNET.Spectrometer.acquireCount = 0
getprotected set

Allows application to track how many ACQUIRE_SPECTRUM commands have been sent to the spectrometer (including throwaways and retries).

◆ acquisitionTimeoutMS

uint? WasatchNET.Spectrometer.acquisitionTimeoutMS
getset

Convenience accessor to set an explicit acquisition timeout.

  • If no timeout is set by the user, an internal timeout will be dynamically generated for software-triggered acquisitions.

◆ acquisitionTimeoutRelativeMS

uint WasatchNET.Spectrometer.acquisitionTimeoutRelativeMS
set

Allows the NEXT acquisition timeout to be set relative to "now" as an offiset in milliseconds.

  • If no timeout is set by the user, an internal timeout will be dynamically generated for software-triggered acquisitions.
  • This timeout applies to external hardware triggers as well (which have no default internal timeout.)

◆ acquisitionTimeoutTimestamp

DateTime? WasatchNET.Spectrometer.acquisitionTimeoutTimestamp = null
getset

Allows the NEXT acquisition timeout to be set to an explicit objective future timestamp.

  • If no timeout is set by the user, an internal timeout will be dynamically generated for software-triggered acquisitions.
  • This timeout applies to external hardware triggers as well (which have no default internal timeout.)

◆ actualFrames

ushort WasatchNET.Spectrometer.actualFrames
get

How many frames have been read since last power cycle (has overflow)

Implements WasatchNET.ISpectrometer.

◆ actualIntegrationTimeUS

uint WasatchNET.Spectrometer.actualIntegrationTimeUS
get

Return integration time + clock-out time (and laser pulse time if externally triggered).

Returns
actual integration time in microseconds (zero on error)

Implements WasatchNET.ISpectrometer.

◆ adcRaw

ushort WasatchNET.Spectrometer.adcRaw
getprotected

<warning> The photodiode (calling this as secondary ADC) should NOT swap the byte order! Does laserTemperatureRaw require the byte order to be swapped?!? </warning>

protected because caller should access via primaryADC or secondaryADC

◆ areaScanEnabled

virtual bool WasatchNET.Spectrometer.areaScanEnabled
getset

Configure detector for 2D image mode.

Not supported on all spectrometers.

Wasatch spectrometers normally "vertically bins" pixel columns on the detector, outputting the spectrum as a one-dimensional array of intensities by pixel.

For production alignment, an "area scan" imaging mode is provided to output each row on the detector as a separate line, so client software can reconstruct a 2D image of the light patterns spread across the detector. In this mode, the intensity value of the first pixel of each line is overwritten by the row index, to ensure the 2D image is received and displayed correctly.

Implements WasatchNET.ISpectrometer.

◆ autoTrigger

bool WasatchNET.Spectrometer.autoTrigger
getset

Whether the driver should automatically send a software trigger on calls to getSpectrum() when triggerSource is set to INTERNAL. (defaults true)

This is provided in case the caller wishes to call sendSWTrigger() explicitly, for instance to send software triggers to a series of devices at once, before beginning reads on any of them.

◆ batteryCharging

virtual bool WasatchNET.Spectrometer.batteryCharging
get

◆ batteryPercentage

virtual float WasatchNET.Spectrometer.batteryPercentage
get

◆ batteryStateRaw

uint WasatchNET.Spectrometer.batteryStateRaw
get

◆ boxcarHalfWidth

virtual uint WasatchNET.Spectrometer.boxcarHalfWidth
getset

Perform post-acquisition high-frequency smoothing by averaging together "n" pixels to either side of each acquired pixel; zero to disable (default).

Implements WasatchNET.ISpectrometer.

◆ continuousAcquisitionEnable

virtual bool WasatchNET.Spectrometer.continuousAcquisitionEnable
getset

After the first trigger is received, no further triggers are required; spectrometer will enter free-running mode.

Implements WasatchNET.ISpectrometer.

◆ continuousFrames

virtual byte WasatchNET.Spectrometer.continuousFrames
getset

When not using "continous acquisitions" with external triggers, how many spectra to acquire per trigger event.

Implements WasatchNET.ISpectrometer.

◆ dark

virtual double [] WasatchNET.Spectrometer.dark
getset

Perform automatic dark subtraction by setting this property to an acquired dark spectrum; leave "null" to disable.

Implements WasatchNET.ISpectrometer.

◆ detectorGain

virtual float WasatchNET.Spectrometer.detectorGain
getset

Maps to an FPGA register inside the spectrometer used to scale pixels read from the ADC to optimize dynamic range.

Not normally changed by customer code. Values are normally read from the EEPROM and written back to the spectrometer's FPGA by the driver at initialization.

Altering this value may degrade spectrometer performance.

Implements WasatchNET.ISpectrometer.

◆ detectorGainOdd

virtual float WasatchNET.Spectrometer.detectorGainOdd
getset

(InGaAs-only) Companion property to detectorGain, which on InGaAs detectors applies only to even-numbered pixels.

Implements WasatchNET.ISpectrometer.

◆ detectorOffset

virtual short WasatchNET.Spectrometer.detectorOffset
getset

Maps to an FPGA register inside the spectrometer used to offset the pixels (dark baseline) read from the ADC to optimize dynamic range.

Not normally changed by customer code. Values are normally read from the EEPROM and written back to the spectrometer's FPGA by the driver at initialization.

Altering this value may degrade spectrometer performance.

Implements WasatchNET.ISpectrometer.

◆ detectorOffsetOdd

virtual short WasatchNET.Spectrometer.detectorOffsetOdd
getset

(InGaAs-only) Companion property to detectorOffset, which on InGaAs detectors applies only to even-numbered pixels.

Implements WasatchNET.ISpectrometer.

◆ detectorSensingThreshold

ushort WasatchNET.Spectrometer.detectorSensingThreshold
getset

◆ detectorSensingThresholdEnabled

bool WasatchNET.Spectrometer.detectorSensingThresholdEnabled
getset

◆ detectorStartLine

virtual UInt16 WasatchNET.Spectrometer.detectorStartLine
getset

◆ detectorStopLine

virtual UInt16 WasatchNET.Spectrometer.detectorStopLine
getset

◆ detectorTECEnabled

virtual bool WasatchNET.Spectrometer.detectorTECEnabled
getset

◆ detectorTECSetpointDegC

virtual float WasatchNET.Spectrometer.detectorTECSetpointDegC
getset

◆ detectorTECSetpointRaw

virtual ushort WasatchNET.Spectrometer.detectorTECSetpointRaw
getset

◆ detectorTemperatureCacheTimeMS

double WasatchNET.Spectrometer.detectorTemperatureCacheTimeMS = 1000
getset

◆ detectorTemperatureDegC

virtual float WasatchNET.Spectrometer.detectorTemperatureDegC
get

◆ detectorTemperatureRaw

virtual ushort WasatchNET.Spectrometer.detectorTemperatureRaw
get

Caches results so it won't query the spectrometer faster than 1Hz

Implements WasatchNET.ISpectrometer.

◆ eeprom

EEPROM WasatchNET.Spectrometer.eeprom
getprotected set

configuration settings stored in the spectrometer's EEPROM

Implements WasatchNET.ISpectrometer.

◆ errorOnTimeout

bool WasatchNET.Spectrometer.errorOnTimeout = true
getset

Whether an ERROR should be logged on a timeout event (default true)

◆ excitationWavelengthNM

virtual float WasatchNET.Spectrometer.excitationWavelengthNM
getset

◆ featureIdentification

FeatureIdentification WasatchNET.Spectrometer.featureIdentification
getset

metadata inferred from the spectrometer's USB PID

Implements WasatchNET.ISpectrometer.

◆ firmwareRevision

virtual string WasatchNET.Spectrometer.firmwareRevision
get

◆ fpgaOptions

FPGAOptions WasatchNET.Spectrometer.fpgaOptions
getprivate set

set of compilation options used to compile the FPGA firmware in this spectrometer

Implements WasatchNET.ISpectrometer.

◆ fpgaRevision

virtual string WasatchNET.Spectrometer.fpgaRevision
get

◆ fram

FRAM WasatchNET.Spectrometer.fram
getprotected set

◆ hasLaser

virtual bool WasatchNET.Spectrometer.hasLaser
get

◆ hasMarker

bool WasatchNET.Spectrometer.hasMarker
getset

Some spectrometers send a start-of-frame marker in the first pixel of the spectrum.

◆ hasSecondaryADC

bool WasatchNET.Spectrometer.hasSecondaryADC = false
getset

This should be replaced with an FGPACompilationFlag or EEPROM field at some point.

Implements WasatchNET.ISpectrometer.

◆ highGainModeEnabled

virtual bool WasatchNET.Spectrometer.highGainModeEnabled
getset

◆ horizontalBinning

HORIZONTAL_BINNING WasatchNET.Spectrometer.horizontalBinning
getset

◆ id

string WasatchNET.Spectrometer.id
get

couples serial number with channel position

◆ integrationTimeMS

virtual uint WasatchNET.Spectrometer.integrationTimeMS
getset

Current integration time in milliseconds.

Implements WasatchNET.ISpectrometer.

◆ isARM

virtual bool WasatchNET.Spectrometer.isARM
get

◆ isGen15

bool WasatchNET.Spectrometer.isGen15
get

Whether the spectrometer uses a "Gen 1.5" accessory connector.

Implements WasatchNET.ISpectrometer.

◆ isInGaAs

virtual bool WasatchNET.Spectrometer.isInGaAs
get

◆ isOCT

bool WasatchNET.Spectrometer.isOCT = false
getprotected set

Optical Coherence Tomography (OCT) spectrometers differ from "standard" spectrometers in several respects, such as producing both 2D and 3D imagery.

◆ isSiG

bool WasatchNET.Spectrometer.isSiG
get

◆ isSPI

bool WasatchNET.Spectrometer.isSPI = false
getprotected set

Whether the spectrometer uses Serial Peripheral Interface (as opposed to USB for instance).

Implements WasatchNET.ISpectrometer.

◆ isStroker

bool WasatchNET.Spectrometer.isStroker = false
getprotected set

Stroker is a legacy board firmware with older PID (not 0x1000, 0x2000 or 0x4000), doesn't conform to Feature Identification Device (FID) Protocol, and lacking an EEPROM.

◆ lampEnabled

virtual bool WasatchNET.Spectrometer.lampEnabled
getset

Whether the lamp attached via Gen 1.5 attachment has been requested to be turned on by the software and firmware.

Implements WasatchNET.ISpectrometer.

◆ laserEnabled

virtual bool WasatchNET.Spectrometer.laserEnabled
getset

Whether the laser has been REQUESTED TO FIRE by the software and firmware.

Implements WasatchNET.ISpectrometer.

◆ laserFiring

virtual bool WasatchNET.Spectrometer.laserFiring
get

Whether the laser is ACTUALLY FIRING, according to the laser driver and laser interlock board.

Requires FeatureMask.HAS_INTERLOCK_FEEDBACK.

Implements WasatchNET.ISpectrometer.

◆ laserInterlockEnabled

virtual bool WasatchNET.Spectrometer.laserInterlockEnabled
get

True if the laser can fire (interlock circuit is CLOSED), false if the laser cannot fire (interlock circuit is OPEN).

Requires FeatureMask.HAS_INTERLOCK_FEEDBACK.

Implements WasatchNET.ISpectrometer.

◆ laserModulationDuration

UInt64 WasatchNET.Spectrometer.laserModulationDuration
getset

If you only want the laser to be modulated for a portion of each acquisition (rare), how long in microseconds should the laser be modulated during each integration.

Value is in microseconds, range 40bit.

     It is unclear from documentation if, at the end of this duration, the LASER turns off (zero power), or MODULATION turns off (i.e. reverts to full power).

Implements WasatchNET.ISpectrometer.

◆ laserModulationEnabled

bool WasatchNET.Spectrometer.laserModulationEnabled
getset

◆ laserModulationLinkedToIntegrationTime

bool WasatchNET.Spectrometer.laserModulationLinkedToIntegrationTime
getset

◆ laserModulationPeriod

virtual UInt64 WasatchNET.Spectrometer.laserModulationPeriod
getset

When defining the laser modulation duty cycle, the length (period) of the duty cycle in microsec.

Warning: Laser modulation commands are normally internally set by the function setLaserPowerPercentage().

     Value is in microseconds, range 40bit.</remarks> 

Implements WasatchNET.ISpectrometer.

◆ laserModulationPulseDelay

UInt64 WasatchNET.Spectrometer.laserModulationPulseDelay
getset

If you want the laser modulation to start part-way through an acquisition, this defines the delay in microseconds from the beginning of the integration until laser modulation begins.

Warning: Laser modulation commands are normally internally set by the function setLaserPowerPercentage().

     Value is in microseconds, range 40bit.

     It is unclear from documentation whether MODULATION starts after the given delay, or the LASER is enabled after the delay.

Implements WasatchNET.ISpectrometer.

◆ laserModulationPulseWidth

virtual UInt64 WasatchNET.Spectrometer.laserModulationPulseWidth
getset

When defining the laser modulation duty cycle, the length (width) of the period during which the laser is enabled.

Warning: Laser modulation commands are normally internally set by the function setLaserPowerPercentage().

     Value is in microseconds, range 40bit.

     Example: if period was 100us, and pulseWidth was 20us, then the laser would fire 1/5 of the time and therefore operating
     at 20% power.

Implements WasatchNET.ISpectrometer.

◆ laserPowerResolution

virtual LaserPowerResolution WasatchNET.Spectrometer.laserPowerResolution = LaserPowerResolution.LASER_POWER_RESOLUTION_1000
getset

◆ laserPowerSetpointMW

virtual float WasatchNET.Spectrometer.laserPowerSetpointMW
getset

Use this to set the laser output power in milliWatts.

You should only attempt to set this property if you have already verified EEPROM.hasLaserPowerCalibration().

You should only attempt to read this property AFTER setting a value; the getter simply returns the most recently successfully set setpoint.

Setting this property will yield undefined results if no laser power calibration is provided in the spectrometer, but never outside the physical PWM duty cycle bounds (0, 100%).

EEPROM.hasLaserPowerCalibration

◆ laserRampingEnabled

bool WasatchNET.Spectrometer.laserRampingEnabled
getset

disabled to deconflict area scan

Implements WasatchNET.ISpectrometer.

◆ laserTemperatureDegC

virtual float WasatchNET.Spectrometer.laserTemperatureDegC
get

convert the raw laser temperature reading into degrees centigrade

Returns
laser temperature in °C

https://www.ipslasers.com/data-sheets/SM-TO-56-Data-Sheet-IPS.pdf

Laser temperature conversion doesn't use EEPROM coeffs at all. Most Wasatch Raman systems use an IPS Wavelength-Stabilized TO-56 laser, which internally uses a Betatherm 10K3CG3 thermistor.

The official conversion from thermistor resistance (in ohms) to degC is:

1 / ( C1

  • C2 * ln(ohms)
  • C3 * pow(ln(ohms), 3) )

273.15

Where: C1 = 0.00113 C2 = 0.000234 C3 = 8.78e-8

Early Dash / ENLIGHTEN implementations used a simpler curve-fit which yielded nearly identical performance.

Implements WasatchNET.ISpectrometer.

◆ laserTemperatureRaw

virtual ushort WasatchNET.Spectrometer.laserTemperatureRaw
get

Synonym for primaryADC.

selectedADC primaryADC

Implements WasatchNET.ISpectrometer.

◆ laserTemperatureSetpointRaw

virtual byte WasatchNET.Spectrometer.laserTemperatureSetpointRaw
getset

FACTORY ONLY.

WARNING: raising this value above 63 will "increase temperature AND volatility", while lowering this value below 63 will "decrease temperature WHILE increasing volatility".

During factory turning of the potentiometer on the laser driver controller board, this function is used to temporarily offset the TEC DAC setpoint from its default power-up value of 63.

End-users should not adjust this value at runtime, as the potentiometer has already been locked-down at a point optimized for laser power stability over temperature; any changes to this value from the default value of 63 will only increase the chances of power instability, including mode-hopping and hysteresis effects.

See RamanSpecCal's LaserTemperatureTest documentation for additional information.

Note that input values will automatically be capped at 7-bit (0, 127), the operative range of the laser TEC DAC.

Also note that although this property includes the word "temperature" because the setpoint relates to and will change the laser's central temperature, you cannot set a specific temperature setpoint in degC, as the final temperature is generated in hardware as a combination of the DAC setpoint value and the physical potentiometer.

Implements WasatchNET.ISpectrometer.

◆ lastSpectrum

double [] WasatchNET.Spectrometer.lastSpectrum
getprotected set

Useful if you lost the results of getSpectrum, or if you want to peek into ongoing multi-acquisition tasks like scan averaging or optimization.

◆ lineLength

uint WasatchNET.Spectrometer.lineLength
get

◆ linesPerFrame

int WasatchNET.Spectrometer.linesPerFrame
getprotected set

◆ model

string WasatchNET.Spectrometer.model
get

spectrometer model

Implements WasatchNET.ISpectrometer.

◆ multiChannelSelected

bool WasatchNET.Spectrometer.multiChannelSelected
getset

Multichannel convenience accessor (default false)

◆ optActualIntegrationTime

bool WasatchNET.Spectrometer.optActualIntegrationTime
get

◆ optAreaScan

bool WasatchNET.Spectrometer.optAreaScan
get

Whether area scan mode is supported.

Implements WasatchNET.ISpectrometer.

◆ optCFSelect

bool WasatchNET.Spectrometer.optCFSelect
get

Internal firmware name for the highGainModeEnabled feature available on InGaAs detectors.

Implements WasatchNET.ISpectrometer.

◆ optDataHeaderTag

FPGA_DATA_HEADER WasatchNET.Spectrometer.optDataHeaderTag
get

◆ optHorizontalBinning

bool WasatchNET.Spectrometer.optHorizontalBinning
get

◆ optIntegrationTimeResolution

FPGA_INTEG_TIME_RES WasatchNET.Spectrometer.optIntegrationTimeResolution
get

◆ optLaserControl

FPGA_LASER_CONTROL WasatchNET.Spectrometer.optLaserControl
get

◆ optLaserType

FPGA_LASER_TYPE WasatchNET.Spectrometer.optLaserType
get

◆ pixelAxis

double [] WasatchNET.Spectrometer.pixelAxis
get

convenience accesor for pixel axis (lazy-loaded), for parallelism with wavelengths and wavenumbers

◆ pixels

uint WasatchNET.Spectrometer.pixels
getprotected set

how many pixels does the spectrometer have (spectrum length)

Implements WasatchNET.ISpectrometer.

◆ primaryADC

ushort WasatchNET.Spectrometer.primaryADC
get

◆ ramanIntensityCorrectionEnabled

bool WasatchNET.Spectrometer.ramanIntensityCorrectionEnabled
getset

Whether to correct the y-axis using SRM-derived correction factors, stored as coefficients on the spectrometer.

This y-axis correction is only considered to be valid for raman spectrometers.

If a user plans on using dark correction, the dark should be collected BEFORE raman correction is enabled, and if the dark needs to be retaken, the correction should be toggled around the collection.

So, the general flow for dark and y-axis corrected sample collection should be as follows: Take Dark -> Enable Correction -> Take Raman Sample(s) -> Disable Correction -> Take Dark -> Repeat

Implements WasatchNET.ISpectrometer.

◆ reference

virtual double [] WasatchNET.Spectrometer.reference
getset

Simplify reference-based techniques (absorbance, reflectance, transmission etc) by allowing a reference to be stored with the Spectrometer, similar to dark.

Unlike dark, which will be automatically subtracted from Raw to form Processed, no automatic processing is performed with the Reference, as different techniques use it differently. This is a convenience attribute for application programmers.

◆ scanAveraging

virtual uint WasatchNET.Spectrometer.scanAveraging
getset

How many acquisitions to average together (0 or 1 for no averaging). (default 1)

Note that while SW triggering supports 2^16 scans to average, HW triggering (necessarily using continuousFrames) is limited to 255.

Implements WasatchNET.ISpectrometer.

◆ scanAveragingIsContinuous

bool WasatchNET.Spectrometer.scanAveragingIsContinuous
getset

Whether the "scanAveraging" property should automatically configure continuousAcquisitionEnable and continuousFrames. (default false)

EXPERIMENTAL – NOT RECOMMENDED FOR PRODUCTION APPLICATIONS.

Setting false will automatically reset continuousAcquisitionEnable and continuousFrames to default (off) values.

◆ secondaryADC

virtual ushort WasatchNET.Spectrometer.secondaryADC
get

This is provided for spectrometers with a secondary ADC connected to an external laser, photodiode or what-have-you. Attempts to read it on spectrometers where it has not been configured can result in indeterminate behavior; therefore, hasSecondaryADC is provided to allow callers to selectively enable this function if they believe they are using supported hardware.

Implements WasatchNET.ISpectrometer.

◆ selectedADC

byte WasatchNET.Spectrometer.selectedADC
getsetprotected

◆ serialNumber

virtual string WasatchNET.Spectrometer.serialNumber
get

spectrometer serial number

Implements WasatchNET.ISpectrometer.

◆ shiftedMarkerCount

int WasatchNET.Spectrometer.shiftedMarkerCount = 0
getprivate set

For spectrometer firmware providing "start of spectrum markers", provides a count of how many INCORRECT markers were found in the MOST RECENT spectrum.

◆ spectrumCount

int WasatchNET.Spectrometer.spectrumCount = 0
getprotected set

Allows application to track how many successful (non-null) calls have been made to getSpectrum (whether averaged or otherwise).

◆ throwawayADCRead

bool WasatchNET.Spectrometer.throwawayADCRead = true
getsetprivate

Whether the driver should automatically perform a throwaway ADC read when changing the selected ADC. (defaults true)

◆ throwawayAfterIntegrationTime

bool WasatchNET.Spectrometer.throwawayAfterIntegrationTime
getset

Whether the driver should automatically generate a throwaway "stability" measurement after changing integration time. (defaults false)

<todo> Change such that only used if the trigger source is internal (SW-triggered) and autoTrigger is enabled (both the default). </todo>

◆ triggerDelay

uint WasatchNET.Spectrometer.triggerDelay
getset

A configurable delay from when an inbound trigger signal is received by the spectrometer, until the triggered acquisition actually starts.

Default value is 0us.

Unit is in 0.5 microseconds (500ns), so value of 25 would represent 12.5us.

Value is 24bit, so max value is 16777216 (8.388608 sec).

As part of triggering, only currently supported on ARM.

Implements WasatchNET.ISpectrometer.

◆ triggerOutput

EXTERNAL_TRIGGER_OUTPUT WasatchNET.Spectrometer.triggerOutput
getset

◆ triggerSource

virtual TRIGGER_SOURCE WasatchNET.Spectrometer.triggerSource
getset

Whether acquisitions are triggered "internally" (via the ACQUIRE opcode sent by software) or "externally" (via an electrical signal wired to the accessory connector).

Implements WasatchNET.ISpectrometer.

◆ uniqueKey

string WasatchNET.Spectrometer.uniqueKey
getset

◆ untetheredAcquisitionEnabled

bool WasatchNET.Spectrometer.untetheredAcquisitionEnabled = false
getset

Untethered operation requires an argument to ACQUIRE, and polls before reading spectrum.

◆ useReadoutMutex

bool WasatchNET.Spectrometer.useReadoutMutex
getset

Whether to synchronize all spectral reads with a class-level (static) mutex.

This doesn't include the sending of ACQUIRE software triggers, just the bulk readouts over Ep2 and Ep6. As USB is fundamentally serial, this probably doesn't change behavior much, but it will ensure whole whole spectra are transferred atomically, even when spanning endpoints.

This is a developmental test feature, and not intended for production applications.

◆ wavelengths

double [] WasatchNET.Spectrometer.wavelengths
getprotected set

pre-populated array of wavelengths (nm) by pixel, generated from eeprom.wavecalCoeffs

see Util.generateWavelengths

Implements WasatchNET.ISpectrometer.

◆ wavenumbers

double [] WasatchNET.Spectrometer.wavenumbers
getprotected set

pre-populated array of Raman shifts in wavenumber (1/cm) by pixel, generated from wavelengths[] and excitationNM

see Util.wavelengthsToWavenumbers

Implements WasatchNET.ISpectrometer.


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