From b60ec2927ade1a66643bdae1444b061ba9cf786a Mon Sep 17 00:00:00 2001 From: x12sa Date: Wed, 18 Mar 2026 15:36:45 +0100 Subject: [PATCH] minor fixes during testing --- .../bec_ipython_client/plugins/flomni/flomni.py | 17 ++++++++++------- .../plugins/flomni/flomni_optics_mixin.py | 2 -- .../plugins/flomni/x_ray_eye_align.py | 2 ++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py index 72e3bcb..f36a346 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py @@ -778,7 +778,9 @@ class FlomniSampleTransferMixin: dev.ftransy.controller.socket_put_confirmed("confirm=1") else: print("Stopping.") - exit + raise FlomniError( + "User abort sample transfer." + ) def ftransfer_gripper_is_open(self) -> bool: status = bool(float(dev.ftransy.controller.socket_put_and_receive("MG @OUT[9]").strip())) @@ -801,7 +803,8 @@ class FlomniSampleTransferMixin: def ftransfer_gripper_move(self, position: int): self.check_position_is_valid(position) - self._ftransfer_shiftx = -0.2 + #this is not used for sample stage position! + self._ftransfer_shiftx = -0.15 self._ftransfer_shiftz = -0.5 fsamx_pos = dev.fsamx.readback.get() @@ -821,7 +824,7 @@ class FlomniSampleTransferMixin: self.check_tray_in() if position == 0: - umv(dev.ftransx, 10.715 + 0.2, dev.ftransz, 3.5950) + umv(dev.ftransx, 11, dev.ftransz, 3.5950) if position == 1: umv( dev.ftransx, @@ -1537,7 +1540,7 @@ class Flomni( umv(dev.fsamroy, 0) self.OMNYTools.printgreenbold( - "\n\nAlignment scan finished. Please run SPEC_ptycho_align and load the new fit." + "\n\nAlignment scan finished. Please run SPEC_ptycho_align and load the new fit by flomni.read_alignment_offset() ." ) def _write_subtomo_to_scilog(self, subtomo_number): @@ -1713,9 +1716,9 @@ class Flomni( ) if self.OMNYTools.yesno("Shall I continue?", "n"): print("OK") - else: - print("Stopping.") - return + else: + print("Stopping.") + return self.flomnigui_show_progress() diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_optics_mixin.py b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_optics_mixin.py index 17716a9..4e9e688 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_optics_mixin.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni_optics_mixin.py @@ -50,8 +50,6 @@ class FlomniOpticsMixin: # move both axes to the desired "in" positions umv(dev.feyex, feyex_in, dev.feyey, feyey_in) - self.xrayeye_update_frame() - def _ffzp_in(self): foptx_in = self._get_user_param_safe("foptx", "in") fopty_in = self._get_user_param_safe("fopty", "in") diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py b/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py index 0de7b6c..e1fc704 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/x_ray_eye_align.py @@ -253,6 +253,8 @@ class XrayEyeAlign: umv(dev.rtx, 0) print("You are ready to remove the xray eye and start ptychography scans.") + print("Fine alignment: flomni.tomo_parameters() , then flomni.tomo_alignment_scan()") + print("After that, run the fit in Matlab and load the new fit flomni.read_alignment_offset()") def write_output(self): file = os.path.expanduser("~/Data10/specES1/internal/xrayeye_alignmentvalues")