ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
wasatch.DetectorRegions.DetectorRegions Class Reference

This class encapsulates all of the DetectorROI regions that have been configured for the current detetor. More...

Public Member Functions

 __init__ (self)
 
 __str__ (self)
 
 add (self, roi)
 Will add or replace if region already exists.
 
 chop (self, a, flatten=False, orig_roi=None)
 Given a long array (like wavelengths or wavenumbers) which was presumably generated for a full detector, chop into the sections indicated by the configured regions.
 
 count (self)
 
 get_region_list (self)
 guaranteed to be in the same order as split spectra
 
 get_roi (self, region)
 
 has_region (self, region)
 
 remove (self, roi)
 
 split (self, spectrum, flatten=False)
 Given a concatenated array (spectrum) which is logically composed of multiple shorter spectra, use the configured regions to split into the presumed constituent components.
 
 total_pixels (self)
 sum of widths of enabled regions
 

Public Attributes

dict regions = {}
 

Detailed Description

This class encapsulates all of the DetectorROI regions that have been configured for the current detetor.

If no DetectorROI regions have been configured for a detector, SpectrometerState.detector_regions may be None (indicating the full detector is being vertically binned and read-out).

Note that if DetectorROI regions have been configured for a detector, the total number of pixels to be read-out from the detector may be either greater or less than the physical number of pixels.

DetectorRegions are currently only supported on the Sony IMX series of detector.

There are two other spectrometer features that are similar to or conceptually overlap DetectorRegions: HorizontalROI (aka vignetting or cropping), and start/stop lines (vertical ROI). This feature is definitely related to vertical ROI, but very different from vignetting because this actually changes the number of pixels read-out by the spectrometer during an acquisition.

We have not yet addressed the multiple wavecals required for DetectorRegions.

Constructor & Destructor Documentation

◆ __init__()

wasatch.DetectorRegions.DetectorRegions.__init__ ( self)

Member Function Documentation

◆ __str__()

wasatch.DetectorRegions.DetectorRegions.__str__ ( self)

◆ add()

wasatch.DetectorRegions.DetectorRegions.add ( self,
roi )

Will add or replace if region already exists.

Parameters
roiDetectorROI

◆ chop()

wasatch.DetectorRegions.DetectorRegions.chop ( self,
a,
flatten = False,
orig_roi = None )

Given a long array (like wavelengths or wavenumbers) which was presumably generated for a full detector, chop into the sections indicated by the configured regions.

Some elements of the source array may appear in multiple output arrays, if the regions overlap in x-coordinates.

Differs from split() in that some of the data will be trimmed and left on the floor, if it doesn't fall within any configured region. Also, some input values may appear in multiple output arrays.

Ignores disabled regions.

Example:

  • passed 1920 wavelengths (based on active_pixels_horizontal)
  • configured region 0 is from (300, 1932) (pixel space)
  • function doesn't know that 1920 was defined as 1932 - 12 (the physical pixel range to which the wavelengths actually correspond)
  • all function knows is that new range is 1632 pixels wide – not where those 1632 pixels fall within the 1920 (in this case, they SHOULD start at 300 - 12 = 288
  • basically, DetectorRegions needs to know the (x, y) in pixel space corresponding to 'a' – (12, 1932) in this case
  • that is what orig_roi now provides

◆ count()

wasatch.DetectorRegions.DetectorRegions.count ( self)

◆ get_region_list()

wasatch.DetectorRegions.DetectorRegions.get_region_list ( self)

guaranteed to be in the same order as split spectra

◆ get_roi()

wasatch.DetectorRegions.DetectorRegions.get_roi ( self,
region )

◆ has_region()

wasatch.DetectorRegions.DetectorRegions.has_region ( self,
region )

◆ remove()

wasatch.DetectorRegions.DetectorRegions.remove ( self,
roi )

◆ split()

wasatch.DetectorRegions.DetectorRegions.split ( self,
spectrum,
flatten = False )

Given a concatenated array (spectrum) which is logically composed of multiple shorter spectra, use the configured regions to split into the presumed constituent components.

Differs from chop() in that no data is thrown on the floor; all is presumed part of one of the configured regions. Also any given source value will only go into a single output subspectrum.

Note that split() could be called on the flattened result of chop() to dice a concatenated list of wavelengths for multiples regions back into individual per-region blocks.

Ignores disabled regions.

◆ total_pixels()

wasatch.DetectorRegions.DetectorRegions.total_pixels ( self)

sum of widths of enabled regions

Member Data Documentation

◆ regions

wasatch.DetectorRegions.DetectorRegions.regions = {}

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