Metadata inconsistency betweene cfgrib/xarray and pygrib
See original GitHub issueI am not sure if it’s a cfgrib issue or xarray issue but I will start off here and then move it to xarray if it’s not a cfgrib issue.
I am trying to read one of these files - https://nomads.ncep.noaa.gov/pub/data/nccf/com/cfs/prod/cfs/cfs.20210426/00/6hrly_grib_01/ - let’s assume I want to read this file - -
flxf2021042600.01.2021042600.grb2 and this is the code I have
` import xarray as xr
ds = xr.open_dataset(‘./flxf2021042600.01.2021042600.grb2’,engine=‘cfgrib’,backend_kwargs={‘errors’: ‘ignore’,‘filter_by_keys’: {‘typeOfLevel’: ‘heightAboveGround’}})`
When I print out the value of ds I encounter two issues
- I am looking for these three variables - UGRD:10 m above ground:anl:, VGRD:10 m above ground:anl: and TMP:2 m above ground:anl: as indicated in the indx file - https://nomads.ncep.noaa.gov/pub/data/nccf/com/cfs/prod/cfs/cfs.20210426/00/6hrly_grib_01/flxf2021042600.01.2021042600.grb2.idx
I only obtain what it appears to be ugrd and vgrd. Even here it prints out it as u10 and v10. Are u10 and v10 the same as UGRD and VGRD ?
- I am unable to obtain TMP completely. When I try to do the same with pygrib I obtain all 3 completely.
Where am I going wrong ?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top GitHub Comments
@alexamici I eventually had to go with this
ds1 = xr.open_dataset('./flxf2021042100.01.2021042100.grb2',engine='cfgrib',backend_kwargs={'errors': 'ignore','filter_by_keys': {'shortName': '2t'}})
@winash12 cfgrib can’t access variables at 10m at the same time of variables at 2m. You may try filtering by short name
'filter_by_keys': {'shortName': 't2m'}}
.