|
ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
|
This is the basic implementation of our interface with Andor cameras. More...
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) | |
| 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. | |
| set_fan_enable (self, x) | |
| set_integration_time_ms (self, ms) | |
| set_scans_to_average (self, value) | |
| set_shutter_enable (self, enable) | |
| set_take_one_request (self, tor) | |
| set_tec_setpoint (self, set_temp) | |
| 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. | |
| toggle_tec (self, toggle_state) | |
| update_config_from_eeprom (self, eeprom) | |
Populates a dict used to update the configuration file self.config_file from self.settings.eeprom members. | |
Public Member Functions inherited from wasatch.InterfaceDevice.InterfaceDevice | |
| __init__ (self) | |
| Any class that communicates to a spectrometer should inherit this class. | |
| handle_requests (self, requests) | |
Public Attributes | |
| alert_queue = alert_queue | |
| int | boxcar_half_width = 0 |
| list | command_queue = [] |
| 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 | |
| device_id = device_id | |
| bool | dll_fail = True |
| driver = None | |
| dict | error_codes |
| list | gain_idx = [] |
| list | gain_options = [] |
| height = yPixels.value | |
| bool | immediate_mode = False |
| integration_time_ms = ms | |
| int | last_battery_percentage = 0 |
| last_memory_check = datetime.now() | |
| message_queue = message_queue | |
| 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 | |
| dict | process_f = {} |
| int | remaining_throwaways = 0 |
Static Public Attributes | |
| 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) | |
Loads configuration from file self.config_file and populates self.settings.eeprom with members. | |
| _obtain_gain_info (self) | |
| _open_ex_shutter (self) | |
| _queue_message (self, setting, value) | |
| Private Methods. | |
| _take_one_averaged_reading (self) | |
Protected Attributes | |
| int | _scan_averaging = 1 |
This is the basic implementation of our interface with Andor cameras.
have check_result return a SpectrometerResponse
try to auto-detect whether x-axis needs inverted via DLL.GetImageFlip()
########################################################################## This class adopts the external device interface structure. This involves receiving a request through the handle_request function. A request is processed based on the key in the request. The processing function passes the commands to the requested device. Once it receives a response from the connected device it then passes that back up the chain.
Enlighten Request
|
handle_requests
|
-----------
| | | | |
{ get_laser status, acquire, set_laser_watchdog, etc....}
| | | | |
-----------
|
{self.driver.some_andor_sdk_call}
############################################################################
| wasatch.AndorDevice.AndorDevice.__init__ | ( | self, | |
| device_id, | |||
| message_queue = None, | |||
| alert_queue = None ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Loads configuration from file self.config_file and populates self.settings.eeprom with members.
|
protected |
|
protected |
|
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".
|
protected |
| wasatch.AndorDevice.AndorDevice.acquire_data | ( | self | ) |
| wasatch.AndorDevice.AndorDevice.check_result | ( | self, | |
| result, | |||
| func ) |
Public Methods.
| wasatch.AndorDevice.AndorDevice.connect | ( | self | ) |
| wasatch.AndorDevice.AndorDevice.get_detector_temperature_degC | ( | self | ) |
| wasatch.AndorDevice.AndorDevice.get_error_code | ( | self, | |
| code ) |
| wasatch.AndorDevice.AndorDevice.get_error_code_long | ( | self, | |
| code ) |
| wasatch.AndorDevice.AndorDevice.get_serial_number | ( | self | ) |
| wasatch.AndorDevice.AndorDevice.high_gain_mode_enable | ( | self, | |
| enabled ) |
| wasatch.AndorDevice.AndorDevice.init_detector_area | ( | self | ) |
| wasatch.AndorDevice.AndorDevice.init_detector_speed | ( | self | ) |
| wasatch.AndorDevice.AndorDevice.init_tec_setpoint | ( | self | ) |
| wasatch.AndorDevice.AndorDevice.load_error_codes | ( | self | ) |
| wasatch.AndorDevice.AndorDevice.not_implemented | ( | self | ) |
| 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.
| eeprom | if provided, overwrite current settings with those in the passed dict before writing to disk |
| wasatch.AndorDevice.AndorDevice.set_fan_enable | ( | self, | |
| x ) |
| wasatch.AndorDevice.AndorDevice.set_integration_time_ms | ( | self, | |
| ms ) |
| wasatch.AndorDevice.AndorDevice.set_scans_to_average | ( | self, | |
| value ) |
| wasatch.AndorDevice.AndorDevice.set_shutter_enable | ( | self, | |
| enable ) |
| wasatch.AndorDevice.AndorDevice.set_take_one_request | ( | self, | |
| tor ) |
| wasatch.AndorDevice.AndorDevice.set_tec_setpoint | ( | self, | |
| set_temp ) |
| 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.
| wasatch.AndorDevice.AndorDevice.toggle_tec | ( | self, | |
| toggle_state ) |
| 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.
|
protected |
| wasatch.AndorDevice.AndorDevice.alert_queue = alert_queue |
| int wasatch.AndorDevice.AndorDevice.boxcar_half_width = 0 |
| list wasatch.AndorDevice.AndorDevice.command_queue = [] |
| wasatch.AndorDevice.AndorDevice.config_dir = os.path.join(self._get_default_data_dir(), 'config') |
| wasatch.AndorDevice.AndorDevice.config_file = os.path.join(self.config_dir, self.serial + '.json') |
| dict wasatch.AndorDevice.AndorDevice.config_names_to_eeprom |
| wasatch.AndorDevice.AndorDevice.config_values |
| bool wasatch.AndorDevice.AndorDevice.connected = False |
| wasatch.AndorDevice.AndorDevice.dark = None |
| wasatch.AndorDevice.AndorDevice.device_id = device_id |
| bool wasatch.AndorDevice.AndorDevice.dll_fail = True |
| wasatch.AndorDevice.AndorDevice.driver = None |
| dict wasatch.AndorDevice.AndorDevice.error_codes |
| list wasatch.AndorDevice.AndorDevice.gain_idx = [] |
| list wasatch.AndorDevice.AndorDevice.gain_options = [] |
| wasatch.AndorDevice.AndorDevice.height = yPixels.value |
| bool wasatch.AndorDevice.AndorDevice.immediate_mode = False |
| wasatch.AndorDevice.AndorDevice.integration_time_ms = ms |
| int wasatch.AndorDevice.AndorDevice.last_battery_percentage = 0 |
| wasatch.AndorDevice.AndorDevice.last_memory_check = datetime.now() |
| wasatch.AndorDevice.AndorDevice.message_queue = message_queue |
| wasatch.AndorDevice.AndorDevice.pixels = xPixels.value |
| wasatch.AndorDevice.AndorDevice.process_id = os.getpid() |
| int wasatch.AndorDevice.AndorDevice.scan_count = 0 |
| str wasatch.AndorDevice.AndorDevice.serial = f"CCD-{sn.value}" |
| int wasatch.AndorDevice.AndorDevice.session_reading_count = 0 |
| wasatch.AndorDevice.AndorDevice.setpoint_deg_c = self.settings.eeprom.startup_temp_degC |
| wasatch.AndorDevice.AndorDevice.settings = SpectrometerSettings(self.device_id) |
|
static |
| wasatch.AndorDevice.AndorDevice.spec_index = 0 |
|
static |
| wasatch.AndorDevice.AndorDevice.sum_count = 0 |
| wasatch.AndorDevice.AndorDevice.summed_spectrum = None |
| wasatch.AndorDevice.AndorDevice.take_one_request = None |
| bool wasatch.AndorDevice.AndorDevice.tec_enabled = True |
|
static |
| wasatch.AndorDevice.AndorDevice.temperature_cache_timestamp = None |
| wasatch.AndorDevice.AndorDevice.temperature_cache_value = None |