I found in this script: https://unidata.github.io/python-training/gallery/declarative_500_hpa/ a plot done using a grb2 file. I just copy and paste the code, it works well. I am trying to do the same, for another date with a downloaded grb2 file from https://www.ncei.noaa.gov/products/weather-climate-models/global-forecast and i get this error, just after replacing the name of the file with a local grb2 downloaded from NCEI:
ValueError: did not find a match in any of xarray's currently installed IO backends ['netcdf4', 'h5netcdf', 'scipy', 'pydap', 'zarr']. Consider explicitly selecting one of the installed backends via the engine
parameter to xarray.open_dataset(), or installing additional IO dependencies
I also tried pip install xarray[complete] and pip install netcdf4. Nothing worked. What am i doing wrong? Best regards, Fede
The original example you linked, while the source data is in GRIB2 format, is accessing the data from a THREDDS server using the OPeNDAP protocol. You can tell this from looking at the URL and seeing https://www.ncei.noaa.gov/thredds/dodsC/
. This protocol is readily supported by xarray. The important point is that for that case, the GRIB2 format was not being processed by xarray.
To open GRIB2 data with xarray, you need to install cfgrib. You can do this with pip using:
pip install cfgrib
or from conda-forge using conda:
conda install -c conda-forge cfgrib