Skip to content

Commit

Permalink
Format code.
Browse files Browse the repository at this point in the history
  • Loading branch information
atrabattoni committed Sep 17, 2024
1 parent 2bde9ee commit 9421361
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xdas/io/terra15.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
from ..virtual import VirtualSource


def read(fname,tz=timezone.utc):
def read(fname, tz=timezone.utc):
with h5py.File(fname, "r") as file:
ti = np.datetime64(
datetime.fromtimestamp(file["data_product"]["gps_time"][0],tz=tz)
datetime.fromtimestamp(file["data_product"]["gps_time"][0], tz=tz)
).astype("datetime64[ms]")
tf = np.datetime64(
datetime.fromtimestamp(file["data_product"]["gps_time"][-1],tz=tz)
datetime.fromtimestamp(file["data_product"]["gps_time"][-1], tz=tz)
).astype("datetime64[ms]")
d0 = file.attrs["sensing_range_start"]
dx = file.attrs["dx"]
data = VirtualSource(file["data_product"]["data"])
nt, nd = data.shape
t = {"tie_indices": [0, nt - 1], "tie_values": [ti, tf]}
d = {"tie_indices": [0, nd - 1], "tie_values": [d0, d0 + (nd - 1) * dx]}
return DataArray(data, {"time": t, "distance": d})
return DataArray(data, {"time": t, "distance": d})

0 comments on commit 9421361

Please sign in to comment.