feat(LamNI): invalidate X-ray-eye/fine alignment on a new rotation centre
Re-running rotation-center calibration after X-ray-eye alignment (or fine alignment) was already done left the stale fit/correction in place, silently calibrated around the old center. Record lamni_center_found_at and cascade-invalidate via the existing reset_xray_eye_correction()/reset_correction() whenever a new center is actually applied, in both find_rotation_center() and find_rotation_center_smear_experimental().
This commit is contained in:
@@ -961,6 +961,7 @@ class XrayEyeAlign:
|
||||
if answer in ("", "y", "yes"):
|
||||
dev.lsamx.update_user_parameter({"center": float(new_lsamx)})
|
||||
dev.lsamy.update_user_parameter({"center": float(new_lsamy)})
|
||||
self._mark_center_found_and_invalidate_downstream()
|
||||
print(
|
||||
f"[rotation-center][smear] lsamx.user_parameter['center'] = "
|
||||
f"{dev.lsamx.user_parameter.get('center')}, "
|
||||
@@ -1116,6 +1117,27 @@ class XrayEyeAlign:
|
||||
f"interferometer rtx/rty now read ({rtx_after:.2f}, {rty_after:.2f}) um"
|
||||
)
|
||||
|
||||
def _mark_center_found_and_invalidate_downstream(self):
|
||||
"""Record that the rotation centre was just (re-)established, and
|
||||
invalidate any X-ray-eye/fine-alignment state calibrated around the
|
||||
previous centre.
|
||||
|
||||
Called right after a new lsamx/lsamy centre is actually applied (by
|
||||
both find_rotation_center() and find_rotation_center_smear_experimental()).
|
||||
Reuses the LamNI alignment mixin's own reset methods rather than
|
||||
introducing separate invalidation logic -- see
|
||||
lamni.xrayeye_alignment_start()/tomo_alignment_scan()/tomo_scan(),
|
||||
which gate on lamni_center_found_at / tomo_fit_xray_eye / corr_pos_x
|
||||
respectively.
|
||||
"""
|
||||
import datetime
|
||||
|
||||
self.client.set_global_var(
|
||||
"lamni_center_found_at", datetime.datetime.now().isoformat()
|
||||
)
|
||||
self.lamni.reset_xray_eye_correction()
|
||||
self.lamni.reset_correction()
|
||||
|
||||
def find_rotation_center(
|
||||
self, sample_type: str = "isolated", keep_shutter_open: bool = False, apply: bool = True
|
||||
):
|
||||
@@ -1271,6 +1293,7 @@ class XrayEyeAlign:
|
||||
if answer in ("", "y", "yes"):
|
||||
dev.lsamx.update_user_parameter({"center": float(new_lsamx)})
|
||||
dev.lsamy.update_user_parameter({"center": float(new_lsamy)})
|
||||
self._mark_center_found_and_invalidate_downstream()
|
||||
print(
|
||||
f"[rotation-center] lsamx.user_parameter['center'] = "
|
||||
f"{dev.lsamx.user_parameter.get('center')}, "
|
||||
|
||||
Reference in New Issue
Block a user