Commit 695530b1 authored by bliss administrator's avatar bliss administrator
Browse files

change/restore vel only when necessary to save some time (up to 600ms per scan ...)

parent cbbedad3
......@@ -354,6 +354,8 @@ class ID26FScanController:
f"FSCAN: move to {energy_end} keV would exceed high limit on {self.mono.name} ({self.mono.limits[1]} deg.)"
)
if abs(self.energy.position-energy_start)>self.energy.tolerance:
with cleanup (self.mono, restore_list=(cleanup_axis.VEL,)):
self.mono.velocity = self.fscan_par["mono_move_back_speed_steps"] / self.mono.steps_per_unit
self.energy.move(energy_start, wait=False)
......@@ -1169,6 +1171,7 @@ class ID26FScanController:
self.energy.sync_hard()
#MCL 20210325 - that takes about 160ms
if self.fscan_par['mono_move_back'] == 0 or not self.event_trajectory_started.is_set() or self.event_runtime_error.is_set():
self.mono.velocity = self.mono.config_velocity
#MCL 20210325 - that s only for u35a variable speed trajectories
......
......@@ -102,8 +102,6 @@ def fscan(
if FSCAN_PAR["id_linked"] == 2:
FSCAN_PAR["id_sync"] = 0
with cleanup (FSCAN.mono, restore_list=(cleanup_axis.VEL,)):
log_debug(
FSCAN,
"mono is {0}".format(FSCAN.mono.state)
......
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