Skip to content

Commit

Permalink
estimate collection time for static exposures
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Feb 6, 2025
1 parent 6eca8e4 commit cd2f652
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/specsscan/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,19 @@ def handle_meta(

dt_list_iso = [time.replace(".", "-").replace(" ", "T") for time in time_list]
datetime_list = [dt.datetime.fromisoformat(dt_iso) for dt_iso in dt_list_iso]
ts_from = dt.datetime.timestamp(datetime_list[0]) # POSIX timestamp
ts_to = dt.datetime.timestamp(datetime_list[-1]) # POSIX timestamp
ts_from = dt.datetime.timestamp(min(datetime_list)) # POSIX timestamp
ts_to = dt.datetime.timestamp(max(datetime_list)) # POSIX timestamp
if ts_from == ts_to:
try:
ts_to = (
ts_from
+ metadata["scan_info"]["Exposure"]
/ 1000
* metadata["scan_info"]["Averages"]
* metadata["scan_info"]["Repetitions"]
)
except KeyError:
pass
metadata["timing"] = {
"acquisition_start": dt.datetime.utcfromtimestamp(ts_from)
.replace(tzinfo=dt.timezone.utc)
Expand Down

0 comments on commit cd2f652

Please sign in to comment.