From 0fe92c3efbfc9613c6175e763e2392322b2f1a96 Mon Sep 17 00:00:00 2001 From: x12sa Date: Wed, 8 Jul 2026 13:11:56 +0200 Subject: [PATCH] feat(flomni): skip feye_out in tomo_alignment_scan when scan-ready When the eye is already out, optics in, and feedback running, skip the eye-out/optics-in transition to avoid an interferometer reset. Enables repeated alignment scans and interleaving alignment into a tomogram without leaving the current measurement position. --- .../bec_ipython_client/plugins/flomni/flomni.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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