PythonOceanDirect
1.31.0
OceanDirect Python API
|
Class that models the individual spectrometer. More...
Classes | |
class | Advanced |
Subclass containing advanced features that may or may not be in the spectrometer. More... | |
Public Member Functions | |
def | __init__ (self, dev_id, oceandirect) |
def | get_serial_number (self) |
Read the device serial number. More... | |
def | get_device_type (self) |
Read the device type. More... | |
def | get_model (self) |
Read the correct spectrometer model name assigned. More... | |
def | decode_error (self, errno, caller) |
Decodes the error string returned from device calls. More... | |
def | open_device (self) |
Open the current device associated with this spectrometer object. More... | |
def | close_device (self) |
Detaches the device to free it up for other users. More... | |
def | use_nonlinearity (self, nonlinearity_flag) |
Determine if nonlinearity correction should be used in calculations. More... | |
def | set_scans_to_average (self, newScanToAverage) |
Sets the number of spectra to average. More... | |
def | get_scans_to_average (self) |
Gets the number of spectra to average. More... | |
def | set_boxcar_width (self, newBoxcarWidth) |
Sets the boxcar width to average the spectral data. More... | |
def | get_boxcar_width (self) |
Read the current boxcar width setting. More... | |
def | get_max_intensity (self) |
Returns the maximum pixel value the detector can read. More... | |
def | get_formatted_spectrum (self) |
Return a formatted spectrum. More... | |
def | get_formatted_spectrum_length (self) |
Return the formatted spectra length. More... | |
def | get_wavelengths (self) |
This computes the wavelengths for the spectrometer and fills in the provided array (up to the given length) with those values. More... | |
def | get_minimum_integration_time (self) |
Returns the minimum allowable integration time on the device. More... | |
def | get_maximum_integration_time (self) |
Returns the maximum allowable integration time on the device. More... | |
def | get_minimum_averaging_integration_time (self) |
This function returns the smallest integration time setting, in microseconds, that is valid for the spectrometer. More... | |
def | set_integration_time (self, int_time) |
Sets the integration time on the device. More... | |
def | get_integration_time (self) |
Returns the current integration time on the device. More... | |
def | get_integration_time_increment (self) |
Returns the integration time increment on the device. More... | |
def | set_trigger_mode (self, mode) |
Set the device trigger mode. More... | |
def | get_trigger_mode (self) |
Returns the current trigger mode from the device. More... | |
def | get_index_at_wavelength (self, wavelength) |
Given an approximate wavelength, finds the closest wavelength and returns the index (pixel number) of that wavelength, and the exact wavelength as an ordered pair. More... | |
def | get_indices_at_wavelengths (self, wavelengths) |
Given a list of approximate wavelengths, finds the closest wavelengths and returns the indices (pixel numbers) of those wavelengths, and the exact wavelength as an ordered pair of lists. More... | |
def | get_indices_at_wavelength_range (self, lo, hi, length) |
Given a list of approximate wavelengths, finds the closest wavelengths and returns the indices (pixel numbers) of those wavelengths, and the exact wavelength as an ordered pair of lists. More... | |
def | get_number_electric_dark_pixels (self) |
This returns the number of pixels that are electrically active but optically masked (a.k.a. More... | |
def | get_electric_dark_pixel_indices (self) |
This returns array (up to the given length) with the indices of the pixels that are electrically active but optically masked (a.k.a. More... | |
def | details (self) |
Prints the defined set of details about the device. More... | |
def | is_feature_id_enabled (self, featureID) |
Check if the given feature ID is supported by the device or not. More... | |
def | set_acquisition_delay (self, delayMicrosecond) |
Set the acquisition delay in microseconds. More... | |
def | get_acquisition_delay (self) |
Get the acquisition delay in microseconds. More... | |
def | get_acquisition_delay_increment (self) |
Get the allowed step size for the acquisition delay in microseconds. More... | |
def | get_acquisition_delay_maximum (self) |
Get the maximum allowed acquisition delay in microseconds. More... | |
def | get_acquisition_delay_minimum (self) |
Get the minimum allowed acquisition delay in microseconds. More... | |
def | set_stored_dark_spectrum (self, darkSpectrum) |
Store a dark spectrum for use in subsequent corrections i.e. More... | |
def | get_stored_dark_spectrum (self) |
Retrieve a previously stored dark spectrum for use in subsequent corrections i.e. More... | |
def | get_dark_corrected_spectrum1 (self, darkSpectrum) |
Acquire a spectrum and use the supplied dark spectrum to perform a dark correction then return the dark corrected spectrum. More... | |
def | dark_correct_spectrum1 (self, illuminatedSpectrum) |
Dark correct a previously acquired illuminated spectrum and using a stored dark spectrum. More... | |
def | get_dark_corrected_spectrum2 (self) |
Acquire a spectrum and use the previously stored dark spectrum to perform a dark correction then return the dark corrected spectrum. More... | |
def | dark_correct_spectrum2 (self, darkSpectrum, illuminatedSpectrum) |
Dark correct a previously acquired illuminated spectrum and using a previously acquired dark spectrum. More... | |
def | get_nonlinearity_corrected_spectrum1 (self, 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... | |
def | nonlinearity_correct_spectrum1 (self, illuminatedSpectrum) |
Nonlinearity correct a previously acquired illuminated spectrum using a stored dark spectrum. More... | |
def | get_nonlinearity_corrected_spectrum2 (self) |
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... | |
def | nonlinearity_correct_spectrum2 (self, darkSpectrum, illuminatedSpectrum) |
Nonlinearity correct a previously acquired illuminated spectrum after dark correction using a previously acquired dark spectrum. More... | |
def | set_electric_dark_correction_usage (self, isEnabled) |
Enable or disable an electric dark correction. More... | |
def | get_electric_dark_correction_usage (self) |
Return electric dark correction usage. More... | |
def | set_nonlinearity_correction_usage (self, isEnabled) |
Enable or disable nonlinearity correction. More... | |
def | get_nonlinearity_correction_usage (self) |
Return nonlinearity correction usage. More... | |
Class that models the individual spectrometer.
Should be created by OceanDirectAPI instance. This has an inner class called "Advanced" that contains functions to access other features of the device.
Definition at line 412 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.__init__ | ( | self, | |
dev_id, | |||
oceandirect | |||
) |
Definition at line 418 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.close_device | ( | self | ) |
Detaches the device to free it up for other users.
This function must be called when you're done using the device.
Definition at line 533 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.dark_correct_spectrum1 | ( | self, | |
illuminatedSpectrum | |||
) |
Dark correct a previously acquired illuminated spectrum and using a stored dark spectrum.
illuminatedSpectrum[in] | the buffer that contains the illuminated spectrum to be corrected. |
Definition at line 1096 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.dark_correct_spectrum2 | ( | self, | |
darkSpectrum, | |||
illuminatedSpectrum | |||
) |
Dark correct a previously acquired illuminated spectrum and using a previously acquired dark spectrum.
darkSpectrum[in] | the buffer that contains the dark spectrum to be used for the dark correction. |
illuminatedSpectrum[in] | the buffer that contains the illuminated spectrum to be corrected. |
Definition at line 1140 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.decode_error | ( | self, | |
errno, | |||
caller | |||
) |
Decodes the error string returned from device calls.
[in] | errno | The error code. |
[in] | caller | The method name that calls this function. |
Definition at line 492 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.details | ( | self | ) |
Prints the defined set of details about the device.
Definition at line 921 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_acquisition_delay | ( | self | ) |
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.
Definition at line 962 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_acquisition_delay_increment | ( | self | ) |
Get the allowed step size for the acquisition delay in microseconds.
Definition at line 984 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_acquisition_delay_maximum | ( | self | ) |
Get the maximum allowed acquisition delay in microseconds.
Definition at line 999 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_acquisition_delay_minimum | ( | self | ) |
Get the minimum allowed acquisition delay in microseconds.
Definition at line 1014 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_boxcar_width | ( | self | ) |
Read the current boxcar width setting.
Definition at line 603 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_dark_corrected_spectrum1 | ( | self, | |
darkSpectrum | |||
) |
Acquire a spectrum and use the supplied dark spectrum to perform a dark correction then return the dark corrected spectrum.
darkSpectrum[in] | the buffer that contains the dark spectrum to be used for the dark correction. |
Definition at line 1069 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_dark_corrected_spectrum2 | ( | self | ) |
Acquire a spectrum and use the previously stored dark spectrum to perform a dark correction then return the dark corrected spectrum.
Definition at line 1124 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_device_type | ( | self | ) |
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_electric_dark_correction_usage | ( | self | ) |
Return electric dark correction usage.
Definition at line 1297 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_electric_dark_pixel_indices | ( | self | ) |
This returns array (up to the given length) with the indices of the 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.
Definition at line 899 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_formatted_spectrum | ( | self | ) |
Return a formatted spectrum.
Definition at line 635 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_formatted_spectrum_length | ( | self | ) |
Return the formatted spectra length.
Definition at line 650 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_index_at_wavelength | ( | self, | |
wavelength | |||
) |
Given an approximate wavelength, finds the closest wavelength and returns the index (pixel number) of that wavelength, and the exact wavelength as an ordered pair.
[in] | wavelength | A double value containing a best guess or approximate (this should be within bounds of the entire wavelength array or an error is generated). |
Definition at line 810 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_indices_at_wavelength_range | ( | self, | |
lo, | |||
hi, | |||
length | |||
) |
Given a list of approximate wavelengths, finds the closest wavelengths and returns the indices (pixel numbers) of those wavelengths, and the exact wavelength as an ordered pair of lists.
[in] | lo | Wavelength lower limit. |
[in] | hi | Wavelength upper limit. |
[in] | length | The number of wavelengths to return. |
Definition at line 852 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_indices_at_wavelengths | ( | self, | |
wavelengths | |||
) |
Given a list of approximate wavelengths, finds the closest wavelengths and returns the indices (pixel numbers) of those wavelengths, and the exact wavelength as an ordered pair of lists.
[in] | wavelengths | List of approximate wavelengths. |
Definition at line 829 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_integration_time | ( | self | ) |
Returns the current integration time on the device.
Definition at line 747 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_integration_time_increment | ( | self | ) |
Returns the integration time increment on the device.
Definition at line 763 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_max_intensity | ( | self | ) |
Returns the maximum pixel value the detector can read.
Definition at line 619 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_maximum_integration_time | ( | self | ) |
Returns the maximum allowable integration time on the device.
Definition at line 695 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_minimum_averaging_integration_time | ( | self | ) |
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.
Definition at line 711 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_minimum_integration_time | ( | self | ) |
Returns the minimum allowable integration time on the device.
Definition at line 679 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_model | ( | self | ) |
Read the correct spectrometer model name assigned.
Definition at line 474 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_nonlinearity_corrected_spectrum1 | ( | self, | |
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.
darkSpectrum[in] | the buffer that contains the dark spectrum to be used for the dark correction. |
Definition at line 1175 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_nonlinearity_corrected_spectrum2 | ( | self | ) |
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.
Definition at line 1231 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_nonlinearity_correction_usage | ( | self | ) |
Return nonlinearity correction usage.
Definition at line 1327 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_number_electric_dark_pixels | ( | self | ) |
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.
Definition at line 881 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_scans_to_average | ( | self | ) |
Gets the number of spectra to average.
Definition at line 573 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_serial_number | ( | self | ) |
Read the device serial number.
Definition at line 439 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_stored_dark_spectrum | ( | self | ) |
Retrieve a previously stored dark spectrum for use in subsequent corrections i.e.
dark correction and nonlinearity correction.
Definition at line 1053 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_trigger_mode | ( | self | ) |
Returns the current trigger mode from the device.
If this function is not supported by the device then an exception will be thrown.
Definition at line 793 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.get_wavelengths | ( | self | ) |
This computes the wavelengths for the spectrometer and fills in the provided array (up to the given length) with those values.
Definition at line 659 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.is_feature_id_enabled | ( | self, | |
featureID | |||
) |
Check if the given feature ID is supported by the device or not.
[in] | featureID | An id from FeatureID enum. |
Definition at line 931 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.nonlinearity_correct_spectrum1 | ( | self, | |
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.
illuminatedSpectrum[in] | the buffer that contains the illuminated spectrum to be corrected. |
Definition at line 1203 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.nonlinearity_correct_spectrum2 | ( | self, | |
darkSpectrum, | |||
illuminatedSpectrum | |||
) |
Nonlinearity correct a previously acquired illuminated spectrum after dark correction using a previously acquired dark spectrum.
darkSpectrum[in] | the buffer that contains the dark spectrum to be used prior to the nonlinearity correction. |
illuminatedSpectrum[in] | the buffer that contains the illuminated spectrum to be corrected. |
Definition at line 1249 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.open_device | ( | self | ) |
Open the current device associated with this spectrometer object.
Definition at line 507 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.set_acquisition_delay | ( | self, | |
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.
[in] | delayMicrosecond | The new delay to use in microseconds. |
Definition at line 946 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.set_boxcar_width | ( | self, | |
newBoxcarWidth | |||
) |
Sets the boxcar width to average the spectral data.
[in] | newBoxcarWidth | The boxcar width. |
Definition at line 589 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.set_electric_dark_correction_usage | ( | self, | |
isEnabled | |||
) |
Enable or disable an electric dark correction.
[in] | isEnabled | True to enable electric dark correction otherwise it's False. |
Definition at line 1283 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.set_integration_time | ( | self, | |
int_time | |||
) |
Sets the integration time on the device.
This should be verified to be within range prior to calling this function.
[in] | int_time | The new integration time in microseconds. See device manual for supported integration increment. |
Definition at line 731 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.set_nonlinearity_correction_usage | ( | self, | |
isEnabled | |||
) |
Enable or disable nonlinearity correction.
[in] | isEnabled | True to enable nonlinearity correction otherwise it's False. |
Definition at line 1313 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.set_scans_to_average | ( | self, | |
newScanToAverage | |||
) |
Sets the number of spectra to average.
[in] | newScanToAverage | The number of spectra to average. |
Definition at line 559 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.set_stored_dark_spectrum | ( | self, | |
darkSpectrum | |||
) |
Store a dark spectrum for use in subsequent corrections i.e.
dark correction and nonlinearity correction.
darkSpectrum[in] | the buffer that contains the dark spectrum to be stored. |
Definition at line 1029 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.set_trigger_mode | ( | self, | |
mode | |||
) |
Set the device trigger mode.
[in] | mode | Trigger mode. See device manual for the supported trigger mode. |
Definition at line 779 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.Spectrometer.use_nonlinearity | ( | self, | |
nonlinearity_flag | |||
) |
Determine if nonlinearity correction should be used in calculations.
Typically should be set to true.
[in] | nonlinearity_flag | True to enable nonlinearity correction otherwise it's False. |
Definition at line 546 of file OceanDirectAPI.py.
Definition at line 433 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.apply_nonlinearity |
Definition at line 434 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.boxcar_hw |
Definition at line 436 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.device_id |
Definition at line 419 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.electric_dark_pixels |
Definition at line 429 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.integration_max |
Definition at line 425 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.integration_min |
Definition at line 424 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.integration_time |
Definition at line 423 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.model |
Definition at line 421 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.model_name |
Definition at line 422 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.num_electric_dark_pixels |
Definition at line 428 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.oceandirect |
Definition at line 432 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.pixel_count_formatted |
Definition at line 426 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.pixel_count_unformatted |
Definition at line 427 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.scans_to_avg |
Definition at line 435 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.serial_number |
Definition at line 420 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.status |
Definition at line 430 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.Spectrometer.wavelengths |
Definition at line 431 of file OceanDirectAPI.py.