9
9
10
10
from pyobs .interfaces import ICamera , ICameraWindow , ICameraBinning , ICooling
11
11
from pyobs .modules .camera .basecamera import BaseCamera
12
- from .flidriver import *
12
+ from pyobs .utils .enums import ExposureStatus
13
+ from pyobs_fli .flidriver import *
13
14
14
15
15
16
log = logging .getLogger (__name__ )
16
17
17
18
18
19
class FliCamera (BaseCamera , ICamera , ICameraWindow , ICameraBinning , ICooling ):
19
20
"""A pyobs module for FLI cameras."""
21
+ __module__ = 'pyobs_fli'
20
22
21
23
def __init__ (self , setpoint : float = - 20 , * args , ** kwargs ):
22
24
"""Initializes a new FliCamera.
@@ -147,7 +149,7 @@ def _expose(self, exposure_time: int, open_shutter: bool, abort_event: threading
147
149
self ._driver .set_window (self ._window [0 ], self ._window [1 ], width , height )
148
150
149
151
# set some stuff
150
- self ._change_exposure_status (ICamera . ExposureStatus .EXPOSING )
152
+ self ._change_exposure_status (ExposureStatus .EXPOSING )
151
153
self ._driver .init_exposure (open_shutter )
152
154
self ._driver .set_exposure_time (int (exposure_time ))
153
155
@@ -163,7 +165,7 @@ def _expose(self, exposure_time: int, open_shutter: bool, abort_event: threading
163
165
while True :
164
166
# aborted?
165
167
if abort_event .is_set ():
166
- self ._change_exposure_status (ICamera . ExposureStatus .IDLE )
168
+ self ._change_exposure_status (ExposureStatus .IDLE )
167
169
raise ValueError ('Aborted exposure.' )
168
170
169
171
# is exposure finished?
@@ -175,7 +177,7 @@ def _expose(self, exposure_time: int, open_shutter: bool, abort_event: threading
175
177
176
178
# readout
177
179
log .info ('Exposure finished, reading out...' )
178
- self ._change_exposure_status (ICamera . ExposureStatus .READOUT )
180
+ self ._change_exposure_status (ExposureStatus .READOUT )
179
181
width = int (math .floor (self ._window [2 ] / self ._binning [0 ]))
180
182
height = int (math .floor (self ._window [3 ] / self ._binning [1 ]))
181
183
img = np .zeros ((height , width ), dtype = np .uint16 )
@@ -212,7 +214,7 @@ def _expose(self, exposure_time: int, open_shutter: bool, abort_event: threading
212
214
213
215
# return FITS image
214
216
log .info ('Readout finished.' )
215
- self ._change_exposure_status (ICamera . ExposureStatus .IDLE )
217
+ self ._change_exposure_status (ExposureStatus .IDLE )
216
218
return hdu
217
219
218
220
def _abort_exposure (self ):
@@ -222,7 +224,7 @@ def _abort_exposure(self):
222
224
ValueError: If an error occured.
223
225
"""
224
226
self ._driver .cancel_exposure ()
225
- self ._camera_status = ICamera . ExposureStatus .IDLE
227
+ self ._camera_status = ExposureStatus .IDLE
226
228
227
229
def get_cooling_status (self , * args , ** kwargs ) -> Tuple [bool , float , float ]:
228
230
"""Returns the current status for the cooling.
0 commit comments