Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove grid variable and attrs in dfmt.open_dataset_delft3d4() #826

Closed
MPWeeber opened this issue Apr 18, 2024 · 0 comments · Fixed by #844
Closed

remove grid variable and attrs in dfmt.open_dataset_delft3d4() #826

MPWeeber opened this issue Apr 18, 2024 · 0 comments · Fixed by #844

Comments

@MPWeeber
Copy link

When opening a delft3d4 netcdf with dfmt.open_dataset_delft3d4(), the grid variable is not removed. When writing this uds to a netcdf file with uds.ugrid.to_netcdf() the resulting file cannot be opened by quickplot. When removing the variable, quickplot still warns about grid attrs being present in data variables. These should also be removed:

file_nc = "trim-Model-k01-with topography-eco.nc"
uds = dfmt.open_dataset_delft3d4(file_nc)

uds = uds.drop_vars(["MFTAVG","MORAVG","grid"])

#write
uds.ugrid.to_netcdf("test2.nc")
# results in QP conflicting file

#workaround (do for all variables)
ds = uds.ugrid.to_dataset()
del ds["RSEDEQ"].attrs["grid"]
print(ds["RSEDEQ"])
ds.to_netcdf("netcdf/file/nc")

QP warnings:

---------
Cannot find mesh "grid"; ignoring mesh/location attributes on "RHO".
---------
Cannot find mesh "grid"; ignoring mesh/location attributes on "VICUV".
---------
Cannot find mesh "grid"; ignoring mesh/location attributes on "WS".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant