Skip to content

Commit

Permalink
fix xarray time warning (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarvoet authored Oct 12, 2023
1 parent 8e052b6 commit 70ab1d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion velosearaptor/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def yday0_to_datetime64(baseyear, yday):
base = datetime.datetime(baseyear, 1, 1, 0, 0, 0)
time = [base + datetime.timedelta(days=ti) for ti in yday]
# convert to numpy datetime64
time64 = np.array([np.datetime64(ti, "ms") for ti in time])
time64 = np.array([np.datetime64(ti, "ns") for ti in time])
return time64


Expand Down
2 changes: 1 addition & 1 deletion velosearaptor/madcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ def _ave2nc(self):
# generate time vector
base = datetime.datetime(dat.yearbase, 1, 1, 0, 0, 0)
time = [base + datetime.timedelta(days=ti) for ti in dat.dday]
adcptime = [np.datetime64(ti) for ti in time]
adcptime = [np.datetime64(ti, "ns") for ti in time]
# generate Dataset
out = xr.Dataset(
{"pg": (["depth", "time"], dat.pg.T)},
Expand Down

0 comments on commit 70ab1d0

Please sign in to comment.