-
Notifications
You must be signed in to change notification settings - Fork 421
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
pyproj output not acceptd by metpy #1844
Comments
This definitely looks like a bug in the metadata mapping. |
Thanks for the detailed run down and example code. That error is because the conversion from PyProj to CF is giving us a value of 0 for The problem with the |
I think there's still something to be done about the stereographic projection here, since it's not at all clear that Polar Stereographic (style-B) requires a latitude of the origin. |
Background: I want to add projection attributes to netcdf archive files. The projection specification is non-standard ( AWIPS/GFE). I thought
pyproj
would allow me to do it programatically, so far I found a couple of issues.I am not sure thoose are bugs in metpy, one could argue that pyproj should be fixed instead.
the expected output is a better solution.
I would expect
pyproj
CF output to be accepted bymetpy.assign_crs()
. The relevant logic in in /metpy/plot/mapping.py, propertycartopy_globe
. I don't understand the comment there, WGS84 definition have specific minor and major axes, with different size (I would force ellipsoid to be a sphere when the given axes are the same).This can be overcome by adding
earth_radius
to the input dictionary, as shown by the commented out lines. However that leads to another issue:crs3.proj4_params
evaluate toThe value of
lat_0
is lost. This is caused by missing latitude of projection centre in the CF listing. It seems thatpyproj
determines tis parameter based onlat_ts
- that's why the assertioncrs2.to_proj4() == crs.to_proj4()
succeedes.Fedora 33
python --version
Python 3.9.2
python -c 'import metpy; print(metpy.__version__)'
1.0.1
python -c 'import pyproj; print(pyproj.__version__)'
3.0.1
The text was updated successfully, but these errors were encountered: