OceanDirectLighthouse  3.1.1
OceanDirect Lighthouse Python API
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Python.oceandirect.LighthouseAPI.LighthouseAPI Class Reference

Classes

class  __LighthouseSingleton
 

Public Member Functions

def __init__ (self)
 
def __getattr__ (self, name)
 
str decode_error (self, int errno, str caller)
 
tuple[int, int, int] get_api_version_numbers (self)
 Return OceanDirect api version information. More...
 
str get_revision_firmware (self, int device_id)
 Reads out the firmware revision from the device's internal memory if that feature is supported. More...
 
str get_revision_fpga (self, int device_id)
 Reads out the FPGA revision from the device's internal memory if that feature is supported. More...
 
str get_revision_system (self, int device_id)
 Reads out the System revision from the device's internal memory if that feature is supported. More...
 
None shutdown (self)
 Closes the connection to OceanDirectAPI. More...
 
None setMulticastMsgSendRetry (self, int retryCount)
 Set the number of times to send multicast message for dynamic probing. More...
 
None setMulticastMsgResponseReadDelay (self, int delayMs)
 Set the delay between reading multicast response. More...
 
None setMulticastMsgResponseReadRetry (self, int retryCount)
 Set the number of times to read multicast message response. More...
 
int probe_all_devices (self)
 Finds all available Ocean devices by scanning on USB for devices with Ocean drivers, finding devices that respond to UDP multicast, and also returning IDs for any TCP-enabled devices that have been manually specified using addTCPDeviceLocation(). More...
 
int probe_usb_devices (self)
 Finds all available Ocean devices by scanning on USB for devices with Ocean drivers. More...
 
int probe_network_devices (self)
 Finds all available Ocean devices by scanning the network for devices with Ocean drivers. More...
 
int add_network_device (self, str ipAddress, str deviceType)
 Manually create an instance of the network attached device and then open it using the openDevice() function. More...
 
int get_number_devices (self)
 Returns the number of devices available. More...
 
list[int] get_network_device_ids (self)
 Return a list of network device ids from devices that were probe. More...
 
list[int] get_device_ids (self)
 Return a list of device ids from devices that were both probe or manually added. More...
 
str get_serial_number (self, int device_id)
 Read the device serial number. More...
 
int get_device_type (self, int device_id)
 Read the device type. More...
 
str get_model (self, int device_id)
 Read the correct spectrometer model name assigned. More...
 
None open_device (self, int device_id)
 Attach to a device discovered by probe_devices or get_device_ids. More...
 
None close_device (self, int device_id)
 Detaches the device to free it up for other users. More...
 
None set_scans_to_average (self, int device_id, int newScanToAverage)
 Sets the number of spectra to average. More...
 
int get_scans_to_average (self, int device_id)
 Gets the number of spectra to average. More...
 
None set_boxcar_width (self, int device_id, int newBoxcarWidth)
 Sets the boxcar width to average the spectral data. More...
 
int get_boxcar_width (self, int device_id)
 Read the current boxcar width setting. More...
 
int get_maximum_intensity (self, int device_id)
 Returns the maximum pixel value the detector can read. More...
 
int get_spectrum_length (self, int device_id)
 Return a formatted spectrum length. More...
 
list[float] get_spectrum (self, int device_id)
 Return a formatted spectrum. More...
 
SpectrumWithMetadata get_spectrum_with_metadata (self, int device_id)
 Returns spectra with metadata information. More...
 
list[float] get_wavelengths (self, int device_id)
 This computes the wavelengths for the spectrometer and fills in the provided array (up to the given length) with those values. More...
 
int get_minimum_integration_time (self, int device_id)
 Returns the minimum allowable integration time on the device. More...
 
int get_maximum_integration_time (self, int device_id)
 Returns the maximum allowable integration time on the device. More...
 
int get_minimum_averaging_integration_time (self, int device_id)
 This function returns the smallest integration time setting, in microseconds, that is valid for the spectrometer. More...
 
None set_integration_time (self, int device_id, int int_time)
 Sets the integration time on the device. More...
 
int get_integration_time (self, int device_id)
 Returns the current integration time on the device. More...
 
int get_integration_time_increment (self, int device_id)
 Returns the integration time increment on the device. More...
 
None set_trigger_mode (self, int device_id, int mode)
 Set the device trigger mode. More...
 
None get_trigger_mode (self, int device_id)
 Returns the current trigger mode from the device. More...
 
int get_active_pixel_count (self, int device_id)
 This returns the number of pixels that are active. More...
 
list[int] get_active_pixel_indices (self, int device_id)
 Read the active pixel range from the sensor pixel array. More...
 
int get_electric_dark_pixel_count (self, int device_id)
 This returns the number of pixels that are electrically active but optically masked (a.k.a. More...
 
list[int] get_electric_dark_pixel_indices (self, int device_id)
 Read the optical dark pixel range from the sensor pixel array. More...
 
int get_transition_pixel_count (self, int device_id)
 This returns the number of pixels that are transition or bevel. More...
 
list[int] get_transition_pixel_indices (self, int device_id)
 Read the transition pixel range from the sensor pixel array. More...
 
list[int] get_bad_pixel_indices (self, int device_id)
 Read bad pixel indices from the sensor pixel array. More...
 
None details (self, int device_id)
 Prints the defined set of details about the device. More...
 
None set_acquisition_delay (self, int device_id, int delayMicrosecond)
 Set the acquisition delay in microseconds. More...
 
int get_acquisition_delay (self, int device_id)
 Get the acquisition delay in microseconds. More...
 
int get_acquisition_delay_increment (self, int device_id)
 Get the allowed step size for the acquisition delay in microseconds. More...
 
int get_acquisition_delay_maximum (self, int device_id)
 Get the maximum allowed acquisition delay in microseconds. More...
 
int get_acquisition_delay_minimum (self, int device_id)
 Get the minimum allowed acquisition delay in microseconds. More...
 
None set_stored_dark_spectrum (self, int device_id, list[float] darkSpectrum)
 Store a dark spectrum for use in subsequent corrections i.e. More...
 
list[float] get_stored_dark_spectrum (self, int device_id)
 Retrieve a previously stored dark spectrum for use in subsequent corrections i.e. More...
 
list[float] get_dark_corrected_spectrum1 (self, int device_id)
 Acquire a spectrum and use the previously stored dark spectrum to perform a dark correction then return the dark corrected spectrum. More...
 
list[float] dark_correct_spectrum1 (self, int device_id, list[float] illuminatedSpectrum)
 Dark correct a previously acquired illuminated spectrum and using a stored dark spectrum. More...
 
list[float] get_dark_corrected_spectrum2 (self, int device_id, list[float] darkSpectrum)
 Acquire a spectrum and use the supplied dark spectrum to perform a dark correction then return the dark corrected spectrum. More...
 
list[float] dark_correct_spectrum2 (self, int device_id, list[float] darkSpectrum, list[float] illuminatedSpectrum)
 Dark correct a previously acquired illuminated spectrum and using a previously acquired dark spectrum. More...
 
list[float] get_nonlinearity_corrected_spectrum1 (self, int device_id)
 Acquire a spectrum and use the previously stored dark spectrum to perform a dark correction followed by a nonlinearity correction then return the nonlinearity corrected spectrum. More...
 
list[float] nonlinearity_correct_spectrum1 (self, int device_id, list[float] illuminatedSpectrum)
 Nonlinearity correct a previously acquired illuminated spectrum using a stored dark spectrum. More...
 
list[float] get_nonlinearity_corrected_spectrum2 (self, int device_id, list[float] darkSpectrum)
 Acquire a spectrum and use the supplied dark spectrum to perform a dark correction followed by the nonlinearity correction then return the nonlinearity corrected spectrum. More...
 
list[float] nonlinearity_correct_spectrum2 (self, int device_id, list[float] darkSpectrum, list[float] illuminatedSpectrum)
 Nonlinearity correct a previously acquired illuminated spectrum after dark correction using a previously acquired dark spectrum. More...
 
list[float] boxcar_correct_spectrum (self, int device_id, list[float] illuminatedSpectrum, int boxcarWidth)
 Apply a boxcar correction on the given illuminated spectrum. More...
 
None set_electric_dark_correction_state (self, int device_id, bool isEnabled)
 Enable or disable an electric dark correction. More...
 
bool get_electric_dark_correction_state (self, int device_id)
 Return electric dark correction usage. More...
 
None set_nonlinearity_correction_state (self, int device_id, bool isEnabled)
 Enable or disable nonlinearity correction. More...
 
bool get_nonlinearity_correction_state (self, int device_id)
 Return nonlinearity correction usage. More...
 
None set_lamp_state (self, int device_id, bool enable)
 Enable or disable the lamp. More...
 
bool get_lamp_state (self, int device_id)
 Return the lamp state. More...
 
None set_shutter_state (self, int device_id, bool shutterState)
 This function will open or close the shutter on the spectrometer. More...
 
None get_shutter_state (self, int device_id)
 This function returns the shutter state of the spectrometer. More...
 
list[float] get_wavelength_coefficients (self, int device_id)
 Read the wavelength coefficients from the device. More...
 
list[float] get_nonlinearity_coefficients (self, int device_id)
 Read the nonlinearity coefficients stored in the device. More...
 
None set_tec_temperature_setpoint (self, int device_id, float temp_C)
 Apply the setpoint temperature (Celsius) in the thermo-electric cooler. More...
 
float get_tec_temperature_setpoint (self, int device_id)
 Read the set point temperature of the thermo-electric cooler. More...
 
float get_tec_temperature (self, int device_id)
 Returns the temperature reading (celsius) of a detector thermistor. More...
 
bool get_tec_stable (self, int device_id)
 Returns the state of thermo-electric cooler temperature on whether it reached the stable temperature or not. More...
 
None set_single_strobe_state (self, int device_id, bool enable)
 Set the enable status of the single strobe signal. More...
 
bool get_single_strobe_state (self, int device_id)
 Get the enable status of the single strobe signal. More...
 
None set_single_strobe_delay (self, int device_id, int delayMicrosecond)
 Set the amount of time, in microseconds, that should elapse after a starting event before the single strobe should have a rising edge. More...
 
int get_single_strobe_delay (self, int device_id)
 Get the amount of time, in microseconds, that should elapse after a starting event before the single strobe should have a rising edge. More...
 
None set_single_strobe_width (self, int device_id, int widthMicrosecond)
 Set the amount of time, in microseconds, that the single strobe pulse should remain high after it begins. More...
 
int get_single_strobe_width (self, int device_id)
 Get the amount of time, in microseconds, that the single strobe pulse should remain high after it begins. More...
 
int get_single_strobe_delay_minimum (self, int device_id)
 Get the minimum amount of time, in microseconds, that should elapse after a starting event before the single strobe should have a rising edge. More...
 
int get_single_strobe_delay_maximum (self, int device_id)
 Get the maximum amount of time, in microseconds, that should elapse after a starting event before the single strobe should have a rising edge. More...
 
int get_single_strobe_delay_increment (self, int device_id)
 Gets the single strobe delay increment in microseconds. More...
 
int get_single_strobe_width_minimum (self, int device_id)
 Get the minimum amount of time, in microseconds, that the single strobe pulse should remain high after it begins. More...
 
int get_single_strobe_width_maximum (self, int device_id)
 Get the maximum amount of time, in microseconds, that the single strobe pulse should remain high after it begins. More...
 
int get_single_strobe_width_increment (self, int device_id)
 Get the single strobe width increment. More...
 
None set_continuous_strobe_period (self, int device_id, int period)
 Sets the continuous strobe period in microseconds. More...
 
int get_continuous_strobe_period (self, int device_id)
 Get the continuous strobe period in microseconds. More...
 
None set_continuous_strobe_state (self, int device_id, bool enable)
 Sets the continuous strobe enable state on the device. More...
 
bool get_continuous_strobe_state (self, int device_id)
 Gets the continuous strobe state (enabled or disabled) of the device. More...
 
int get_continuous_strobe_period_minimum (self, int device_id)
 Gets the minimum continuous strobe period of the device in microseconds. More...
 
int get_continuous_strobe_period_maximum (self, int device_id)
 Gets the maximum continuous strobe period of the device in microseconds. More...
 
int get_continuous_strobe_period_increment (self, int device_id)
 This function gets the current size of the strobe period increment of the device in microseconds. More...
 
None set_led_state (self, int device_id, bool isEnabled)
 Enable or disable device LED. More...
 
bool get_led_state (self, int device_id)
 Get device LED state. More...
 
int get_device_original_vid (self, int device_id)
 Get the original vendor id (VID) of the device. More...
 
int get_device_original_pid (self, int device_id)
 Get the original product id (PID) of the device. More...
 
int get_device_vid (self, int device_id)
 Get the current vendor id (VID) of the device. More...
 
int get_device_pid (self, int device_id)
 Get the current product id (PID) of the device. More...
 
str get_device_original_manufacturer_string (self, int device_id)
 Get the original manufacturer string of the device. More...
 
str get_device_original_model_string (self, int device_id)
 Get the original model string of the device. More...
 
str get_device_manufacturer_string (self, int device_id)
 Get the current manufacturer string of the device. More...
 
str get_device_model_string (self, int device_id)
 Get the current model string of the device. More...
 
str get_device_alias (self, int device_id)
 Read the device alias from the device. More...
 
None reset_device (self, int device_id)
 Restarts the device. More...
 
str get_user_string (self, int device_id)
 Read the user string from the device. More...
 
None set_user_string (self, int device_id, str userString)
 Set a new user string to the device. More...
 
int get_gpio_pin_count (self, int device_id)
 Get GPIO pin count. More...
 
None set_gpio_output_state (self, int device_id, int direction, int bitmask)
 Sets the GPIO bit direction to either output or input. More...
 
int get_gpio_output_state (self, int device_id)
 Get all GPIO bit direction. More...
 
None set_gpio_value (self, int device_id, int value, int bitmask)
 Sets the GPIO bit value to either high or low. More...
 
int get_gpio_value (self, int device_id)
 Get all GPIO bit values. More...
 
int get_baud_rate (self, int device_id)
 Read the device RS-232 baud rate. More...
 
None set_baud_rate (self, int device_id, int baudRate)
 Set a new baud rate for the RS-232 port. More...
 
int get_autonull_maximum_adc_count (self, int device_id)
 Read the maximum ADC counts. More...
 
int get_autonull_baseline_level (self, int device_id)
 Read the baseline level. More...
 
int get_autonull_saturation_level (self, int device_id)
 Read the saturation level. More...
 
int get_autonull_fpga_digital_gain (self, int device_id)
 Read the fpga digital gain. More...
 
int get_autonull_fpga_digital_offset (self, int device_id)
 Read the fpga digital offset. More...
 
bool get_ip_address_assigned_mode (self, int device_id)
 Read the IP address mode from the OBP2 device. More...
 
None set_ip_address_assigned_mode (self, int device_id, bool useDHCP)
 Set the IP address mode to the OBP2 device. More...
 
bool get_ethernet_addon_available (self, int device_id)
 Return True or False on whether an ethernet add-on package is available in the OBP2 enabled device. More...
 
list[int] get_ethernet_mac_address (self, int device_id)
 Read the ethernet 6-byte mac address from an OBP2 enabled device. More...
 
tuple[bool, LighthouseNetworkConfigurationget_network_configuration (self, int device_id)
 Read the network configuration parameters from an OBP2 enabled device. More...
 
None set_manual_network_configuration (self, int device_id, LighthouseNetworkConfiguration networkConfig)
 Write the network configuration parameters (static ip address) on OBP2 enabled device. More...
 
LighthouseNetworkConfiguration get_manual_network_configuration (self, int device_id)
 Read the network configuration parameters (static ip address) from an OBP2 enabled device. More...
 
None save_settings_to_flash (self, int device_id)
 Save settings to flash. More...
 

Public Attributes

 spectrum_length_map
 

Static Public Attributes

 instance
 

Detailed Description

Definition at line 12 of file LighthouseAPI.py.

Constructor & Destructor Documentation

◆ __init__()

def Python.oceandirect.LighthouseAPI.LighthouseAPI.__init__ (   self)
Loads and initializes the OceanDirect dll and initializes internal variables.

Definition at line 37 of file LighthouseAPI.py.

Member Function Documentation

◆ __getattr__()

def Python.oceandirect.LighthouseAPI.LighthouseAPI.__getattr__ (   self,
  name 
)

Definition at line 46 of file LighthouseAPI.py.

◆ add_network_device()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.add_network_device (   self,
str  ipAddress,
str  deviceType 
)

Manually create an instance of the network attached device and then open it using the openDevice() function.

It is the responsiblitiy of the user to ensure that the device exist and configured properly. Note that this should only be done by one thread at a time.

Parameters
ipAddressThe ip address as string (ex: "10.20.30.100" ) of the device to be opened.
deviceTypeThe device type could be OceanFX or OceanHDX. This is case sensitive.
Returns
The device id.
See also
open_device()

Definition at line 244 of file LighthouseAPI.py.

◆ boxcar_correct_spectrum()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.boxcar_correct_spectrum (   self,
int  device_id,
list[float]  illuminatedSpectrum,
int  boxcarWidth 
)

Apply a boxcar correction on the given illuminated spectrum.

Parameters
device_idThe device id.
illuminatedSpectrumThe spectrum that will be boxcar corrected.
boxcarWidthThe boxcar width.
Returns
The boxcar corrected spectrum.

Definition at line 1231 of file LighthouseAPI.py.

◆ close_device()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.close_device (   self,
int  device_id 
)

Detaches the device to free it up for other users.

The device_id becomes invalid after closing the device. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Parameters
device_idThe id of the device to be closed.
See also
open_device()

Definition at line 418 of file LighthouseAPI.py.

◆ dark_correct_spectrum1()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.dark_correct_spectrum1 (   self,
int  device_id,
list[float]  illuminatedSpectrum 
)

Dark correct a previously acquired illuminated spectrum and using a stored dark spectrum.

See also
set_stored_dark_spectrum
Parameters
device_idThe device id.
illuminatedSpectrumThe buffer that contains the illuminated spectrum to be corrected.
Returns
The dark corrected spectrum.

Definition at line 1030 of file LighthouseAPI.py.

◆ dark_correct_spectrum2()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.dark_correct_spectrum2 (   self,
int  device_id,
list[float]  darkSpectrum,
list[float]  illuminatedSpectrum 
)

Dark correct a previously acquired illuminated spectrum and using a previously acquired dark spectrum.

Parameters
device_idThe device id.
darkSpectrumThe buffer that contains the dark spectrum to be used for the dark correction.
illuminatedSpectrumThe buffer that contains the illuminated spectrum to be corrected.
Returns
The dark corrected spectrum.

Definition at line 1082 of file LighthouseAPI.py.

◆ decode_error()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.decode_error (   self,
int  errno,
str  caller 
)
OceanDirectAPI returns an error code if something goes wrong. This function will decode
that error to a readable string.
@param errno: The error code generated by OceanDirect api.
:type errno: int
@param caller: The caller which produces the error code. Use for debugging purposes only.
:type caller: str

Definition at line 49 of file LighthouseAPI.py.

◆ details()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.details (   self,
int  device_id 
)

Prints the defined set of details about the device.

Parameters
device_idThe device id.

Definition at line 868 of file LighthouseAPI.py.

◆ get_acquisition_delay()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_acquisition_delay (   self,
int  device_id 
)

Get the acquisition delay in microseconds.

This may also be referred to as the trigger delay. In any event, it is the time between some event (such as a request for data, or an external trigger pulse) and when data acquisition begins. Note that not all devices support reading this value back. In these cases, the returned value will be the last value sent to odapi_adv_set_acquisition_delay_microseconds(). If no value has been set and the value cannot be read back, this function will indicate an error.

See also
set_acquisition_delay()
Parameters
device_idThe device id.
Returns
The acquisition delay in microseconds.

Definition at line 897 of file LighthouseAPI.py.

◆ get_acquisition_delay_increment()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_acquisition_delay_increment (   self,
int  device_id 
)

Get the allowed step size for the acquisition delay in microseconds.

Parameters
device_idThe device id.
Returns
The acquisition delay step size in microseconds.

Definition at line 920 of file LighthouseAPI.py.

◆ get_acquisition_delay_maximum()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_acquisition_delay_maximum (   self,
int  device_id 
)

Get the maximum allowed acquisition delay in microseconds.

Parameters
device_idThe device id.
Returns
The maximum acquisition delay in microseconds.

Definition at line 936 of file LighthouseAPI.py.

◆ get_acquisition_delay_minimum()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_acquisition_delay_minimum (   self,
int  device_id 
)

Get the minimum allowed acquisition delay in microseconds.

Parameters
device_idThe device id.
Returns
The minimum acquisition delay in microseconds.

Definition at line 952 of file LighthouseAPI.py.

◆ get_active_pixel_count()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_active_pixel_count (   self,
int  device_id 
)

This returns the number of pixels that are active.

Parameters
device_idThe device id.
Returns
The number of active pixels.

Definition at line 736 of file LighthouseAPI.py.

◆ get_active_pixel_indices()

list[int] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_active_pixel_indices (   self,
int  device_id 
)

Read the active pixel range from the sensor pixel array.

This command is being used in OBP-2.0 enabled devices. If the device don't support this command then a non-zero error code will be returned.

Parameters
device_idThe device id.
Returns
A list of active pixel range.

Definition at line 752 of file LighthouseAPI.py.

◆ get_api_version_numbers()

tuple[int, int, int] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_api_version_numbers (   self)

Return OceanDirect api version information.

Returns
An integer tuple of major, minor, and point value.

Definition at line 64 of file LighthouseAPI.py.

◆ get_autonull_baseline_level()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_autonull_baseline_level (   self,
int  device_id 
)

Read the baseline level.

Parameters
device_idThe device id.
Returns
The baseline level.

Definition at line 2204 of file LighthouseAPI.py.

◆ get_autonull_fpga_digital_gain()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_autonull_fpga_digital_gain (   self,
int  device_id 
)

Read the fpga digital gain.

Parameters
device_idThe device id.
Returns
The digital gain value.

Definition at line 2236 of file LighthouseAPI.py.

◆ get_autonull_fpga_digital_offset()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_autonull_fpga_digital_offset (   self,
int  device_id 
)

Read the fpga digital offset.

Parameters
device_idThe device id.
Returns
The digital offset value.

Definition at line 2252 of file LighthouseAPI.py.

◆ get_autonull_maximum_adc_count()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_autonull_maximum_adc_count (   self,
int  device_id 
)

Read the maximum ADC counts.

Parameters
device_idThe device id.
Returns
The ADC counts.

Definition at line 2188 of file LighthouseAPI.py.

◆ get_autonull_saturation_level()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_autonull_saturation_level (   self,
int  device_id 
)

Read the saturation level.

Most devices returns 65535.

Parameters
device_idThe device id.
Returns
The saturation level.

Definition at line 2220 of file LighthouseAPI.py.

◆ get_bad_pixel_indices()

list[int] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_bad_pixel_indices (   self,
int  device_id 
)

Read bad pixel indices from the sensor pixel array.

This command is being used in OBP-2.0 enabled devices. If the device don't support this command then a non-zero error code will be returned.

Parameters
device_idThe device id.
Returns
A list of bad pixel indices.

Definition at line 850 of file LighthouseAPI.py.

◆ get_baud_rate()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_baud_rate (   self,
int  device_id 
)

Read the device RS-232 baud rate.

See also
set_baud_rate()
Parameters
device_idThe device id.
Returns
The baud rate.

Definition at line 2149 of file LighthouseAPI.py.

◆ get_boxcar_width()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_boxcar_width (   self,
int  device_id 
)

Read the current boxcar width setting.

See also
set_boxcar_width()
Parameters
device_idThe device id.
Returns
The boxcar width.

Definition at line 482 of file LighthouseAPI.py.

◆ get_continuous_strobe_period()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_continuous_strobe_period (   self,
int  device_id 
)

Get the continuous strobe period in microseconds.

See also
set_continuous_strobe_period()
Parameters
device_idThe device id.
Returns
the period in microseconds.

Definition at line 1721 of file LighthouseAPI.py.

◆ get_continuous_strobe_period_increment()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_continuous_strobe_period_increment (   self,
int  device_id 
)

This function gets the current size of the strobe period increment of the device in microseconds.

The increment is dependent on the strobe period. Small strobe periods i.e. less than about 1ms will have a small increment, typically 1 microsecond. Larger strobe periods will have larger increments, typically 1ms.

Parameters
device_idThe device id.
Returns
The current strobe period increment in microseconds.

Definition at line 1807 of file LighthouseAPI.py.

◆ get_continuous_strobe_period_maximum()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_continuous_strobe_period_maximum (   self,
int  device_id 
)

Gets the maximum continuous strobe period of the device in microseconds.

Parameters
device_idThe device id.
Returns
The maximum strobe period in microseconds.

Definition at line 1791 of file LighthouseAPI.py.

◆ get_continuous_strobe_period_minimum()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_continuous_strobe_period_minimum (   self,
int  device_id 
)

Gets the minimum continuous strobe period of the device in microseconds.

Parameters
device_idThe device id.
Returns
The minimum strobe period in microseconds.

Definition at line 1775 of file LighthouseAPI.py.

◆ get_continuous_strobe_state()

bool Python.oceandirect.LighthouseAPI.LighthouseAPI.get_continuous_strobe_state (   self,
int  device_id 
)

Gets the continuous strobe state (enabled or disabled) of the device.

See also
set_continuous_strobe_state()
Parameters
device_idThe device id.
Returns
True if continuous strobe is enabled otherwise it's False.

Definition at line 1758 of file LighthouseAPI.py.

◆ get_dark_corrected_spectrum1()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_dark_corrected_spectrum1 (   self,
int  device_id 
)

Acquire a spectrum and use the previously stored dark spectrum to perform a dark correction then return the dark corrected spectrum.

See also
setStoredDarkSpectrum.
Parameters
device_idThe device id.
Returns
The dark corrected spectrum.

Definition at line 1012 of file LighthouseAPI.py.

◆ get_dark_corrected_spectrum2()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_dark_corrected_spectrum2 (   self,
int  device_id,
list[float]  darkSpectrum 
)

Acquire a spectrum and use the supplied dark spectrum to perform a dark correction then return the dark corrected spectrum.

See also
set_stored_dark_spectrum.
Parameters
device_idThe device id.
Returns
The dark corrected spectrum.

Definition at line 1059 of file LighthouseAPI.py.

◆ get_device_alias()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_alias (   self,
int  device_id 
)

Read the device alias from the device.

If this field in the device is not yet populated then a non-zero(6) code will be returned.

Parameters
device_idThe device id.
Returns
The device alias.

Definition at line 1994 of file LighthouseAPI.py.

◆ get_device_ids()

list[int] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_ids (   self)

Return a list of device ids from devices that were both probe or manually added.

Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Returns
List of device id's.

Definition at line 309 of file LighthouseAPI.py.

◆ get_device_manufacturer_string()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_manufacturer_string (   self,
int  device_id 
)

Get the current manufacturer string of the device.

Parameters
device_idThe device id.
Returns
The manufacturer string.

Definition at line 1959 of file LighthouseAPI.py.

◆ get_device_model_string()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_model_string (   self,
int  device_id 
)

Get the current model string of the device.

Parameters
device_idThe device id.
Returns
The model string.

Definition at line 1976 of file LighthouseAPI.py.

◆ get_device_original_manufacturer_string()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_original_manufacturer_string (   self,
int  device_id 
)

Get the original manufacturer string of the device.

Parameters
device_idThe device id.
Returns
The manufacturer string.

Definition at line 1925 of file LighthouseAPI.py.

◆ get_device_original_model_string()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_original_model_string (   self,
int  device_id 
)

Get the original model string of the device.

Parameters
device_idThe device id.
Returns
The model string.

Definition at line 1942 of file LighthouseAPI.py.

◆ get_device_original_pid()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_original_pid (   self,
int  device_id 
)

Get the original product id (PID) of the device.

Parameters
device_idThe device id.
Returns
The PID.

Definition at line 1877 of file LighthouseAPI.py.

◆ get_device_original_vid()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_original_vid (   self,
int  device_id 
)

Get the original vendor id (VID) of the device.

Parameters
device_idThe device id.
Returns
The VID.

Definition at line 1861 of file LighthouseAPI.py.

◆ get_device_pid()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_pid (   self,
int  device_id 
)

Get the current product id (PID) of the device.

Parameters
device_idThe device id.
Returns
The PID.

Definition at line 1909 of file LighthouseAPI.py.

◆ get_device_type()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_type (   self,
int  device_id 
)

Read the device type.

Returns
The device type.

Definition at line 348 of file LighthouseAPI.py.

◆ get_device_vid()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_device_vid (   self,
int  device_id 
)

Get the current vendor id (VID) of the device.

Parameters
device_idThe device id.
Returns
The VID.

Definition at line 1893 of file LighthouseAPI.py.

◆ get_electric_dark_correction_state()

bool Python.oceandirect.LighthouseAPI.LighthouseAPI.get_electric_dark_correction_state (   self,
int  device_id 
)

Return electric dark correction usage.

See also
set_electric_dark_correction_state()
Parameters
device_idThe device id.
Returns
True if electric dark connection is applied otherwise it's False.

Definition at line 1277 of file LighthouseAPI.py.

◆ get_electric_dark_pixel_count()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_electric_dark_pixel_count (   self,
int  device_id 
)

This returns the number of pixels that are electrically active but optically masked (a.k.a.

electric dark pixels). Note that not all detectors have optically masked pixels; in that case, this function will return zero.

Parameters
device_idThe device id.
Returns
The number of electric dark pixels on the spectrometer.

Definition at line 772 of file LighthouseAPI.py.

◆ get_electric_dark_pixel_indices()

list[int] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_electric_dark_pixel_indices (   self,
int  device_id 
)

Read the optical dark pixel range from the sensor pixel array.

This command is being used in OBP-2.0 enabled devices. If the device don't support this command then a non-zero error code will be returned.

Parameters
device_idThe device id.
Returns
A list of optical dark pixel range.

Definition at line 790 of file LighthouseAPI.py.

◆ get_ethernet_addon_available()

bool Python.oceandirect.LighthouseAPI.LighthouseAPI.get_ethernet_addon_available (   self,
int  device_id 
)

Return True or False on whether an ethernet add-on package is available in the OBP2 enabled device.

Parameters
device_idThe device id.
Returns
True if the ethernet add-on is available otherwise False.

Definition at line 2306 of file LighthouseAPI.py.

◆ get_ethernet_mac_address()

list[int] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_ethernet_mac_address (   self,
int  device_id 
)

Read the ethernet 6-byte mac address from an OBP2 enabled device.

Parameters
device_idThe device id.
Returns
The mac address.

Definition at line 2322 of file LighthouseAPI.py.

◆ get_gpio_output_state()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_gpio_output_state (   self,
int  device_id 
)

Get all GPIO bit direction.

See also
set_gpio_output_state()
Parameters
device_idThe device id.
Returns
All bits direction which could be True(out) or False(in)

Definition at line 2097 of file LighthouseAPI.py.

◆ get_gpio_pin_count()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_gpio_pin_count (   self,
int  device_id 
)

Get GPIO pin count.

Parameters
device_idThe device id.
Returns
The pin count.

Definition at line 2065 of file LighthouseAPI.py.

◆ get_gpio_value()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_gpio_value (   self,
int  device_id 
)

Get all GPIO bit values.

See also
set_gpio_value()
Parameters
device_idThe device id.
Returns
All bit value (int) where each bit could be True(high) or False(low).

Definition at line 2130 of file LighthouseAPI.py.

◆ get_integration_time()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_integration_time (   self,
int  device_id 
)

Returns the current integration time on the device.

See also
set_integration_time()
Parameters
device_idThe device id.
Returns
The integration time in microsecond.

Definition at line 666 of file LighthouseAPI.py.

◆ get_integration_time_increment()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_integration_time_increment (   self,
int  device_id 
)

Returns the integration time increment on the device.

Parameters
device_idThe device id.
Returns
The integration time increment in microsecond.

Definition at line 686 of file LighthouseAPI.py.

◆ get_ip_address_assigned_mode()

bool Python.oceandirect.LighthouseAPI.LighthouseAPI.get_ip_address_assigned_mode (   self,
int  device_id 
)

Read the IP address mode from the OBP2 device.

See also
set_ip_address_assigned_mode()
Parameters
device_idThe device id.
Returns
True if the ip address was generated via DHCP. False if the ip address was statically assigned.

Definition at line 2268 of file LighthouseAPI.py.

◆ get_lamp_state()

bool Python.oceandirect.LighthouseAPI.LighthouseAPI.get_lamp_state (   self,
int  device_id 
)

Return the lamp state.

See also
set_lamp_state()
Parameters
device_idThe device id.
Returns
True if lamp is ON otherwise False.

Definition at line 1341 of file LighthouseAPI.py.

◆ get_led_state()

bool Python.oceandirect.LighthouseAPI.LighthouseAPI.get_led_state (   self,
int  device_id 
)

Get device LED state.

If the device don't have an LED then an exception will be thrown.

See also
set_led_state()
Parameters
device_idThe device id.
Returns
True if LED is enabled otherwise it's False.

Definition at line 1843 of file LighthouseAPI.py.

◆ get_manual_network_configuration()

LighthouseNetworkConfiguration Python.oceandirect.LighthouseAPI.LighthouseAPI.get_manual_network_configuration (   self,
int  device_id 
)

Read the network configuration parameters (static ip address) from an OBP2 enabled device.

This function will return a LighthouseNetworkConfiguration that contains the ip address, subnet mask, default gateway, and dns server address.

See also
set_manual_network_configuration()
Parameters
device_idThe device id.
Returns
A LighthouseNetworkConfiguration objects.

Definition at line 2387 of file LighthouseAPI.py.

◆ get_maximum_integration_time()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_maximum_integration_time (   self,
int  device_id 
)

Returns the maximum allowable integration time on the device.

Parameters
device_idThe device id.
Returns
The maximum integration time.

Definition at line 608 of file LighthouseAPI.py.

◆ get_maximum_intensity()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_maximum_intensity (   self,
int  device_id 
)

Returns the maximum pixel value the detector can read.

Parameters
device_idThe device id.
Returns
The maximum intensity.

Definition at line 499 of file LighthouseAPI.py.

◆ get_minimum_averaging_integration_time()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_minimum_averaging_integration_time (   self,
int  device_id 
)

This function returns the smallest integration time setting, in microseconds, that is valid for the spectrometer.

NOTE: some devices that make use of onboard functionality to perform averaging have a different, larger, minimum integration time for acquisition when averaging is enabled. Refer to the documentation for your spectrometer to see if this is the case. The minimum integration time when averaging is enabled can be determined using odapi_get_minimum_averaging_integration_time_micros.

Parameters
device_idThe device id.
Returns
The minimum averaging integration time.

Definition at line 628 of file LighthouseAPI.py.

◆ get_minimum_integration_time()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_minimum_integration_time (   self,
int  device_id 
)

Returns the minimum allowable integration time on the device.

Parameters
device_idThe device id.
Returns
The minimum integration time.

Definition at line 592 of file LighthouseAPI.py.

◆ get_model()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_model (   self,
int  device_id 
)

Read the correct spectrometer model name assigned.

Parameters
device_idThe device id.
Returns
The device model name.

Definition at line 362 of file LighthouseAPI.py.

◆ get_network_configuration()

tuple[bool, LighthouseNetworkConfiguration] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_network_configuration (   self,
int  device_id 
)

Read the network configuration parameters from an OBP2 enabled device.

This function will return a tuple of 2 objects in this order: address mode - True if it's using DHCP IP address otherwise its False. network configuration - A LighthouseNetworkConfiguration object containing the ip address, subnet mask, default gateway, and dns server.

Parameters
device_idThe device id.
Returns
A tuple of 2 objects.

Definition at line 2345 of file LighthouseAPI.py.

◆ get_network_device_ids()

list[int] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_network_device_ids (   self)

Return a list of network device ids from devices that were probe.

Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Returns
List of network device id's.

Definition at line 290 of file LighthouseAPI.py.

◆ get_nonlinearity_coefficients()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_nonlinearity_coefficients (   self,
int  device_id 
)

Read the nonlinearity coefficients stored in the device.

This command is being used in OBP-2.0 enabled devices. If the device don't support this command then a non-zero error code will be returned.

Parameters
device_idThe device id.
Returns
A list of nonlinearity coefficients.

Definition at line 1408 of file LighthouseAPI.py.

◆ get_nonlinearity_corrected_spectrum1()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_nonlinearity_corrected_spectrum1 (   self,
int  device_id 
)

Acquire a spectrum and use the previously stored dark spectrum to perform a dark correction followed by a nonlinearity correction then return the nonlinearity corrected spectrum.

See also
setStoredDarkSpectrum.
Parameters
device_idThe device id.
Returns
The nonlinearity corrected spectrum.

Definition at line 1117 of file LighthouseAPI.py.

◆ get_nonlinearity_corrected_spectrum2()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_nonlinearity_corrected_spectrum2 (   self,
int  device_id,
list[float]  darkSpectrum 
)

Acquire a spectrum and use the supplied dark spectrum to perform a dark correction followed by the nonlinearity correction then return the nonlinearity corrected spectrum.

See also
set_stored_dark_spectrum.
Parameters
device_idThe device id.
Returns
The nonlinearity corrected spectrum.

Definition at line 1166 of file LighthouseAPI.py.

◆ get_nonlinearity_correction_state()

bool Python.oceandirect.LighthouseAPI.LighthouseAPI.get_nonlinearity_correction_state (   self,
int  device_id 
)

Return nonlinearity correction usage.

See also
set_nonlinearity_correction_state()
Parameters
device_idThe device id.
Returns
True if nonlinearity connection is applied otherwise it's False.

Definition at line 1309 of file LighthouseAPI.py.

◆ get_number_devices()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_number_devices (   self)

Returns the number of devices available.

Note that this should only be done by one thread at a time.

Returns
The number of connected(discovered) devices.

Definition at line 275 of file LighthouseAPI.py.

◆ get_revision_firmware()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_revision_firmware (   self,
int  device_id 
)

Reads out the firmware revision from the device's internal memory if that feature is supported.

Parameters
device_idThe device id.
Returns
The firmware revision.

Definition at line 78 of file LighthouseAPI.py.

◆ get_revision_fpga()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_revision_fpga (   self,
int  device_id 
)

Reads out the FPGA revision from the device's internal memory if that feature is supported.

Parameters
device_idThe device id.
Returns
The fpga revision.

Definition at line 98 of file LighthouseAPI.py.

◆ get_revision_system()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_revision_system (   self,
int  device_id 
)

Reads out the System revision from the device's internal memory if that feature is supported.

Parameters
device_idThe device id.
Returns
The system revision.

Definition at line 117 of file LighthouseAPI.py.

◆ get_scans_to_average()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_scans_to_average (   self,
int  device_id 
)

Gets the number of spectra to average.

See also
set_scans_to_average()
Parameters
device_idThe device id.
Returns
The number of spectra to average.

Definition at line 450 of file LighthouseAPI.py.

◆ get_serial_number()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_serial_number (   self,
int  device_id 
)

Read the device serial number.

Parameters
device_idThe device id.
Returns
The serial number.

Definition at line 331 of file LighthouseAPI.py.

◆ get_shutter_state()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.get_shutter_state (   self,
int  device_id 
)

This function returns the shutter state of the spectrometer.

See also
set_shutter_state()
Parameters
device_idThe device id.
Returns
True if the shutter is opened otherwise returns False.

Definition at line 1373 of file LighthouseAPI.py.

◆ get_single_strobe_delay()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_single_strobe_delay (   self,
int  device_id 
)

Get the amount of time, in microseconds, that should elapse after a starting event before the single strobe should have a rising edge.

See also
set_single_strobe_delay()
Parameters
device_idThe device id.
Returns
The delay in microseconds.

Definition at line 1552 of file LighthouseAPI.py.

◆ get_single_strobe_delay_increment()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_single_strobe_delay_increment (   self,
int  device_id 
)

Gets the single strobe delay increment in microseconds.

Parameters
device_idThe device id.
Returns
The delay increment.

Definition at line 1639 of file LighthouseAPI.py.

◆ get_single_strobe_delay_maximum()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_single_strobe_delay_maximum (   self,
int  device_id 
)

Get the maximum amount of time, in microseconds, that should elapse after a starting event before the single strobe should have a rising edge.

Parameters
device_idThe device id.
Returns
The maximum delay in microseconds.

Definition at line 1622 of file LighthouseAPI.py.

◆ get_single_strobe_delay_minimum()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_single_strobe_delay_minimum (   self,
int  device_id 
)

Get the minimum amount of time, in microseconds, that should elapse after a starting event before the single strobe should have a rising edge.

Parameters
device_idThe device id.
Returns
The minimum delay in microseconds.

Definition at line 1605 of file LighthouseAPI.py.

◆ get_single_strobe_state()

bool Python.oceandirect.LighthouseAPI.LighthouseAPI.get_single_strobe_state (   self,
int  device_id 
)

Get the enable status of the single strobe signal.

Note that on some devices the enable control is shared with other signals (e.g. lamp enable and continuous strobe) so this may have some side-effects and changing those features may affect the single strobe as well.

See also
set_single_strobe_state()
Parameters
device_idThe device id.
Returns
True if single strobe is enabled otherwise it's False.

Definition at line 1515 of file LighthouseAPI.py.

◆ get_single_strobe_width()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_single_strobe_width (   self,
int  device_id 
)

Get the amount of time, in microseconds, that the single strobe pulse should remain high after it begins.

See also
set_single_strobe_width()
Parameters
device_idThe device id.
Returns
The pulse width in microseconds.

Definition at line 1587 of file LighthouseAPI.py.

◆ get_single_strobe_width_increment()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_single_strobe_width_increment (   self,
int  device_id 
)

Get the single strobe width increment.

Parameters
device_idThe device id.
Returns
The width increment.

Definition at line 1689 of file LighthouseAPI.py.

◆ get_single_strobe_width_maximum()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_single_strobe_width_maximum (   self,
int  device_id 
)

Get the maximum amount of time, in microseconds, that the single strobe pulse should remain high after it begins.

Parameters
device_idThe device id.
Returns
The maximum width in microseconds.

Definition at line 1672 of file LighthouseAPI.py.

◆ get_single_strobe_width_minimum()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_single_strobe_width_minimum (   self,
int  device_id 
)

Get the minimum amount of time, in microseconds, that the single strobe pulse should remain high after it begins.

Parameters
device_idThe device id.
Returns
The minimum width in microseconds.

Definition at line 1655 of file LighthouseAPI.py.

◆ get_spectrum()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_spectrum (   self,
int  device_id 
)

Return a formatted spectrum.

Parameters
device_idThe device id.
Returns
The formatted spectrum.

Definition at line 532 of file LighthouseAPI.py.

◆ get_spectrum_length()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_spectrum_length (   self,
int  device_id 
)

Return a formatted spectrum length.

Parameters
device_idThe device id.
Returns
The formatted spectrum.

Definition at line 516 of file LighthouseAPI.py.

◆ get_spectrum_with_metadata()

SpectrumWithMetadata Python.oceandirect.LighthouseAPI.LighthouseAPI.get_spectrum_with_metadata (   self,
int  device_id 
)

Returns spectra with metadata information.

For older devices such as FX/HDX, read a maximum of 15 spectra from the data buffer. This function requires that both back to back scans and data buffer be enabled. See "set_data_buffer_enable()" and "set_number_of_backtoback_scans()". For newer devices such as Ocean SR2, you can call this function right away. See device manual if this command is supported.

Parameters
device_idThe device id.
Returns
The spectra with metadata info.

Definition at line 553 of file LighthouseAPI.py.

◆ get_stored_dark_spectrum()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_stored_dark_spectrum (   self,
int  device_id 
)

Retrieve a previously stored dark spectrum for use in subsequent corrections i.e.

dark correction and nonlinearity correction.

See also
setStoredDarkSpectrum.
Parameters
device_idThe device id.
Returns
The dark spectrum.

Definition at line 994 of file LighthouseAPI.py.

◆ get_tec_stable()

bool Python.oceandirect.LighthouseAPI.LighthouseAPI.get_tec_stable (   self,
int  device_id 
)

Returns the state of thermo-electric cooler temperature on whether it reached the stable temperature or not.

If this function is not supported by the device then an exception will be thrown.

Parameters
device_idThe device id.
Returns
True if it's stable, False otherwise.

Definition at line 1479 of file LighthouseAPI.py.

◆ get_tec_temperature()

float Python.oceandirect.LighthouseAPI.LighthouseAPI.get_tec_temperature (   self,
int  device_id 
)

Returns the temperature reading (celsius) of a detector thermistor.

This is equivalent to calling get_temperature(index) where the "index" is a detector thermistor index. If this function is not supported by the device then an exception will be thrown.

Parameters
device_idThe device id.
Returns
The temperature in degrees celsius.

Definition at line 1461 of file LighthouseAPI.py.

◆ get_tec_temperature_setpoint()

float Python.oceandirect.LighthouseAPI.LighthouseAPI.get_tec_temperature_setpoint (   self,
int  device_id 
)

Read the set point temperature of the thermo-electric cooler.

If this function is not supported by the device then an exception will be thrown.

See also
set_tec_temperature_setpoint()
Parameters
device_idThe device id.
Returns
The temperature value in celsius.

Definition at line 1443 of file LighthouseAPI.py.

◆ get_transition_pixel_count()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.get_transition_pixel_count (   self,
int  device_id 
)

This returns the number of pixels that are transition or bevel.

Parameters
device_idThe device id.
Returns
The number of active pixels.

Definition at line 812 of file LighthouseAPI.py.

◆ get_transition_pixel_indices()

list[int] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_transition_pixel_indices (   self,
int  device_id 
)

Read the transition pixel range from the sensor pixel array.

This command is being used in OBP-2.0 enabled devices. If the device don't support this command then a non-zero error code will be returned.

Parameters
device_idThe device id.
Returns
A list of transition pixel range.

Definition at line 828 of file LighthouseAPI.py.

◆ get_trigger_mode()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.get_trigger_mode (   self,
int  device_id 
)

Returns the current trigger mode from the device.

If this function is not supported by the device then an exception will be thrown.

See also
set_trigger_mode()
Parameters
device_idThe device id.
Returns
The trigger mode.

Definition at line 717 of file LighthouseAPI.py.

◆ get_user_string()

str Python.oceandirect.LighthouseAPI.LighthouseAPI.get_user_string (   self,
int  device_id 
)

Read the user string from the device.

If this field in the device is not yet populated then a non-zero(6) code will be returned.

See also
set_user_string()
Parameters
device_idThe device id.
Returns
The user string.

Definition at line 2024 of file LighthouseAPI.py.

◆ get_wavelength_coefficients()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_wavelength_coefficients (   self,
int  device_id 
)

Read the wavelength coefficients from the device.

This command is being used in OBP-2.0 enabled devices. If the device don't support this command then a non-zero error code will be returned.

Parameters
device_idThe device id.
Returns
List of wavelength coefficient values.

Definition at line 1390 of file LighthouseAPI.py.

◆ get_wavelengths()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.get_wavelengths (   self,
int  device_id 
)

This computes the wavelengths for the spectrometer and fills in the provided array (up to the given length) with those values.

Parameters
device_idThe device id.
Returns
The wavelength values for the device in a python list.

Definition at line 574 of file LighthouseAPI.py.

◆ nonlinearity_correct_spectrum1()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.nonlinearity_correct_spectrum1 (   self,
int  device_id,
list[float]  illuminatedSpectrum 
)

Nonlinearity correct a previously acquired illuminated spectrum using a stored dark spectrum.

This function performs a dark correction using a previously stored dark spectrum prior to performing the nonlinearity correction.

See also
set_stored_dark_spectrum
Parameters
device_idThe device id.
illuminatedSpectrumThe buffer that contains the illuminated spectrum to be corrected.
Returns
The nonlinearity corrected spectrum.

Definition at line 1136 of file LighthouseAPI.py.

◆ nonlinearity_correct_spectrum2()

list[float] Python.oceandirect.LighthouseAPI.LighthouseAPI.nonlinearity_correct_spectrum2 (   self,
int  device_id,
list[float]  darkSpectrum,
list[float]  illuminatedSpectrum 
)

Nonlinearity correct a previously acquired illuminated spectrum after dark correction using a previously acquired dark spectrum.

Parameters
device_idThe device id.
darkSpectrumThe buffer that contains the dark spectrum to be used prior to the nonlinearity correction.
illuminatedSpectrumThe buffer that contains the illuminated spectrum to be corrected.
Returns
The nonlinearity corrected spectrum.

Definition at line 1195 of file LighthouseAPI.py.

◆ open_device()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.open_device (   self,
int  device_id 
)

Attach to a device discovered by probe_devices or get_device_ids.

After the device is closed the device_id becomes invalid. You need to call either find_devices()/find_usb_devices()/add_network_device() and get_device_ids() in order to have a valid id before reopening the device again. For a network connected device this function may return an error code if the device is not yet ready to accept incoming connection or the device is unreachable. Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Parameters
device_idThe device id.
Returns
The device object.
See also
find_devices()
find_usb_devices()
add_network_device()
close_device()

Definition at line 380 of file LighthouseAPI.py.

◆ probe_all_devices()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.probe_all_devices (   self)

Finds all available Ocean devices by scanning on USB for devices with Ocean drivers, finding devices that respond to UDP multicast, and also returning IDs for any TCP-enabled devices that have been manually specified using addTCPDeviceLocation().

Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Returns
Number of devices found.
See also
probe_usb_devices()
probe_network_devices()
open_device()

Definition at line 192 of file LighthouseAPI.py.

◆ probe_network_devices()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.probe_network_devices (   self)

Finds all available Ocean devices by scanning the network for devices with Ocean drivers.

Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Returns
Number of devices found.
See also
probe_usb_devices()
probe_all_devices()
open_device()

Definition at line 227 of file LighthouseAPI.py.

◆ probe_usb_devices()

int Python.oceandirect.LighthouseAPI.LighthouseAPI.probe_usb_devices (   self)

Finds all available Ocean devices by scanning on USB for devices with Ocean drivers.

Note that this should only be done by one thread at a time. For multithreaded application this function must be synchronized.

Returns
Number of devices found.
See also
probe_network_devices()
probe_all_devices()
open_device()

Definition at line 210 of file LighthouseAPI.py.

◆ reset_device()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.reset_device (   self,
int  device_id 
)

Restarts the device.

Parameters
device_idThe device id.

Definition at line 2011 of file LighthouseAPI.py.

◆ save_settings_to_flash()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.save_settings_to_flash (   self,
int  device_id 
)

Save settings to flash.

Not all devices supported this command.

Parameters
device_idThe device id.

Definition at line 2407 of file LighthouseAPI.py.

◆ set_acquisition_delay()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_acquisition_delay (   self,
int  device_id,
int  delayMicrosecond 
)

Set the acquisition delay in microseconds.

This may also be referred to as the trigger delay. In any event, it is the time between some event (such as a request for data, or an external trigger pulse) and when data acquisition begins.

See also
get_acquisition_delay()
Parameters
device_idThe device id.
delayMicrosecondThe new delay to use in microseconds.

Definition at line 880 of file LighthouseAPI.py.

◆ set_baud_rate()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_baud_rate (   self,
int  device_id,
int  baudRate 
)

Set a new baud rate for the RS-232 port.

See also
get_baud_rate()
Parameters
device_idThe device id.
baudRateThe baud rate value.

Definition at line 2166 of file LighthouseAPI.py.

◆ set_boxcar_width()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_boxcar_width (   self,
int  device_id,
int  newBoxcarWidth 
)

Sets the boxcar width to average the spectral data.

@get_boxcar_width()

Parameters
device_idThe device id.
newBoxcarWidthThe boxcar width.

Definition at line 467 of file LighthouseAPI.py.

◆ set_continuous_strobe_period()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_continuous_strobe_period (   self,
int  device_id,
int  period 
)

Sets the continuous strobe period in microseconds.

See also
get_continuous_strobe_period()
Parameters
device_idThe device id.
periodThe new period of the continuous strobe measured in microseconds

Definition at line 1706 of file LighthouseAPI.py.

◆ set_continuous_strobe_state()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_continuous_strobe_state (   self,
int  device_id,
bool  enable 
)

Sets the continuous strobe enable state on the device.

See also
get_continuous_strobe_state()
Parameters
device_idThe device id.
enableA boolean used for denoting the desired state (on/off) of the continuous strobe generator. If the value of enable is nonzero, then the continuous strobe will operate. If the value of enable is zero, then the continuous strobe will stop. Note that on some devices the continuous strobe enable is tied to other enables (such as lamp enable or single strobe enable) which may cause side effects.

Definition at line 1738 of file LighthouseAPI.py.

◆ set_electric_dark_correction_state()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_electric_dark_correction_state (   self,
int  device_id,
bool  isEnabled 
)

Enable or disable an electric dark correction.

See also
get_electric_dark_correction_state()
Parameters
device_idThe device id.
isEnabledTrue to enable electric dark correction otherwise it's False.

Definition at line 1262 of file LighthouseAPI.py.

◆ set_gpio_output_state()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_gpio_output_state (   self,
int  device_id,
int  direction,
int  bitmask 
)

Sets the GPIO bit direction to either output or input.

See also
get_gpio_output_state()
Parameters
device_idThe device id.
directionThe direction value for each bit which could be true(output) or false(input).
bitmaskThe bit mask.

Definition at line 2081 of file LighthouseAPI.py.

◆ set_gpio_value()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_gpio_value (   self,
int  device_id,
int  value,
int  bitmask 
)

Sets the GPIO bit value to either high or low.

See also
get_gpio_value()
Parameters
device_idThe device id.
valueThe direction value for each bit which could be true(high) or false(low).
bitmaskThe bit mask.

Definition at line 2114 of file LighthouseAPI.py.

◆ set_integration_time()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_integration_time (   self,
int  device_id,
int  int_time 
)

Sets the integration time on the device.

This should be verified to be within range prior to calling this function.

See also
get_integration_time()
Parameters
device_idThe device id.
int_timeThe new integration time in microseconds. See device manual for supported integration increment.

Definition at line 650 of file LighthouseAPI.py.

◆ set_ip_address_assigned_mode()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_ip_address_assigned_mode (   self,
int  device_id,
bool  useDHCP 
)

Set the IP address mode to the OBP2 device.

See also
get_ip_address_assigned_mode()
Parameters
device_idThe device id.
useDHCPTrue will use DHCP generated ip address. False will use statically assigned IP address.

Definition at line 2287 of file LighthouseAPI.py.

◆ set_lamp_state()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_lamp_state (   self,
int  device_id,
bool  enable 
)

Enable or disable the lamp.

See also
get_lamp_state()
Parameters
device_idThe device id.
enableTrue to enable lamp, False otherwise.

Definition at line 1326 of file LighthouseAPI.py.

◆ set_led_state()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_led_state (   self,
int  device_id,
bool  isEnabled 
)

Enable or disable device LED.

If the device don't have an LED then an exception will be thrown.

See also
get_led_state()
Parameters
device_idThe device id.
isEnabledTrue to enable LED blinking otherwise it's False.

Definition at line 1828 of file LighthouseAPI.py.

◆ set_manual_network_configuration()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_manual_network_configuration (   self,
int  device_id,
LighthouseNetworkConfiguration  networkConfig 
)

Write the network configuration parameters (static ip address) on OBP2 enabled device.

See also
get_manual_network_configuration()
Parameters
device_idThe device id.
networkConfigThe network configuration object containing ip address, subnet mask, default gateway, and dns server.

Definition at line 2366 of file LighthouseAPI.py.

◆ set_nonlinearity_correction_state()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_nonlinearity_correction_state (   self,
int  device_id,
bool  isEnabled 
)

Enable or disable nonlinearity correction.

See also
get_nonlinearity_correction_state()
Parameters
device_idThe device id.
isEnabledTrue to enable nonlinearity correction otherwise it's False.

Definition at line 1294 of file LighthouseAPI.py.

◆ set_scans_to_average()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_scans_to_average (   self,
int  device_id,
int  newScanToAverage 
)

Sets the number of spectra to average.

See also
get_scans_to_average()
Parameters
device_idThe device id.
newScanToAverageThe number of spectra to average.

Definition at line 435 of file LighthouseAPI.py.

◆ set_shutter_state()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_shutter_state (   self,
int  device_id,
bool  shutterState 
)

This function will open or close the shutter on the spectrometer.

See also
get_shutter_state()
Parameters
device_idThe device id.
shutterStateTrue will open the shutter. False will then close the shutter.

Definition at line 1358 of file LighthouseAPI.py.

◆ set_single_strobe_delay()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_single_strobe_delay (   self,
int  device_id,
int  delayMicrosecond 
)

Set the amount of time, in microseconds, that should elapse after a starting event before the single strobe should have a rising edge.

See also
get_single_strobe_delay()
Parameters
device_idThe device id.
delayMicrosecondThe delay, in microseconds, that the single strobe should wait before the pulse begins.

Definition at line 1535 of file LighthouseAPI.py.

◆ set_single_strobe_state()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_single_strobe_state (   self,
int  device_id,
bool  enable 
)

Set the enable status of the single strobe signal.

Note that on some devices the enable control is shared with other signals (e.g. lamp enable and continuous strobe) so this may have some side-effects and changing those features may affect the single strobe as well.

See also
get_single_strobe_state()
Parameters
device_idThe device id.
enableTrue to enable single strobe otherwise use False.

Definition at line 1497 of file LighthouseAPI.py.

◆ set_single_strobe_width()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_single_strobe_width (   self,
int  device_id,
int  widthMicrosecond 
)

Set the amount of time, in microseconds, that the single strobe pulse should remain high after it begins.

See also
get_single_strobe_width()
Parameters
device_idThe device id.
widthMicrosecondThe duration, in microseconds, of the single strobe pulse after the rising edge occurs. Once this duration elapses, a falling edge will be generated.

Definition at line 1570 of file LighthouseAPI.py.

◆ set_stored_dark_spectrum()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_stored_dark_spectrum (   self,
int  device_id,
list[float]  darkSpectrum 
)

Store a dark spectrum for use in subsequent corrections i.e.

dark correction and nonlinearity correction.

See also
getStoredDarkSpectrum.
Parameters
device_idThe device id.
darkSpectrumThe buffer that contains the dark spectrum to be stored.

Definition at line 969 of file LighthouseAPI.py.

◆ set_tec_temperature_setpoint()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_tec_temperature_setpoint (   self,
int  device_id,
float  temp_C 
)

Apply the setpoint temperature (Celsius) in the thermo-electric cooler.

If this function is not supported by the device then an exception will be thrown.

See also
get_tec_temperature_setpoint()
Parameters
device_idThe device id.
temp_CThe setpoint temperature in celsius.

Definition at line 1427 of file LighthouseAPI.py.

◆ set_trigger_mode()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_trigger_mode (   self,
int  device_id,
int  mode 
)

Set the device trigger mode.

See also
get_trigger_mode()
Parameters
device_idThe device id.
modeTrigger mode. See device manual for the supported trigger mode.

Definition at line 702 of file LighthouseAPI.py.

◆ set_user_string()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.set_user_string (   self,
int  device_id,
str  userString 
)

Set a new user string to the device.

The maximum string length is 16.

See also
get_user_string()
Parameters
device_idThe device id.
userStringThe user string. If value is empty then an exception will be thrown.

Definition at line 2043 of file LighthouseAPI.py.

◆ setMulticastMsgResponseReadDelay()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.setMulticastMsgResponseReadDelay (   self,
int  delayMs 
)

Set the delay between reading multicast response.

This must be called before probing network devices.

See also
find_devices()
Parameters
delayMsThe delay in milliseconds before next read.

Definition at line 174 of file LighthouseAPI.py.

◆ setMulticastMsgResponseReadRetry()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.setMulticastMsgResponseReadRetry (   self,
int  retryCount 
)

Set the number of times to read multicast message response.

This must be called before probing network devices.

See also
find_devices()
Parameters
retryCountThe number of times to try reading multicast response messages.

Definition at line 183 of file LighthouseAPI.py.

◆ setMulticastMsgSendRetry()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.setMulticastMsgSendRetry (   self,
int  retryCount 
)

Set the number of times to send multicast message for dynamic probing.

This must be called before probing network devices.

See also
find_devices()
Parameters
retryCountThe number of times to send messages.

Definition at line 165 of file LighthouseAPI.py.

◆ shutdown()

None Python.oceandirect.LighthouseAPI.LighthouseAPI.shutdown (   self)

Closes the connection to OceanDirectAPI.

This is the last to be called before the program terminates.

Definition at line 159 of file LighthouseAPI.py.

Member Data Documentation

◆ instance

Python.oceandirect.LighthouseAPI.LighthouseAPI.instance
static

Definition at line 35 of file LighthouseAPI.py.

◆ spectrum_length_map

Python.oceandirect.LighthouseAPI.LighthouseAPI.spectrum_length_map

Definition at line 44 of file LighthouseAPI.py.