diff --git a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py index f20f8bd..c584804 100644 --- a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py +++ b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni.py @@ -1183,7 +1183,7 @@ class LamNI(TomoQueueMixin, LamNIAlignmentMixin, LamNIOpticsMixin, LamniGuiTools x_vals = [] for angle in angles: - x, _y = self.lamni_compute_additional_correction_xeye_mu(angle) + x, _y = self.lamni_compute_additional_correction_xeye_mu(angle, verbose=False) x_vals.append(x) zeros = [0] * len(angles) diff --git a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_alignment_mixin.py b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_alignment_mixin.py index 03a1575..e404710 100644 --- a/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_alignment_mixin.py +++ b/csaxs_bec/bec_ipython_client/plugins/LamNI/lamni_alignment_mixin.py @@ -248,15 +248,24 @@ class LamNIAlignmentMixin: f" Y: A={fit[1][0]:.4f}, B={fit[1][1]:.4f}, C={fit[1][2]:.4f}" ) - def lamni_compute_additional_correction_xeye_mu(self, angle): + def lamni_compute_additional_correction_xeye_mu(self, angle, verbose: bool = True): """Evaluate the sinusoidal X-ray eye correction at *angle* degrees. + Args: + verbose: if True (default), print the computed correction. Pass + False for bulk/lookahead uses (e.g. write_alignment_scan_numbers()) + that just need the numbers and would otherwise print the same + values a second time, ahead of and redundant with the + per-projection print that happens when this is actually + applied during the scan. + Returns: tuple: ``(correction_x_mm, correction_y_mm)`` """ tomo_fit_xray_eye = self.client.get_global_var("tomo_fit_xray_eye") if tomo_fit_xray_eye is None: - print("Not applying any X-ray eye correction. No fit data available.") + if verbose: + print("Not applying any X-ray eye correction. No fit data available.") return (0, 0) correction_x = ( @@ -272,10 +281,11 @@ class LamNIAlignmentMixin: + tomo_fit_xray_eye[1][2] ) / 1000 - print( - f"Xeye correction x={correction_x:.6f} mm," - f" y={correction_y:.6f} mm @ angle={angle}" - ) + if verbose: + print( + f"Xeye correction x={correction_x:.6f} mm," + f" y={correction_y:.6f} mm @ angle={angle}" + ) return (correction_x, correction_y) # ------------------------------------------------------------------