Commit 72065d9f authored by Jerome Carnis's avatar Jerome Carnis 🦊
Browse files

deviceEigerP11.py: fix parameter names in exposed methods

parent 656317ca
...@@ -130,13 +130,13 @@ class DeviceTangoEigerDetector(DeviceTango): ...@@ -130,13 +130,13 @@ class DeviceTangoEigerDetector(DeviceTango):
self.set_attribute(["EigerStream", "ImageAppendix", VALUE], path) self.set_attribute(["EigerStream", "ImageAppendix", VALUE], path)
@expose_method({"Name": "FilePrefix", "Exposure": "FrameTime", "Frames": "Nimages"}) @expose_method({"Name": "FilePrefix", "Exposure": "FrameTime", "Frames": "Nimages"})
def acquire_frame(self, Name, exposure, frames): def acquire_frame(self, Name, Exposure, Frames):
frames = int(self.to_device_unit("Nimages", frames).m) nb_frames = int(self.to_device_unit("Nimages", Frames).m)
self._config_interface( self._config_interface(
saving_directory="shotDir", prefix=Name, nb_frames=frames saving_directory="shotDir", prefix=Name, nb_frames=nb_frames
) )
exposure = float(self.to_device_unit("FrameTime", exposure).m) exposure = float(self.to_device_unit("FrameTime", Exposure).m)
# According to Jan 10ms is lowest frame time # According to Jan 10ms is lowest frame time
frame_time = 10e-3 if exposure < 10e-3 else exposure frame_time = 10e-3 if exposure < 10e-3 else exposure
...@@ -144,40 +144,43 @@ class DeviceTangoEigerDetector(DeviceTango): ...@@ -144,40 +144,43 @@ class DeviceTangoEigerDetector(DeviceTango):
self.set_attribute(["FrameTime", VALUE], frame_time) self.set_attribute(["FrameTime", VALUE], frame_time)
self.set_attribute(["CountTime", VALUE], exposure) self.set_attribute(["CountTime", VALUE], exposure)
self.set_attribute(["Ntrigger", VALUE], 1) self.set_attribute(["Ntrigger", VALUE], 1)
self.set_attribute(["Nimages", VALUE], frames) self.set_attribute(["Nimages", VALUE], nb_frames)
self.Arm() self.Arm()
self.Trigger() self.Trigger()
self.set_value(ATTR_FRAME_COUNT, self.get_value(ATTR_FRAME_COUNT) + frames) self.set_value(ATTR_FRAME_COUNT, self.get_value(ATTR_FRAME_COUNT) + nb_frames)
@expose_method({"Exposure": "FrameTime"}) @expose_method({"Exposure": "FrameTime"})
def live_view(self, exposure): def live_view(self, Exposure):
""" """
Live view of the Eiger detector. Live view of the Eiger detector.
This is useful when aligning the optics or the sample. Images will not be saved. This is useful when aligning the optics or the sample. Images will not be saved.
:param exposure: desired exposure time per frame :param Exposure: desired exposure time per frame
""" """
frames_per_file = 1000000
self.logger.info("Live view has started.") self.logger.info("Live view has started.")
self.set_attribute(["TriggerMode", VALUE], 3) self.set_attribute(["TriggerMode", VALUE], 3)
if self.file_writer is not None: if self.file_writer is not None:
self.logger.info("FileWriter disabled") self.logger.info("FileWriter disabled")
self.set_attribute(["FileWriter", "Mode", VALUE], 1) self.set_attribute(["FileWriter", "Mode", VALUE], 1)
self.set_attribute(["FileWriter", "NimagesPerFile", VALUE], 1000000) self.set_attribute(["FileWriter", "NimagesPerFile", VALUE], frames_per_file)
if self.eiger_stream is not None: if self.eiger_stream is not None:
self.logger.info("EigerStream disabled") self.logger.info("EigerStream disabled")
self.set_attribute(["EigerStream", "Mode", VALUE], 1) self.set_attribute(["EigerStream", "Mode", VALUE], 1)
exposure = float(self.to_device_unit("FrameTime", exposure).m) exposure = float(self.to_device_unit("FrameTime", Exposure).m)
# According to Jan Meyer 10ms is the lowest frame time # According to Jan Meyer 10ms is the lowest frame time
frame_time = 10e-3 if exposure < 10e-3 else exposure frame_time = 10e-3 if exposure < 10e-3 else exposure
self.set_attribute(["FrameTime", VALUE], frame_time) self.set_attribute(["FrameTime", VALUE], frame_time)
self.set_attribute(["CountTime", VALUE], exposure) self.set_attribute(["CountTime", VALUE], exposure)
self.set_attribute(["Ntrigger", VALUE], 1) self.set_attribute(["Ntrigger", VALUE], 1)
self.set_attribute(["Nimages", VALUE], 1000000) self.set_attribute(["Nimages", VALUE], frames_per_file)
self.Arm() self.Arm()
self.Trigger() self.Trigger()
self.set_value(ATTR_FRAME_COUNT, self.get_value(ATTR_FRAME_COUNT) + 1000000) self.set_value(
ATTR_FRAME_COUNT, self.get_value(ATTR_FRAME_COUNT) + frames_per_file
)
@expose_method() @expose_method()
def stop(self): def stop(self):
...@@ -242,11 +245,11 @@ class EigerTrigger(Device): ...@@ -242,11 +245,11 @@ class EigerTrigger(Device):
) )
@expose_method({"Exposure": ATTR_TRIGGER_PULSE_WIDTH, "Frames": ATTR_TRIGGERS_SP}) @expose_method({"Exposure": ATTR_TRIGGER_PULSE_WIDTH, "Frames": ATTR_TRIGGERS_SP})
def acquire_frame(self, exposure, frames): def acquire_frame(self, Exposure, Frames):
frames = self.to_device_unit(ATTR_TRIGGERS_SP, frames).m nb_frames = self.to_device_unit(ATTR_TRIGGERS_SP, Frames).m
exposure = self.to_device_unit(ATTR_TRIGGER_PULSE_WIDTH, exposure).m exposure_time = self.to_device_unit(ATTR_TRIGGER_PULSE_WIDTH, Exposure).m
self.set_value(ATTR_TRIGGERS_SP, frames) self.set_value(ATTR_TRIGGERS_SP, nb_frames)
self.set_value(ATTR_TRIGGER_PULSE_WIDTH, exposure) self.set_value(ATTR_TRIGGER_PULSE_WIDTH, exposure_time)
self.set_value(ATTR_TRIGGERS_GENERATED, 0) self.set_value(ATTR_TRIGGERS_GENERATED, 0)
Thread(target=self._acquisition_thread).start() Thread(target=self._acquisition_thread).start()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment