MCPcopy Create free account
hub / github.com/LabPy/lantz / CCD

Class CCD

lantz/drivers/andor/ccd.py:122–1869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120
121
122class CCD(LibraryDriver):
123
124 LIBRARY_NAME = 'atmcd64d.dll'
125
126 def __init__(self, *args, **kwargs):
127 super().__init__(*args, **kwargs)
128 self.cameraIndex = ct.c_int(0)
129
130 def _patch_functions(self):
131 internal = self.lib.internal
132 internal.GetCameraSerialNumber.argtypes = [ct.pointer(ct.c_uint)]
133 internal.Filter_SetAveragingFactor.argtypes = [ct.c_int]
134 internal.Filter_SetThreshold.argtypes = ct.c_float
135 internal.Filter_GetThreshold.argtypes = ct.c_float
136
137 def _return_handler(self, func_name, ret_value):
138 excl_func = ['GetTemperatureF', 'IsCountConvertModeAvailable',
139 'IsAmplifierAvailable', 'IsTriggerModeAvailable']
140 if ret_value != 20002 and func_name not in excl_func:
141 raise InstrumentError('{}'.format(_ERRORS[ret_value]))
142 return ret_value
143
144 def initialize(self):
145 """ This function will initialize the Andor SDK System. As part of the
146 initialization procedure on some cameras (i.e. Classic, iStar and
147 earlier iXion) the DLL will need access to a DETECTOR.INI which
148 contains information relating to the detector head, number pixels,
149 readout speeds etc. If your system has multiple cameras then see the
150 section Controlling multiple cameras.
151 """
152 self.lib.Initialize()
153
154 self.triggers = {'Internal': 0, 'External': 1, 'External Start': 6,
155 'External Exposure': 7, 'External FVB EM': 9,
156 'Software Trigger': 10,
157 'External Charge Shifting': 12}
158 self.savetypes = {'Signed16bits': 1, 'Signed32bits': 2, 'Float': 3}
159
160 # Initial values
161
162 self.readout_packing_state = False
163 self.readout_packing = self.readout_packing_state
164
165 self.readout_mode_mode = 'Image'
166 self.readout_mode = self.readout_mode_mode
167
168 self.photon_counting_mode_state = False
169 self.photon_counting_mode = self.photon_counting_mode_state
170
171 self.frame_transfer_mode_state = False
172 self.frame_transfer_mode = self.frame_transfer_mode_state
173
174 self.fan_mode_index = 'onfull'
175 self.fan_mode = self.fan_mode_index
176
177 self.EM_gain_mode_index = 'RealGain'
178 self.EM_gain_mode = self.EM_gain_mode_index
179

Callers 1

ccd.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected