fix(LamNI): stop double-printing the Xeye correction table
lamni_compute_additional_correction_xeye_mu() always printed its result. write_alignment_scan_numbers() called it once per angle just to grab the x-offset for the log file, which dumped all 12 corrections up front -- immediately followed by the exact same values reprinted one-by-one as tomo_alignment_scan() actually runs each angle. Add a verbose flag (default True) and pass verbose=False from the lookahead call.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user