remove z movement in scan as piezo broken
CI for csaxs_bec / test (pull_request) Successful in 1m32s
CI for csaxs_bec / test (push) Successful in 1m40s

write z propagation to reconstruction file
This commit is contained in:
x12sa
2026-06-28 17:10:08 +02:00
parent a7ea5fcd28
commit 852f447d9e
2 changed files with 25 additions and 3 deletions
@@ -2142,13 +2142,17 @@ class Flomni(
return angle, subtomo_number
def tomo_reconstruct(self, base_path="~/data/raw/logs/reconstruction_queue"):
def tomo_reconstruct(
self, base_path="~/data/raw/logs/reconstruction_queue", probe_propagation: float | None = None
):
"""write the tomo reconstruct file for the reconstruction queue"""
bec = builtins.__dict__.get("bec")
self.reconstructor.write(
scan_list=self._current_scan_list,
next_scan_number=bec.queue.next_scan_number,
base_path=base_path,
probe_file_propagation=probe_propagation,
)
def _write_tomo_scan_number(self, scan_number: int, angle: float, subtomo_number: int) -> None:
@@ -2178,6 +2182,9 @@ class Flomni(
+ self.manual_shift_y
)
sum_offset_z = offsets[2]
#TODO this fix is while the tracker z is broken
probe_propagation = -sum_offset_z * 1e-6
sum_offset_z = 0
self._current_scan_list = []
@@ -2216,7 +2223,7 @@ class Flomni(
scans.flomni_fermat_scan(**scan_kwargs)
self.tomo_reconstruct()
self.tomo_reconstruct(probe_propagation=probe_propagation)
def tomo_acquire_at_angle(self, angle: float, frames_per_trigger: int | None = None):
"""
@@ -189,7 +189,13 @@ class PtychoReconstructor:
logger.warning("Failed to compare active account to system user.")
return False
def write(self, scan_list: list, next_scan_number: int, base_path: str = "~/data/raw/analysis/"):
def write(
self,
scan_list: list,
next_scan_number: int,
base_path: str = "~/data/raw/analysis/",
probe_file_propagation: float | None = None,
):
"""Write a reconstruction queue file for the given scan list.
Args:
@@ -198,6 +204,13 @@ class PtychoReconstructor:
next_scan_number (int): The current next scan number, used to
name the queue file.
base_path (str): Root path under which the queue folder lives.
probe_file_propagation (float, optional): Distance [m] by which the
reconstruction should numerically propagate the probe, used in
place of a physical sample z-move (e.g. when the z stage/piezo
is unavailable). Written as `p.probe_file_propagation` if given;
omitted entirely otherwise, matching the old reconstruction.mac
behavior of only writing this parameter when
progagateprobeinsteadofsample==1.
"""
if not self._accounts_match():
logger.warning("Active BEC account does not match system user — skipping queue file write.")
@@ -214,6 +227,8 @@ class PtychoReconstructor:
with open(queue_file, "w") as f:
scans = " ".join(str(s) for s in scan_list)
f.write(f"p.scan_number {scans}\n")
if probe_file_propagation is not None:
f.write(f"p.probe_file_propagation {probe_file_propagation:.6f}\n")
f.write("p.check_nextscan_started 1\n")