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

save slp to netcdf #215

Open
fipoucat opened this issue Aug 21, 2023 · 4 comments
Open

save slp to netcdf #215

fipoucat opened this issue Aug 21, 2023 · 4 comments

Comments

@fipoucat
Copy link

I extracted slp from wrf output using wrf-python. I can print the output but want to save it in a netcdf file.
I wonder how to do it within wrf-python?

@SarahRoffe
Copy link

I am in the same boat. @fipoucat, have you been able to save a netcdf file using wrf-python?

@fipoucat
Copy link
Author

Still did not find a solution, hope someone will helP

@leonardojimenez1990
Copy link

leonardojimenez1990 commented Jan 24, 2024 via email

@DWesl
Copy link
Contributor

DWesl commented Jul 19, 2024

I suspect they are running into encoding errors when they try: one would need to delete the variables with non-numeric data.

Mostly this means the coordinates in which wrf-python stores the Cartopy, Basemap, or Proj representation of the geospatial map projection. One might be able to ask the object for a string to save as a coordinate or a dictionary one could save as attributes of a variable so one could re-create the projection later.

EDIT:
That is what you are saying, and the suggestion is the function from this comment, though without formatting due to being sent as an email.
The important bit is ds.attrs["projection"] = str(ds.attrs["projection"])

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

No branches or pull requests

4 participants