[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[python #RNH-188237]: Using CFGRIB



Hello! Thanks for reaching out to us.

In this case, the cfgrib -> xarray interface can not read in data contained in 
your GRIB file indexed along multiple different vertical coordinates (e.g. 
isobaric, surface, etc.) So here, you have two primary solutions.

If your goal is to pick out just the variables for one vertical coordinate of 
your choice, check out this link: 
https://github.com/ecmwf/cfgrib#filter-heterogeneous-grib-files and try

  ds = xr.open_dataset(<file>, engine='cfgrib',
                       backend_kwargs={'filter_by_keys': {'typeOfLevel': 
<vertical-coord>}})

and if your goal is for cfgrib to pull out each collection of data, grouped by 
their shared vertical coordinates, check out this link : 
https://github.com/ecmwf/cfgrib#automatic-filtering and try

  datasets = cfgrib.open_datasets(<file>)

which will give you a list of xarray datasets, each  by the different available 
vertical coordinates.

I hope this helps, and don't hesitate to reach out if there's more we can point 
you in the direction of!


All the best,

Drew


> Could you please provide your expertise on why this fileÂisnât working?
> 
> 
> ÂIâm using HRRR grib files located here:ÂHRRR Download Page
> 
> |
> |
> |  |
> HRRR Download Page
> 
> 
> |
> 
> |
> 
> |
> 
> 
> 



Ticket Details
===================
Ticket ID: RNH-188237
Department: Support Python
Priority: Low
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.