feat(lamni): print the base shift in tomo_scan_projection
CI for csaxs_bec / test (push) Successful in 3m5s
CI for csaxs_bec / test (push) Successful in 3m5s
Next to the X-ray eye correction and the constant shift, also print the base shift (tomo_fovx/y_offset, from center finding / first X-ray eye click) at 0 deg and rotated to the projection angle, as applied by lamni_fermat_scan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LJWYXx4SS8NgFWog81xjyf
This commit is contained in:
1 parent
0051130b74
commit
9740c32f6e
2 files changed
+25
No files matched your search
@@ -32,6 +32,7 @@ from csaxs_bec.bec_ipython_client.plugins.OMNY_shared.tomo_angle_file_mixin impo
|
||||
TomoAngleFileMixin,
|
||||
)
|
||||
from csaxs_bec.bec_ipython_client.plugins.OMNY_shared.tomo_queue_mixin import TomoQueueMixin
|
||||
from csaxs_bec.scans.lamni_components import LamNIComponents
|
||||
|
||||
from .lamni_optics_mixin import LaMNIInitStages, LamNIOpticsMixin
|
||||
from .x_ray_eye_align import XrayEyeAlign as XrayEyeAlignGUI
|
||||
@@ -1410,6 +1411,15 @@ class LamNI(
|
||||
additional_correction = self.compute_additional_correction(angle)
|
||||
additional_correction_2 = self.compute_additional_correction_2(angle)
|
||||
correction_xeye_mu = self.lamni_compute_additional_correction_xeye_mu(angle)
|
||||
# base shift (center finding / first X-ray eye click), rotated to this
|
||||
# angle by lamni_fermat_scan via center_x/center_y
|
||||
base_x, base_y = LamNIComponents.lamni_compute_scan_center(
|
||||
self.tomo_fovx_offset, self.tomo_fovy_offset, angle
|
||||
)
|
||||
print(
|
||||
f"Base shift: x={self.tomo_fovx_offset:.6f} mm, y={self.tomo_fovy_offset:.6f} mm"
|
||||
f" at 0 deg -> x={base_x:.6f} mm, y={base_y:.6f} mm @ angle={angle}"
|
||||
)
|
||||
print(f"Constant shift: x={self.manual_shift_x}, y={self.manual_shift_y}")
|
||||
|
||||
self._current_scan_list = []
|
||||
|
||||
@@ -428,6 +428,21 @@ def test_tomo_scan_projection_reconstructs_once_per_projection_not_per_tile(proj
|
||||
assert projection_env.reconstruct_calls == [1]
|
||||
|
||||
|
||||
def test_tomo_scan_projection_prints_base_shift(projection_env, capsys):
|
||||
from csaxs_bec.scans.lamni_components import LamNIComponents
|
||||
|
||||
# stored in um (X-ray eye shift_xy); tomo_fovx/y_offset return mm
|
||||
projection_env.client.set_global_var("tomo_fov_offset", [100.0, 200.0])
|
||||
projection_env.tomo_scan_projection(30.0, _internal=True)
|
||||
|
||||
rot_x, rot_y = LamNIComponents.lamni_compute_scan_center(0.1, 0.2, 30.0)
|
||||
out = capsys.readouterr().out
|
||||
assert (
|
||||
f"Base shift: x=0.100000 mm, y=0.200000 mm at 0 deg -> "
|
||||
f"x={rot_x:.6f} mm, y={rot_y:.6f} mm @ angle=30.0"
|
||||
) in out
|
||||
|
||||
|
||||
def test_tomo_scan_projection_can_skip_reconstruction(projection_env):
|
||||
projection_env.tomo_scan_projection(30.0, _internal=True, _reconstruct=False)
|
||||
|
||||
|
||||
Reference in new issue
Block a user