diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py index faa2885..e988dff 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py @@ -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): """ diff --git a/csaxs_bec/bec_ipython_client/plugins/omny/omny_general_tools.py b/csaxs_bec/bec_ipython_client/plugins/omny/omny_general_tools.py index 8ee5c28..7821f1a 100644 --- a/csaxs_bec/bec_ipython_client/plugins/omny/omny_general_tools.py +++ b/csaxs_bec/bec_ipython_client/plugins/omny/omny_general_tools.py @@ -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")