|
Wasatch.PY
Python application driver for Wasatch Photonics spectrometers
|
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 | |
| regions | |
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.
| wasatch.DetectorRegions.DetectorRegions.__init__ | ( | self | ) |
| wasatch.DetectorRegions.DetectorRegions.__str__ | ( | self | ) |
| wasatch.DetectorRegions.DetectorRegions.add | ( | self, | |
| roi ) |
Will add or replace if region already exists.
| roi | DetectorROI |
| 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:
| wasatch.DetectorRegions.DetectorRegions.count | ( | self | ) |
| wasatch.DetectorRegions.DetectorRegions.get_region_list | ( | self | ) |
guaranteed to be in the same order as split spectra
| wasatch.DetectorRegions.DetectorRegions.get_roi | ( | self, | |
| region ) |
| wasatch.DetectorRegions.DetectorRegions.has_region | ( | self, | |
| region ) |
| wasatch.DetectorRegions.DetectorRegions.remove | ( | self, | |
| roi ) |
| 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.
| wasatch.DetectorRegions.DetectorRegions.total_pixels | ( | self | ) |
sum of widths of enabled regions
| wasatch.DetectorRegions.DetectorRegions.regions |