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

Is it possible to get PROJ parameters #77

Open
djhoese opened this issue Apr 24, 2019 · 3 comments
Open

Is it possible to get PROJ parameters #77

djhoese opened this issue Apr 24, 2019 · 3 comments
Labels
enhancement New feature or request prioriy - low Low priority issue

Comments

@djhoese
Copy link

djhoese commented Apr 24, 2019

I'm coming from using pygrib where there was a .projparams dictionary of (mostly) PROJ.4 compatible projection parameters. Does anything like this exist with cfgrib? If not, is it planned? Desired?

Xarray currently supports reading in rasterio files where it sets a "crs" attribute in the DataArray/Dataset. There has also been discussion by me and a couple others to find the best way to make a "crs" coordinate that is more useful.

For cfgrib though, I'd like to at least get access to some of the projection parameters as-is in the grib file, but initial checks by @katherinekolman with the NCEP files we want to read make it look like some are missing.

Any help is much appreciated.

@alexamici alexamici added the enhancement New feature or request label Apr 25, 2019
@alexamici alexamici added the prioriy - low Low priority issue label Dec 5, 2019
@alexamici
Copy link
Contributor

@djhoese sorry I didn't notice the last question of the issue. It is possible to access all keys common to all messages in a variable by adding read_keys open option, see: https://github.com/ecmwf/cfgrib#read-arbitrary-grib-keys

@vic1309
Copy link

vic1309 commented Dec 9, 2020

Dear all

I am also having problems to obtain projparams using xarray. In pygrib, for instance, we can access parameters by doing
grb = grbs.select(name='10 metre U wind component')[0]
grb.projparams

Is there something similar for cfgrib? What is the read_keys for that?

Thank you in advance.

@iainrussell
Copy link
Member

Dear @vic1309

I don't know if you're still having problems with this, but in order to select particular parameters, use filter_by_keys and to add the projection parameter, use read_keys as described on the main page: https://github.com/ecmwf/cfgrib with projString as the key to get.

Best regards,
Iain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prioriy - low Low priority issue
Projects
None yet
Development

No branches or pull requests

4 participants