Wasatch.PY
Python application driver for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
wasatch.AndorDevice.AndorDevice Class Reference
Inheritance diagram for wasatch.AndorDevice.AndorDevice:
wasatch.InterfaceDevice.InterfaceDevice

Public Member Functions

 __init__ (self, device_id, message_queue=None, alert_queue=None)
 
 acquire_data (self)
 
 check_result (self, result, func)
 Public Methods.
 
 connect (self)
 
 get_detector_temperature_degC (self)
 
 get_error_code (self, code)
 
 get_error_code_long (self, code)
 
 get_serial_number (self)
 
 high_gain_mode_enable (self, enabled)
 
 init_detector_area (self)
 
 init_detector_speed (self)
 
 init_tec_setpoint (self)
 
 load_error_codes (self)
 
 not_implemented (self, arg)
 
 save_config (self, eeprom=None)
 
 scans_to_average (self, value)
 
 set_detector_tec_enable (self, flag)
 
 set_etalon_correction_enable (self, flag)
 
 set_fan_enable (self, flag)
 
 set_ingaas_correction_enable (self, flag)
 
 set_integration_time_ms (self, ms)
 
 set_scans_to_average (self, value)
 
 set_shutter_open (self, flag)
 
 set_take_one_request (self, tor)
 
 set_tec_setpoint (self, set_temp)
 
 set_vertical_binning (self, roi)
 
 update_config_from_eeprom (self, eeprom)
 
- Public Member Functions inherited from wasatch.InterfaceDevice.InterfaceDevice
 __init__ (self, device_id, message_queue=None, alert_queue=None)
 
 change_setting (self, setting, value=None)
 Request Handlers.
 
 check_alert (self, name)
 
 handle_cmd (self, cmd, arg=None, force=False)
 
 handle_request (self, request)
 
 handle_requests (self, requests)
 
 queue_message (self, setting, value)
 Outgoing Sideline Messages.
 

Public Attributes

int boxcar_half_width = 0
 
 config_dir = os.path.join(self._get_default_data_dir(), 'config')
 
 config_file = os.path.join(self.config_dir, self.serial + '.json')
 
dict config_names_to_eeprom
 
dict config_values
 
bool connected = False
 
 dark = None
 
bool dll_fail = True
 
 driver = None
 
dict error_codes
 
list gain_idx = []
 
list gain_options = []
 
 height = yPixels.value
 
 integration_time_ms = ms
 
int last_battery_percentage = 0
 
 last_memory_check = datetime.now()
 
 pixels = xPixels.value
 
 process_id = os.getpid()
 
int scan_count = 0
 
str serial = f"CCD-{sn.value}"
 
int session_reading_count = 0
 
 setpoint_deg_c = self.settings.eeprom.startup_temp_degC
 
 settings = SpectrometerSettings(self.device_id)
 
int spec_index = 0
 
int sum_count = 0
 
 summed_spectrum = None
 
 take_one_request = None
 
bool tec_enabled = True
 
 temperature_cache_timestamp = None
 
 temperature_cache_value = None
 
- Public Attributes inherited from wasatch.InterfaceDevice.InterfaceDevice
 alert_queue = alert_queue
 
 device_id = device_id
 
 message_queue = message_queue
 
dict process_f = {}
 
int remaining_throwaways = 0
 

Static Public Attributes

bool DRIVER_NOT_INSTALLED = False
 
int SHUTTER_SPEED_MS = 50
 
int SUCCESS = 20002
 
float TEMPERATURE_CACHE_SEC = 1.0
 

Protected Member Functions

 _check_config_file (self)
 
 _close_ex_shutter (self)
 
 _get_default_data_dir (self)
 
 _get_spectrum_raw (self)
 
 _init_process_funcs (self)
 
 _load_config_values (self)
 
 _obtain_gain_info (self)
 
 _open_ex_shutter (self)
 
 _queue_message (self, setting, value)
 Private Methods.
 
 _take_one_averaged_reading (self)
 
- Protected Member Functions inherited from wasatch.InterfaceDevice.InterfaceDevice
 _refresh_alerts (self)
 Incoming Sideline Messages.
 

Protected Attributes

int _scan_averaging = 1
 
- Protected Attributes inherited from wasatch.InterfaceDevice.InterfaceDevice
 _alerts = set()
 
dict _supported_message_queue_types
 

Detailed Description

This is the basic implementation of our interface with Andor cameras     

@todo have check_result return a SpectrometerResponse 
@todo try to auto-detect whether x-axis needs inverted via DLL.GetImageFlip()

Constructor & Destructor Documentation

◆ __init__()

wasatch.AndorDevice.AndorDevice.__init__ ( self,
device_id,
message_queue = None,
alert_queue = None )

Member Function Documentation

◆ _check_config_file()

wasatch.AndorDevice.AndorDevice._check_config_file ( self)
protected

◆ _close_ex_shutter()

wasatch.AndorDevice.AndorDevice._close_ex_shutter ( self)
protected

◆ _get_default_data_dir()

wasatch.AndorDevice.AndorDevice._get_default_data_dir ( self)
protected

◆ _get_spectrum_raw()

wasatch.AndorDevice.AndorDevice._get_spectrum_raw ( self)
protected
@todo missing bad-pixel correction

◆ _init_process_funcs()

wasatch.AndorDevice.AndorDevice._init_process_funcs ( self)
protected

◆ _load_config_values()

wasatch.AndorDevice.AndorDevice._load_config_values ( self)
protected
Loads configuration from file `self.config_file` and populates `self.settings.eeprom` with members.

◆ _obtain_gain_info()

wasatch.AndorDevice.AndorDevice._obtain_gain_info ( self)
protected

◆ _open_ex_shutter()

wasatch.AndorDevice.AndorDevice._open_ex_shutter ( self)
protected

◆ _queue_message()

wasatch.AndorDevice.AndorDevice._queue_message ( self,
setting,
value )
protected

Private Methods.

If an upstream queue is defined, send the name-value pair.  Does nothing
if the caller hasn't provided a queue.

"setting" is application (caller) dependent, but ENLIGHTEN currently uses
"marquee_info" and "marquee_error".

◆ _take_one_averaged_reading()

wasatch.AndorDevice.AndorDevice._take_one_averaged_reading ( self)
protected
@note this may be collecting a dark spectrum requested through TakeOneRequest.take_dark 
@returns Reading

◆ acquire_data()

wasatch.AndorDevice.AndorDevice.acquire_data ( self)

◆ check_result()

wasatch.AndorDevice.AndorDevice.check_result ( self,
result,
func )

Public Methods.

◆ connect()

wasatch.AndorDevice.AndorDevice.connect ( self)

◆ get_detector_temperature_degC()

wasatch.AndorDevice.AndorDevice.get_detector_temperature_degC ( self)

◆ get_error_code()

wasatch.AndorDevice.AndorDevice.get_error_code ( self,
code )

◆ get_error_code_long()

wasatch.AndorDevice.AndorDevice.get_error_code_long ( self,
code )

◆ get_serial_number()

wasatch.AndorDevice.AndorDevice.get_serial_number ( self)

◆ high_gain_mode_enable()

wasatch.AndorDevice.AndorDevice.high_gain_mode_enable ( self,
enabled )

◆ init_detector_area()

wasatch.AndorDevice.AndorDevice.init_detector_area ( self)

◆ init_detector_speed()

wasatch.AndorDevice.AndorDevice.init_detector_speed ( self)

◆ init_tec_setpoint()

wasatch.AndorDevice.AndorDevice.init_tec_setpoint ( self)

◆ load_error_codes()

wasatch.AndorDevice.AndorDevice.load_error_codes ( self)
See also
ATMCD32D.H

◆ not_implemented()

wasatch.AndorDevice.AndorDevice.not_implemented ( self,
arg )

◆ save_config()

wasatch.AndorDevice.AndorDevice.save_config ( self,
eeprom = None )
The user has edited the "virtual EEPROM", for instance using ENLIGHTEN's 
EEPROM Editor, and wants to save the new EEPROM.  Therefore we need to
generate a fresh JSON equivalent and write it to disk.

@param eeprom: if provided, overwrite current settings with those in the 
       passed dict before writing to disk

◆ scans_to_average()

wasatch.AndorDevice.AndorDevice.scans_to_average ( self,
value )

◆ set_detector_tec_enable()

wasatch.AndorDevice.AndorDevice.set_detector_tec_enable ( self,
flag )

◆ set_etalon_correction_enable()

wasatch.AndorDevice.AndorDevice.set_etalon_correction_enable ( self,
flag )

◆ set_fan_enable()

wasatch.AndorDevice.AndorDevice.set_fan_enable ( self,
flag )

◆ set_ingaas_correction_enable()

wasatch.AndorDevice.AndorDevice.set_ingaas_correction_enable ( self,
flag )

◆ set_integration_time_ms()

wasatch.AndorDevice.AndorDevice.set_integration_time_ms ( self,
ms )

◆ set_scans_to_average()

wasatch.AndorDevice.AndorDevice.set_scans_to_average ( self,
value )

◆ set_shutter_open()

wasatch.AndorDevice.AndorDevice.set_shutter_open ( self,
flag )

◆ set_take_one_request()

wasatch.AndorDevice.AndorDevice.set_take_one_request ( self,
tor )

◆ set_tec_setpoint()

wasatch.AndorDevice.AndorDevice.set_tec_setpoint ( self,
set_temp )

◆ set_vertical_binning()

wasatch.AndorDevice.AndorDevice.set_vertical_binning ( self,
roi )
Note that this follows the same (start, end) vertical ROI API as 
FeatureInterfaceDevice.set_vertical_binning, and dynamically translates 
that into the (middle, height) Andor API.

◆ update_config_from_eeprom()

wasatch.AndorDevice.AndorDevice.update_config_from_eeprom ( self,
eeprom )
Populates a dict used to update the configuration file `self.config_file`
from `self.settings.eeprom` members.

Member Data Documentation

◆ _scan_averaging

int wasatch.AndorDevice.AndorDevice._scan_averaging = 1
protected

◆ boxcar_half_width

int wasatch.AndorDevice.AndorDevice.boxcar_half_width = 0

◆ config_dir

wasatch.AndorDevice.AndorDevice.config_dir = os.path.join(self._get_default_data_dir(), 'config')

◆ config_file

wasatch.AndorDevice.AndorDevice.config_file = os.path.join(self.config_dir, self.serial + '.json')

◆ config_names_to_eeprom

dict wasatch.AndorDevice.AndorDevice.config_names_to_eeprom
Initial value:
= {
'wp_serial_number': 'serial_number',
'wp_model': 'model'
}

◆ config_values

wasatch.AndorDevice.AndorDevice.config_values
Initial value:
= {
'detector_serial_number': self.serial,
'wavelength_coeffs': [0,1,0,0,0],
'excitation_nm_float': 0,
'raman_intensity_coeffs': [],
'raman_intensity_calibration_order': 0,
'invert_x_axis': False,
'roi_horizontal_start': 0,
'roi_horizontal_end': 0,
'roi_vertical_region_1_start': 0,
'roi_vertical_region_1_end': 0,
'stubbed': True
}

◆ connected

bool wasatch.AndorDevice.AndorDevice.connected = False

◆ dark

wasatch.AndorDevice.AndorDevice.dark = None

◆ dll_fail

bool wasatch.AndorDevice.AndorDevice.dll_fail = True

◆ driver

wasatch.AndorDevice.AndorDevice.driver = None

◆ DRIVER_NOT_INSTALLED

bool wasatch.AndorDevice.AndorDevice.DRIVER_NOT_INSTALLED = False
static

◆ error_codes

dict wasatch.AndorDevice.AndorDevice.error_codes

◆ gain_idx

list wasatch.AndorDevice.AndorDevice.gain_idx = []

◆ gain_options

list wasatch.AndorDevice.AndorDevice.gain_options = []

◆ height

wasatch.AndorDevice.AndorDevice.height = yPixels.value

◆ integration_time_ms

wasatch.AndorDevice.AndorDevice.integration_time_ms = ms

◆ last_battery_percentage

int wasatch.AndorDevice.AndorDevice.last_battery_percentage = 0

◆ last_memory_check

wasatch.AndorDevice.AndorDevice.last_memory_check = datetime.now()

◆ pixels

wasatch.AndorDevice.AndorDevice.pixels = xPixels.value

◆ process_id

wasatch.AndorDevice.AndorDevice.process_id = os.getpid()

◆ scan_count

int wasatch.AndorDevice.AndorDevice.scan_count = 0

◆ serial

str wasatch.AndorDevice.AndorDevice.serial = f"CCD-{sn.value}"

◆ session_reading_count

int wasatch.AndorDevice.AndorDevice.session_reading_count = 0

◆ setpoint_deg_c

wasatch.AndorDevice.AndorDevice.setpoint_deg_c = self.settings.eeprom.startup_temp_degC

◆ settings

wasatch.AndorDevice.AndorDevice.settings = SpectrometerSettings(self.device_id)

◆ SHUTTER_SPEED_MS

wasatch.AndorDevice.AndorDevice.SHUTTER_SPEED_MS = 50
static

◆ spec_index

wasatch.AndorDevice.AndorDevice.spec_index = 0

◆ SUCCESS

int wasatch.AndorDevice.AndorDevice.SUCCESS = 20002
static

◆ sum_count

wasatch.AndorDevice.AndorDevice.sum_count = 0

◆ summed_spectrum

wasatch.AndorDevice.AndorDevice.summed_spectrum = None

◆ take_one_request

wasatch.AndorDevice.AndorDevice.take_one_request = None

◆ tec_enabled

bool wasatch.AndorDevice.AndorDevice.tec_enabled = True

◆ TEMPERATURE_CACHE_SEC

float wasatch.AndorDevice.AndorDevice.TEMPERATURE_CACHE_SEC = 1.0
static

◆ temperature_cache_timestamp

wasatch.AndorDevice.AndorDevice.temperature_cache_timestamp = None

◆ temperature_cache_value

wasatch.AndorDevice.AndorDevice.temperature_cache_value = None

The documentation for this class was generated from the following file: