science_jubilee.tools.Spectrometer
#
Module Contents#
Classes#
A class representation for an Ocean Optics Spectrometer, Light source, and Probe |
|
A class to manage the measurements taken by the SpectroscopyTool |
- class science_jubilee.tools.Spectrometer.SpectroscopyTool(index, name)#
Bases:
science_jubilee.tools.Tool.Tool
,oceandirect.OceanDirectAPI.OceanDirectAPI
A class representation for an Ocean Optics Spectrometer, Light source, and Probe
For that we wil be unfortunately using their own SDK package, which is NOT open-source.
- property _api_version#
The version of the Ocean Insight SDK
- property _usb_device#
- property _device_id#
The ID of the spectrometer
- property _model#
The spectrometer model
- property _serial_number#
The spectrometer serial number
- property _integration_time#
- property wavelengths#
Return list containing the wavelengths of the spectrometer.
- Returns:
A list of wavelengths
- Return type:
list
- _open_device()#
Connects to the spectrometer device
- integration_time(t: float, units: str = 'ms')#
Sets the integration time for the spectrometer.
- Parameters:
t (float) – integration time
units (str, optional) – units of integration time, defaults to ‘ms’
- scans_to_average(n: int)#
Set the number of scans to average together to compose a single spectrum.
- Parameters:
n – number of scans to average
:type n:int
- boxcar_width(w: int = None)#
Unit used to smooth the spectrum.
The boxcar width is the number of adjacent pixels that are averaged together to smooth the spectrum. Pixel average = 2* boxcar_width + 1
- Parameters:
w (int) – boxcar width
- lamp_shutter(open=True)#
Opens or closes light source shutter, if feature is available on light source.)
- Parameters:
open – True opens the shutter/False closes it, defaults to False
- _take_spectrum(open=True)#
Collect a spectrum with the specified experimental parameters
- dark_spectrum(int_time: float, scan_num: int, boxcar_w: int = None, save: bool = False, path: str = None, filename: str = None)#
Collect a dark spectrum with the specified experimental parameters.
A dark spectrum is collected when no light is incident on the detector. This shuold later be used to correct the actual spectrum for dark counts (i.e. thermal noise). Note: these shuold be the same as the ones used for the actual spectrum.
- Parameters:
int_time – integration time
- _collect_raw_spectrum(int_time: float, scan_num: int, boxcar_w: int, int_time_units: str = 'ms')#
Collect a spectrum with the specified experimental parameters
- Parameters:
int_time (float) – integration time
scan_num (int) – number of scans to average
boxcar_w (int, optional) – boxcar width for smoothing the spectrum, defaults to None
int_time_units (str, optional) – units of integration time, defaults to ‘ms’
- Returns:
spectrum
- Return type:
numpy array
- collect_spectrum(location: science_jubilee.labware.Labware.Well | Tuple | science_jubilee.labware.Labware.Location, int_time, scan_num, boxcar_w, int_time_units='ms', save: bool = False, filename: str = None, path: str = None)#
Collect spectrum at the specified location on the labware
- save_to_file(data, dark: bool = False, path: str = None, filename: str = None)#
Save the spectrum to a file
- read_from_file(filepath, scale=True, reference_spectrum=None)#
- static scale_intensity(data: list, reference_spectrum: list)#