From 1272170bdc82f4a6d1d749bbbaa0a197f1d150e9 Mon Sep 17 00:00:00 2001 From: x01dc Date: Tue, 28 Jul 2026 11:15:53 +0200 Subject: [PATCH] feat(devices): add FZP details user parameter to optics stages Adds a free-text "fzp_details" userParameter (default "manufacturing notes here") to the loptx/foptx/ofzpx optics-stage devices for LamNI, flomni and OMNY, alongside the existing fzp_diameter/ fzp_outermost_zone_width parameters, and prints it in each beamline's tomography-start PDF report. Co-Authored-By: Claude Sonnet 5 --- csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py | 5 +++++ csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py | 5 +++++ csaxs_bec/bec_ipython_client/plugins/omny/omny.py | 5 +++++ csaxs_bec/device_configs/ptycho_flomni.yaml | 1 + csaxs_bec/device_configs/ptycho_lamni.yaml | 1 + csaxs_bec/device_configs/ptycho_omny.yaml | 1 + .../device_configs/simulated_omny/simulated_flomni.yaml | 1 + csaxs_bec/device_configs/simulated_omny/simulated_lamni.yaml | 1 + csaxs_bec/device_configs/simulated_omny/simulated_omny.yaml | 1 + 9 files changed, 21 insertions(+) diff --git a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py index ff03247..81af541 100644 --- a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py +++ b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py @@ -2176,6 +2176,10 @@ class LamNI(TomoQueueMixin, LamNIAlignmentMixin, LamNIOpticsMixin, LamniGuiTools fzp_zone_width_nm = self._get_user_param_safe("loptx", "fzp_outermost_zone_width") except Exception: fzp_diameter_um = fzp_zone_width_nm = "N/A" + try: + fzp_details = self._get_user_param_safe("loptx", "fzp_details") + except Exception: + fzp_details = "N/A" # FZP focal distance: same formula as lfzp_info(), from the values # above and the current photon energy -- only this needs energy_kev. try: @@ -2220,6 +2224,7 @@ class LamNI(TomoQueueMixin, LamNIAlignmentMixin, LamNIOpticsMixin, LamniGuiTools f"{'Tomo type:':<{padding}}{self.tomo_type}\n", f"{'FZP diameter:':<{padding}}{fzp_diameter_um} microns\n", f"{'FZP outermost zone width:':<{padding}}{fzp_zone_width_nm} nm\n", + f"{'FZP details:':<{padding}}{fzp_details}\n", f"{'FZP focal distance:':<{padding}}{focal_distance_str} mm\n", f"{'FZP focus-to-sample distance:':<{padding}}{fzp_sample_distance_str} mm\n", f"{'Sample-to-detector distance:':<{padding}}{detector_distance_str} mm\n", diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py index 1471c24..34bb8ba 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py @@ -3807,6 +3807,10 @@ class Flomni( fzp_zone_width_nm = self._get_user_param_safe("foptx", "fzp_outermost_zone_width") except Exception: fzp_diameter_um = fzp_zone_width_nm = "N/A" + try: + fzp_details = self._get_user_param_safe("foptx", "fzp_details") + except Exception: + fzp_details = "N/A" # FZP focal distance: same formula as ffzp_info(), from the values # above and the current photon energy -- only this needs energy_kev. try: @@ -3849,6 +3853,7 @@ class Flomni( f"{'Angular step within sub-tomogram:':<{padding}}{self.tomo_angle_stepsize:.2f}\n", f"{'FZP diameter:':<{padding}}{fzp_diameter_um} microns\n", f"{'FZP outermost zone width:':<{padding}}{fzp_zone_width_nm} nm\n", + f"{'FZP details:':<{padding}}{fzp_details}\n", f"{'FZP focal distance:':<{padding}}{focal_distance_str} mm\n", f"{'FZP focus-to-sample distance:':<{padding}}{fzp_sample_distance_str} mm\n", f"{'Sample-to-detector distance:':<{padding}}{detector_distance_str} mm\n", diff --git a/csaxs_bec/bec_ipython_client/plugins/omny/omny.py b/csaxs_bec/bec_ipython_client/plugins/omny/omny.py index 68c49de..2a987d7 100644 --- a/csaxs_bec/bec_ipython_client/plugins/omny/omny.py +++ b/csaxs_bec/bec_ipython_client/plugins/omny/omny.py @@ -1456,6 +1456,10 @@ class OMNY( fovxy = f"{self.fovx:.2f}/{self.fovy:.2f}" stitching = f"{self.stitch_x:.2f}/{self.stitch_y:.2f}" dataset_id = str(self.client.queue.next_dataset_number) + try: + fzp_details = self._get_user_param_safe("ofzpx", "fzp_details") + except Exception: + fzp_details = "N/A" content = [ f"{'Sample Name:':<{padding}}{self.sample_name:>{padding}}\n", f"{'Measurement ID:':<{padding}}{str(self.tomo_id):>{padding}}\n", @@ -1472,6 +1476,7 @@ class OMNY( f"{'Stitching:':<{padding}}{stitching:>{padding}}\n", f"{'Number of individual sub-tomograms:':<{padding}}{8:>{padding}}\n", f"{'Angular step within sub-tomogram:':<{padding}}{self.tomo_angle_stepsize:>{padding}.2f}\n", + f"{'FZP details:':<{padding}}{fzp_details}\n", "Add current temperature and pressure status", ] content = "".join(content) diff --git a/csaxs_bec/device_configs/ptycho_flomni.yaml b/csaxs_bec/device_configs/ptycho_flomni.yaml index 69fe470..e0c9e66 100644 --- a/csaxs_bec/device_configs/ptycho_flomni.yaml +++ b/csaxs_bec/device_configs/ptycho_flomni.yaml @@ -94,6 +94,7 @@ foptx: fzp_diameter: 170 # microns fzp_outermost_zone_width: 60 # nm detector_distance: -1 # mm, sample-to-detector; unknown for now + fzp_details: "manufacturing notes here" # free-text FZP manufacturing notes deviceTags: - ptycho_flomni diff --git a/csaxs_bec/device_configs/ptycho_lamni.yaml b/csaxs_bec/device_configs/ptycho_lamni.yaml index 2ca412d..807b127 100644 --- a/csaxs_bec/device_configs/ptycho_lamni.yaml +++ b/csaxs_bec/device_configs/ptycho_lamni.yaml @@ -66,6 +66,7 @@ loptx: fzp_diameter: 170 # microns fzp_outermost_zone_width: 60 # nm detector_distance: -1 # mm, sample-to-detector; unknown for now + fzp_details: "manufacturing notes here" # free-text FZP manufacturing notes deviceTags: - ptycho_lamni lopty: diff --git a/csaxs_bec/device_configs/ptycho_omny.yaml b/csaxs_bec/device_configs/ptycho_omny.yaml index 03edf18..9580b7b 100755 --- a/csaxs_bec/device_configs/ptycho_omny.yaml +++ b/csaxs_bec/device_configs/ptycho_omny.yaml @@ -216,6 +216,7 @@ ofzpx: connectionTimeout: 20 userParameter: in: -0.4317 + fzp_details: "manufacturing notes here" # free-text FZP manufacturing notes deviceTags: - ptycho_omny ofzpy: diff --git a/csaxs_bec/device_configs/simulated_omny/simulated_flomni.yaml b/csaxs_bec/device_configs/simulated_omny/simulated_flomni.yaml index 32b7db8..97dd2f9 100644 --- a/csaxs_bec/device_configs/simulated_omny/simulated_flomni.yaml +++ b/csaxs_bec/device_configs/simulated_omny/simulated_flomni.yaml @@ -133,6 +133,7 @@ foptx: fzp_diameter: 170 # microns fzp_outermost_zone_width: 60 # nm detector_distance: -1 # mm, sample-to-detector; unknown for now + fzp_details: "manufacturing notes here" # free-text FZP manufacturing notes deviceTags: - simulated_flomni diff --git a/csaxs_bec/device_configs/simulated_omny/simulated_lamni.yaml b/csaxs_bec/device_configs/simulated_omny/simulated_lamni.yaml index ab07a1e..b8ffe91 100644 --- a/csaxs_bec/device_configs/simulated_omny/simulated_lamni.yaml +++ b/csaxs_bec/device_configs/simulated_omny/simulated_lamni.yaml @@ -78,6 +78,7 @@ loptx: fzp_diameter: 170 # microns fzp_outermost_zone_width: 60 # nm detector_distance: -1 # mm, sample-to-detector; unknown for now + fzp_details: "manufacturing notes here" # free-text FZP manufacturing notes deviceTags: - simulated_lamni lopty: diff --git a/csaxs_bec/device_configs/simulated_omny/simulated_omny.yaml b/csaxs_bec/device_configs/simulated_omny/simulated_omny.yaml index 8c38760..aaa710a 100644 --- a/csaxs_bec/device_configs/simulated_omny/simulated_omny.yaml +++ b/csaxs_bec/device_configs/simulated_omny/simulated_omny.yaml @@ -171,6 +171,7 @@ ofzpx: connectionTimeout: 20 userParameter: in: -0.4317 + fzp_details: "manufacturing notes here" # free-text FZP manufacturing notes deviceTags: - simulated_omny ofzpy: