science_jubilee.tools.Spectrometer#

Classes#

SpectroscopyTool

A class representation for an Ocean Optics Spectrometer, Light source, and Probe

MeasurementManager

A class to manage the measurements taken by the SpectroscopyTool

Module Contents#

class science_jubilee.tools.Spectrometer.SpectroscopyTool(index, name)[source]#

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.

connection[source]#
spectrometer[source]#
name[source]#
index[source]#
current_well = None[source]#
_dark_spectrum = False[source]#
reference_spectrum = None[source]#
property _api_version[source]#

The version of the Ocean Insight SDK

property _usb_device[source]#
property _device_id[source]#

The ID of the spectrometer

_open_device()[source]#

Connects to the spectrometer device

property _model[source]#

The spectrometer model

property _serial_number[source]#

The spectrometer serial number

property _integration_time[source]#
integration_time(t: float, units: str = 'ms')[source]#

Sets the integration time for the spectrometer.

Parameters:
  • t (float) – integration time

  • units (str, optional) – units of integration time, defaults to ‘ms’

property wavelengths[source]#

Return list containing the wavelengths of the spectrometer.

Returns:

A list of wavelengths

Return type:

list

scans_to_average(n: int)[source]#

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)[source]#

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)[source]#

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)[source]#

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)[source]#

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')[source]#

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)[source]#

Collect spectrum at the specified location on the labware

save_to_file(data, dark: bool = False, path: str = None, filename: str = None)[source]#

Save the spectrum to a file

read_from_file(filepath, scale=True, reference_spectrum=None)[source]#
static scale_intensity(data: list, reference_spectrum: list)[source]#
class science_jubilee.tools.Spectrometer.MeasurementManager(metadata, raw_data)[source]#

A class to manage the measurements taken by the SpectroscopyTool

raw_data[source]#
wavelengths[source]#
intensities[source]#
metadata[source]#
pretty_print()[source]#
generate_file(filename, path)[source]#
read_file()[source]#