Skip to content

Commit

Permalink
schism: Update handling of time for schism 5.12
Browse files Browse the repository at this point in the history
  • Loading branch information
pmav99 committed Aug 2, 2024
1 parent e677ace commit 4bd26e2
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pyposeidon/schism.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,9 +1335,6 @@ def results(self, **kwargs):
# fix fortran/python index
x2d["SCHISM_hgrid_face_nodes"][:, :3] = x2d["SCHISM_hgrid_face_nodes"].values[:, :3] - 1
# set time to Datetime
times = pd.to_datetime(x2d.time.values, unit="s", origin=sdate.tz_convert(None))

x2d = x2d.assign_coords({"time": ("time", times, x2d.time.attrs)})

logger.info("get combined 3D netcdf files \n")

Expand All @@ -1349,7 +1346,6 @@ def results(self, **kwargs):
# read
x3d = xr.open_mfdataset(xfiles, data_vars="minimal")
# set time to Datetime
x3d = x3d.assign_coords({"time": ("time", times, x3d.time.attrs)})
x3d.to_netcdf(os.path.join(path, "outputs/schout_2.nc"))

# save 2D variables to file
Expand Down

0 comments on commit 4bd26e2

Please sign in to comment.