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

Commit b708f9b2 authored by Emmanuel Papillon's avatar Emmanuel Papillon

added scan_mode to ftimescan/fscan

parent 002e77af
......@@ -22,14 +22,8 @@ class ID11CameraCalib:
cam_time = self.calibrate_frelon(dev, acqtime, shuttime)
lat_time = 1e-4
elif camtype == "Eiger":
cam_time = 1e-7
# tests
# lat_time = ((acqtime // 25e-3) + 1) * 1e-6
# looks detector runs at about 300Hz in autosummation
lat_time = (acqtime // (1./300.)+1) * 1e-7
# round to 1e-6 (1MHz clock on musst)
lat_time = (1+int(lat_time/1e-6))*1e-6
#lat_time = 1e-6
cam_time = 1e-7 * (acqtime // (1./300.) + 1)
lat_time = 1e-6
else:
print("WARNING : software estimation of {dev.name} readout time !!")
cam_time = take_one_image(dev, acq_time)
......@@ -98,7 +92,7 @@ class ID11FTimeScan(FScanRunner):
pars = self.pars
# --- check minimum period
if pars.camera_mode != "MASTER":
if pars.scan_mode != "CAMERA":
limadevs = self._master.get_controllers_found("lima")
(readout_time, min_lat_time) = self._calib.calibrate(limadevs, pars.acq_time, self._fsh.shutter_time)
min_period = pars.acq_time + readout_time + min_lat_time
......@@ -108,8 +102,12 @@ class ID11FTimeScan(FScanRunner):
super().validate()
def __call__(self, acq_time, npoints, period=0., **kwargs):
pars = dict(acq_time=acq_time, npoints=npoints, period=period)
def __call__(self, acq_time, npoints, period=0., scan_mode="TIME", **kwargs):
pars = dict(acq_time=acq_time,
npoints=npoints,
period=period,
scan_mode=scan_mode,
)
pars.update(kwargs)
self.pars.set(**pars)
self.run()
......@@ -126,23 +124,27 @@ class ID11FScan(FScanDiagRunner):
# --- check minimum step_size
limadevs = self._master.get_controllers_found("lima")
(readout_time, min_lat_time) = self._calib.calibrate(limadevs, pars.acq_time, self._fsh.shutter_time)
if pars.latency_time < min_lat_time:
pars.latency_time = min_lat_time
min_step_time = pars.acq_time + readout_time + pars.latency_time
if pars.scan_mode != "CAMERA":
if pars.latency_time > min_lat_time:
min_step_time = pars.acq_time + readout_time + pars.latency_time
else:
min_step_time = pars.acq_time + readout_time + min_lat_time
else:
min_step_time = pars.acq_time + readout_time
if pars.step_time < min_step_time:
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):
def __call__(self, motor, start_pos, step_size, npoints, acq_time, scan_mode="TIME", **kwargs):
pars = dict(motor=motor,
start_pos=start_pos,
step_size=step_size,
npoints=npoints,
acq_time=acq_time,
step_time=0.,
scan_mode=scan_mode,
)
pars.update(kwargs)
self.pars.set(**pars)
......@@ -161,9 +163,9 @@ class ID11FScan2D(FScanDiagRunner):
limadevs = self._master.get_controllers_found("lima")
(readout_time, min_lat_time) = self._calib.calibrate(limadevs, pars.acq_time, self._fsh.shutter_time)
if pars.latency_time < min_lat_time:
pars.latency_time = min_lat_time
min_step_time = pars.acq_time + readout_time + pars.latency_time
min_step_time = pars.acq_time + readout_time + min_lat_time
else:
min_step_time = pars.acq_time + readout_time + pars.latency_time
if pars.fast_step_time < min_step_time:
pars.fast_step_time = min_step_time
......
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