From c557eb22d6682dfd288e75e6cc912d2b9257fee1 Mon Sep 17 00:00:00 2001 From: x01dc Date: Thu, 1 Oct 2026 16:38:06 +0200 Subject: [PATCH] feat(lamni): add 30nm zone-plate table to lfzp_info(), matching flomni lfzp_info() only showed a 60nm outermost-zone-width table; flomni's ffzp_info() has always had both a 60nm and a 30nm table. Since the zone plate now mounted in LamNI is the same one mounted in Flomni, add the matching 30nm table (diameters 140/170/200/250um, from ffzp_info()) and relabel the 60nm table's title to match flomni's "Outermost zone width NN nm" convention, so the two tables read consistently side by side. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug --- .../plugins/LamNI/lamni_optics_mixin.py | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_optics_mixin.py b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_optics_mixin.py index 10915a20..d2dee00b 100644 --- a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_optics_mixin.py +++ b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_optics_mixin.py @@ -537,19 +537,18 @@ class LamNIOpticsMixin: distance = -loptz_val + 85.6 + 52 print(f"The sample is in a distance of {distance:.1f} mm from the FZP.") + print(f"At the current energy of {mokev_val:.4f} keV we have following options:\n") + + wavelength = 1.2398e-9 / mokev_val + diameters = [80e-6, 100e-6, 120e-6, 150e-6, 170e-6, 200e-6, 220e-6, 250e-6] console = Console() - table = Table( - title=f"At the current energy of {mokev_val:.4f} keV we have following options:", - box=box.SQUARE, - ) + table = Table(title="Outermost zone width \033[1m60 nm\033[0m", box=box.SQUARE) table.add_column("Diameter", justify="center") table.add_column("Focal distance", justify="center") table.add_column("Current beam size", justify="center") - wavelength = 1.2398e-9 / mokev_val - for diameter in diameters: outermost_zonewidth = 60e-9 focal_distance = diameter * outermost_zonewidth / wavelength @@ -562,6 +561,31 @@ class LamNIOpticsMixin: f"{beam_size:.2f} microns", ) + console.print(table) + + # Outermost zone width 30 nm -- diameters match flomni's 30nm FZP + # (ffzp_info(), flomni_optics_mixin.py) now that the zone plate + # mounted in LamNI is the same one mounted in Flomni. + diameters = [140e-6, 170e-6, 200e-6, 250e-6] + + console = Console() + table = Table(title="Outermost zone width \033[1m30 nm\033[0m", box=box.SQUARE) + table.add_column("Diameter", justify="center") + table.add_column("Focal distance", justify="center") + table.add_column("Current beam size", justify="center") + + for diameter in diameters: + outermost_zonewidth = 30e-9 + focal_distance = diameter * outermost_zonewidth / wavelength + beam_size = ( + -diameter / (focal_distance * 1000) * (focal_distance * 1000 - distance) * 1e6 + ) + table.add_row( + f"{diameter*1e6:.2f} microns", + f"{focal_distance*1000:.2f} mm", + f"{beam_size:.2f} microns", + ) + console.print(table) print( "The numbers presented here are for a sample in the plane of the lamni sample holder.\n"