From 5899ba41fac548fe2315aeec007758186a4e2961 Mon Sep 17 00:00:00 2001 From: Iva Laginja Date: Mon, 22 Apr 2024 23:20:51 +0200 Subject: [PATCH] Handle exposure time in microseconds --- .../services/hamamatsu_camera/hamamatsu_camera.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/catkit2/services/hamamatsu_camera/hamamatsu_camera.py b/catkit2/services/hamamatsu_camera/hamamatsu_camera.py index 8d27f6268..8247d603d 100644 --- a/catkit2/services/hamamatsu_camera/hamamatsu_camera.py +++ b/catkit2/services/hamamatsu_camera/hamamatsu_camera.py @@ -129,7 +129,7 @@ def open(self): self.offset_y = offset_y self.gain = self.config.get('gain', 0) - self.exposure_time = self.config.get('exposure_time', 1) + self.exposure_time = self.config.get('exposure_time', 1000) self.temperature = self.make_data_stream('temperature', 'float64', [1], 20) # Create datastreams @@ -268,30 +268,30 @@ def get_temperature(self): @property def exposure_time(self): """ - The exposure time in seconds. + The exposure time in microseconds. This property can be used to get the exposure time of the camera. Returns: -------- float: - The exposure time in seconds. + The exposure time in microseconds. """ - return self.cam.prop_getvalue(dcam.DCAM_IDPROP.EXPOSURETIME) + return self.cam.prop_getvalue(dcam.DCAM_IDPROP.EXPOSURETIME) * 1e6 @exposure_time.setter def exposure_time(self, exposure_time: float): """ - Set the exposure time in seconds. + Set the exposure time in microseconds. This property can be used to set the exposure time of the camera. Parameters ---------- exposure_time : float - The exposure time in seconds. + The exposure time in microseconds. """ - self.cam.prop_setvalue(dcam.DCAM_IDPROP.EXPOSURETIME, exposure_time) + self.cam.prop_setvalue(dcam.DCAM_IDPROP.EXPOSURETIME, exposure_time / 1e6) @property def gain(self):