Stream: python-questions

Topic: ✔ Xarray cfgrib engine for reading GRIB data not working?


view this post on Zulip Hui Li (May 31 2023 at 23:00):

Hi all,

I used to use "xarray.open_dataset" to load reanalysis data in GRIB format. You just need to specify "engine='cfgrid'" in your code, and it works pretty well. Now I find that my old code doesn't work any more, with an error saying "ValueError: unrecognized engine cfgrib must be one of: ['netcdf4', 'h5netcdf', 'scipy', 'pydap', 'store', 'zarr']".

The xarray tutorial webpage shows the same error: https://docs.xarray.dev/en/stable/examples/ERA5-GRIB-example.html

Is cfgrid no longer supported by xarray? This seems problematic, as ERA5 and JRA55 reanalysis data are all stored in GRIB format on the NCAR research data archive. Can anyone suggest an alternative to reading GRIB data in python? Or do we have ERA5 monthly data in Netcfd format stored somewhere on Glade?

Thanks!!
Hui

view this post on Zulip Katie Dagon (May 31 2023 at 23:26):

Hi @Hui Li I found an very recent open issue about this topic: https://github.com/pydata/xarray/issues/7884

view this post on Zulip Hui Li (May 31 2023 at 23:42):

Ah! Updating the cfgrib worked :grinning:

view this post on Zulip Notification Bot (Jun 01 2023 at 15:39):

Deepak Cherian has marked this topic as resolved.


Last updated: May 16 2025 at 17:14 UTC