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

deviceEigerP11.py: fix parameter names in exposed methods

parent 656317ca
Pipeline #28369 passed with stages
in 8 minutes and 33 seconds
......@@ -130,13 +130,13 @@ class DeviceTangoEigerDetector(DeviceTango):
self.set_attribute(["EigerStream", "ImageAppendix", VALUE], path)
@expose_method({"Name": "FilePrefix", "Exposure": "FrameTime", "Frames": "Nimages"})
def acquire_frame(self, Name, exposure, frames):
frames = int(self.to_device_unit("Nimages", frames).m)
def acquire_frame(self, Name, Exposure, Frames):
nb_frames = int(self.to_device_unit("Nimages", Frames).m)
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
frame_time = 10e-3 if exposure < 10e-3 else exposure
......@@ -144,40 +144,43 @@ class DeviceTangoEigerDetector(DeviceTango):
self.set_attribute(["FrameTime", VALUE], frame_time)
self.set_attribute(["CountTime", VALUE], exposure)
self.set_attribute(["Ntrigger", VALUE], 1)
self.set_attribute(["Nimages", VALUE], frames)
self.set_attribute(["Nimages", VALUE], nb_frames)
self.Arm()
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"})
def live_view(self, exposure):
def live_view(self, Exposure):
"""
Live view of the Eiger detector.
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.set_attribute(["TriggerMode", VALUE], 3)
if self.file_writer is not None:
self.logger.info("FileWriter disabled")
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:
self.logger.info("EigerStream disabled")
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
frame_time = 10e-3 if exposure < 10e-3 else exposure
self.set_attribute(["FrameTime", VALUE], frame_time)
self.set_attribute(["CountTime", VALUE], exposure)
self.set_attribute(["Ntrigger", VALUE], 1)
self.set_attribute(["Nimages", VALUE], 1000000)
self.set_attribute(["Nimages", VALUE], frames_per_file)
self.Arm()
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()
def stop(self):
......@@ -242,11 +245,11 @@ class EigerTrigger(Device):
)
@expose_method({"Exposure": ATTR_TRIGGER_PULSE_WIDTH, "Frames": ATTR_TRIGGERS_SP})
def acquire_frame(self, exposure, frames):
frames = self.to_device_unit(ATTR_TRIGGERS_SP, frames).m
exposure = self.to_device_unit(ATTR_TRIGGER_PULSE_WIDTH, exposure).m
self.set_value(ATTR_TRIGGERS_SP, frames)
self.set_value(ATTR_TRIGGER_PULSE_WIDTH, exposure)
def acquire_frame(self, Exposure, Frames):
nb_frames = self.to_device_unit(ATTR_TRIGGERS_SP, Frames).m
exposure_time = self.to_device_unit(ATTR_TRIGGER_PULSE_WIDTH, Exposure).m
self.set_value(ATTR_TRIGGERS_SP, nb_frames)
self.set_value(ATTR_TRIGGER_PULSE_WIDTH, exposure_time)
self.set_value(ATTR_TRIGGERS_GENERATED, 0)
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