feat(flomni): log projection timing from direct tomo_scan_projection calls

This commit is contained in:
x12sa
2026-07-12 07:28:10 +02:00
committed by holler
co-authored by holler
parent 0fe92c3efb
commit eef4e84bc9
@@ -3045,7 +3045,7 @@ class Flomni(
lines = []
if comment:
lines.append(f"Comment: {comment}")
lines.append(f"{comment}")
if records:
if comment:
@@ -3056,7 +3056,7 @@ class Flomni(
f"(only {len(records)} of {number_of_scans} requested were found):"
)
else:
lines.append(f"flOMNI summary of the last {len(records)} scan(s):")
lines.append(f"flOMNI parameters:")
lines.append("")
for rec in records:
start = rec.get("start_scan_number")
@@ -3141,6 +3141,8 @@ class Flomni(
self._current_scan_list = []
start_scan_number = bec.queue.next_scan_number
projection_start = time.perf_counter()
for stitch_x in range(-self.stitch_x, self.stitch_x + 1):
for stitch_y in range(-self.stitch_y, self.stitch_y + 1):
# pylint: disable=undefined-variable
@@ -3176,6 +3178,21 @@ class Flomni(
scans.flomni_fermat_scan(**scan_kwargs)
projection_duration = time.perf_counter() - projection_start
end_scan_number = bec.queue.next_scan_number
# Internal callers (_at_each_angle, tomo_alignment_scan) run inside a
# flow that already logs projection timing in _tomo_scan_at_angle, so
# only log here for direct CLI calls (e.g. commissioning) to avoid a
# duplicate record per projection.
if not _internal:
self._log_projection_timing(
angle=angle,
subtomo_number=0,
duration_s=projection_duration,
start_scan_number=start_scan_number,
end_scan_number=end_scan_number,
)
self.tomo_reconstruct(probe_propagation=probe_propagation)
def tomo_acquire_at_angle(self, angle: float, frames_per_trigger: int | None = None):