GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Commit c074097e authored by Emmanuel Papillon's avatar Emmanuel Papillon

ftimescan + fscan id11 implementation

parent 2d483140
import gevent
import time
from fscan.fscanrunner import FScanRunner
from fscan.fscanrunner import FScanRunner, FScanDiagRunner
class ID11CameraCalib:
......@@ -68,6 +68,7 @@ class ID11FTimeScan(FScanRunner):
def __init__(self, scanname, scanmaster, fshutter):
self._fsh = fshutter
self._calib = ID11CameraCalib()
self._min_latency_time = 1e-5
super().__init__(scanname, scanmaster)
def validate(self):
......@@ -76,17 +77,45 @@ class ID11FTimeScan(FScanRunner):
# --- check minimum period
limadevs = self._master.get_controllers_found("lima")
readout_time = self._calib.calibrate(limadevs, pars.acq_time, self._fsh.shutter_time)
min_period = pars.acq_time + readout_time + 1e-4
min_period = pars.acq_time + readout_time + self._latency_time
if pars.period < min_period:
pars.period = min_period
super().validate()
def __call__(self, acq_time, npoints, period=0., start_delay=0.):
def __call__(self, acq_time, npoints, period=0., **kwargs):
pars = dict(acq_time=acq_time, npoints=npoints, period=period)
pars.update(kwargs)
self.pars.set(**pars)
self.run()
class ID11FScan(FScanDiagRunner):
def __init__(self, scanname, scanmaster, fshutter):
self._fsh = fshutter
self._calib = ID11CameraCalib()
self._min_latency_time = 1e-5
super().__init__(scanname, scanmaster)
def validate(self):
pars = self.pars
pars.acq_time = acq_time
pars.npoints = npoints
pars.period = period
# --- check minimum step_size
limadevs = self._master.get_controllers_found("lima")
readout_time = self._calib.calibrate(limadevs, pars.acq_time, self._fsh.shutter_time)
if pars.latency_time < self._min_latency_time:
pars.latency_time = self._min_latency_time
min_step_time = pars.acq_time + readout_time + pars.latency_time
if pars.step_time < min_step_time:
pars.step_time = min_step_time
super().validate()
pars.step_time=0.
def __call__(self, motor, start_pos, step_size, npoints, acq_time, **kwargs):
pars = dict(motor=motor, start_pos=start_pos, step_size=step_size, npoints=npoints, acq_time=acq_time, step_time=0.)
pars.update(kwargs)
self.pars.set(**kwargs)
self.run()
Markdown is supported
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