Skip to content

Commit

Permalink
Fix UTC datetime import for python 3.10 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
atrabattoni committed Sep 4, 2024
1 parent 009edab commit d888a0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xdas/io/terra15.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import UTC, datetime
from datetime import datetime, timezone

import h5py
import numpy as np
Expand All @@ -10,10 +10,10 @@
def read(fname):
with h5py.File(fname, "r") as file:
ti = np.datetime64(
datetime.fromtimestamp(file["data_product"]["gps_time"][0]), UTC
datetime.fromtimestamp(file["data_product"]["gps_time"][0]), timezone.utc
).astype("datetime64[ms]")
tf = np.datetime64(
datetime.fromtimestamp(file["data_product"]["gps_time"][-1]), UTC
datetime.fromtimestamp(file["data_product"]["gps_time"][-1]), timezone.utc
).astype("datetime64[ms]")
d0 = file.attrs["sensing_range_start"]
dx = file.attrs["dx"]
Expand Down

0 comments on commit d888a0c

Please sign in to comment.