better timing printout end of tomogram

This commit is contained in:
x12sa
2026-07-12 07:28:10 +02:00
committed by holler
co-authored by holler
parent 019693c5c8
commit 0facd37860
@@ -2680,9 +2680,22 @@ class Flomni(
self._print_progress()
self._log_tomogram_timing()
self.OMNYTools.printgreenbold("Tomoscan finished")
print(
f"Total measurement time lost to detected gaps: {self._format_duration(self.progress.get('accumulated_idle_time', 0.0))}"
)
idle_s = self.progress.get("accumulated_idle_time", 0.0)
start_str = self.progress.get("tomo_start_time")
elapsed_s = None
if start_str is not None:
try:
elapsed_s = (
datetime.datetime.now() - datetime.datetime.fromisoformat(start_str)
).total_seconds()
except (ValueError, TypeError):
elapsed_s = None
if elapsed_s is not None:
print(f"Total measurement time: {self._format_duration(elapsed_s)}")
print(
f"Total measurement time excluding detected gaps: {self._format_duration(elapsed_s - idle_s)}"
)
print(f"Total measurement time lost to detected gaps: {self._format_duration(idle_s)}")
def tomo_scan_resume(self) -> None:
"""Resume a tomo_scan() that crashed or was interrupted, picking up