diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py index 53eb95d..379af32 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py @@ -2156,7 +2156,22 @@ class Flomni( dev = builtins.__dict__.get("dev") bec = builtins.__dict__.get("bec") - self.feye_out() + # Only run the full eye-out / optics-in transition if we are not + # already in measurement condition with feedback running. That + # transition disables and re-enables-with-reset the rt feedback, which + # re-zeros the interferometers and moves us away from the current + # sample position. Skipping it when unnecessary lets us repeat + # alignment scans (e.g. after changing scan parameters) or interleave + # an alignment run into a tomogram while staying right where the last + # measurement was. + feedback_running = dev.rtx.controller.feedback_is_running() + if self._check_eye_out_and_optics_in() and feedback_running: + print( + "Setup already in measurement condition with feedback running; " + "skipping feye_out() to avoid an interferometer reset." + ) + else: + self.feye_out() tags = ["BEC_alignment_tomo", self.sample_name] self.write_alignment_scan_numbers(bec.queue.next_scan_number) start_angle = 0