Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix_warnings' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Feb 3, 2025
2 parents 0372bd4 + d74b10a commit f1eb265
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/specsscan/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,8 @@ def handle_meta(
ts_from = dt.datetime.timestamp(datetime_list[0]) # POSIX timestamp
ts_to = dt.datetime.timestamp(datetime_list[-1]) # POSIX timestamp
metadata["timing"] = {
"acquisition_start": dt.datetime.fromtimestamp(ts_from, dt.timezone.utc)
.replace(tzinfo=dt.timezone.utc)
.isoformat(),
"acquisition_stop": dt.datetime.fromtimestamp(ts_to, dt.timezone.utc)
.replace(tzinfo=dt.timezone.utc)
.isoformat(),
"acquisition_start": dt.datetime.fromtimestamp(ts_from, dt.timezone.utc).isoformat(),
"acquisition_stop": dt.datetime.fromtimestamp(ts_to, dt.timezone.utc).isoformat(),
"acquisition_duration": int(ts_to - ts_from),
"collection_time": float(ts_to - ts_from),
}
Expand Down
12 changes: 10 additions & 2 deletions src/specsscan/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,16 @@ def get_archiver_data(
Returns:
tuple[np.ndarray, np.ndarray]: The extracted time stamps and corresponding data
"""
iso_from = datetime.datetime.fromtimestamp(ts_from, datetime.timezone.utc).isoformat()
iso_to = datetime.datetime.fromtimestamp(ts_to, datetime.timezone.utc).isoformat()
iso_from = (
datetime.datetime.fromtimestamp(ts_from, datetime.timezone.utc)
.replace(tzinfo=None)
.isoformat()
)
iso_to = (
datetime.datetime.fromtimestamp(ts_to, datetime.timezone.utc)
.replace(tzinfo=None)
.isoformat()
)
req_str = archiver_url + archiver_channel + "&from=" + iso_from + "Z&to=" + iso_to + "Z"
with urlopen(req_str) as req:
data = json.load(req)
Expand Down

0 comments on commit f1eb265

Please sign in to comment.