Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/add_static_duration' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Feb 7, 2025
2 parents f1eb265 + cd2f652 commit 39f3ce9
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 @@ -420,8 +420,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.fromtimestamp(ts_from, dt.timezone.utc).isoformat(),
"acquisition_stop": dt.datetime.fromtimestamp(ts_to, dt.timezone.utc).isoformat(),
Expand Down

0 comments on commit 39f3ce9

Please sign in to comment.