A Python interface to map GRIB files to the NetCDF Common Data Model following the CF Convention using ecCodes
Questions tagged [cfgrib]
39 questions
4
votes
0 answers
Dealing with large grib files using xarray and dask
I'm reading some (apparently) large grib files using xarray. I say 'apparently' because they're ~100MB each, which doesn't seem too big to me. However, running
import xarray as xr
ds = xr.open_dataset("gribfile.grib", engine="cfgrib")
takes a…

jezza
- 331
- 2
- 13
3
votes
1 answer
Load GRIB variables with "unknown" typeOfLevel using cfgrib
I'm trying to load GRIB2 files from DWD's ICON model using xarray and cfgrib. Most variables work fine, but for some (like for example CLCL), xarray.open_dataset raises the following error:
Traceback (most recent call last):
File…

Florian Brucker
- 9,621
- 3
- 48
- 81
3
votes
2 answers
How do I resolve this AttributeError when using eccodes/grib?
I'm working with cfgrib on macOS and I'm getting the following error when I try to use covert a grib file into xarray:
AttributeError: module 'pyeccodes.compat' has no attribute 'codes_grib_multi_support_off'
Here's the code I have so far:
import…

100mypete
- 27
- 6
2
votes
0 answers
How can I install a library (cfgrib) in databricks through conda?
I'm trying to install cfgrib (https://pypi.org/project/cfgrib/) on databricks.
Cfgrib depends only on the c-library eccodes.
I installed both eccodes and cfgrib through the libraries page of databricks.
However, when I do "import cfgrib", it keeps…

Gabriele
- 333
- 1
- 7
2
votes
2 answers
Xarray (from grib file) to dataset
I have a grib file containing monthly precipitation and temperature from 1989 to 2018 (extracted from ERA5-Land).
I need to have those data in a dataset format with 6 column : longitude, latitude, ID of the cell/point in the grib file, date,…

yacx
- 167
- 2
- 13
2
votes
1 answer
Cfgrib is not installed correctly on WSL2 through pip
I'm trying to install cfgrib to my WSL2 Ubuntu however when I type python3 -m cfgrib selfcheck it gives the following error as follows.
Traceback (most recent call last):
File "/home/berke/.local/lib/python3.8/site-packages/cfgrib/messages.py",…

Berke Şentürk
- 119
- 1
- 12
1
vote
1 answer
Why is accessing values in xarray so slow?
I need to access a bunch of historical weather data and use ERA5 dataset (> 1 Mio. specific locations points at specific timestamps).
I access it through a downloaded GRIB file and the xarray package. Unfortunately, the script runs quite slow: every…

gabolo
- 21
- 4
1
vote
0 answers
How to load and convert grib file from reduced gaussian grid to regular gaussian grid using cfgrib
Is there a way to load and convert grib file from reduced gaussian grid (reduced_gg) to regular gaussian grid (regular_gg) using cfgrib?
Assuming the file fgrib contains temperature on 60 levels and on a reduced gaussian grid N128, the command:…

Quentin
- 11
- 1
1
vote
0 answers
Error when converting grib file to netcdf
I'm trying to convert a grib file obtained from someone else to netcdf using cdo. The file is global data with a gaussian grid format:
File format : GRIB szip
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter ID
1…

Henrique
- 135
- 6
1
vote
0 answers
xarray grib file - Error of shape extracting data
I downloaded CERRA grib data of 173 Go. Here is the informations of the grib2 file :
By this code i try to get ws variables for all timestamp in particular lat,lon:
lat = 47
lon = 4.9
abslat = np.abs(ds.latitude-lat)
abslon =…

Kareivis
- 85
- 6
1
vote
1 answer
Converting lat/lon coordinates into meters/kilometers for use in a metpy HRRR cross section
I am trying to create custom cross sections of archived HRRR Grib2 output data. I had been following the cross section example provided here and followed up on all issues I had with the file format itself also on the unidata site here. I have…

Rakoc1bc
- 13
- 3
1
vote
0 answers
Segmentation fault after updating eccodes for python
I updated my eccodes-library from 2.17.0 to 2.23.0 with the help of the following gist: https://gist.github.com/MHBalsmeier/a01ad4e07ecf467c90fad2ac7719844a
After updating the following example crashes, when using eccodes in version higher than…

MAESTRO_DE
- 433
- 2
- 17
1
vote
1 answer
Unable to import cfgrib
Whenever I try importing cfgrib it gives me runtime error that it could not load ecCodes library
import cfgrib
Here's the full error message
RuntimeError Traceback (most recent call…

Waqas_14
- 31
- 6
1
vote
0 answers
Open grib file using xarray and cfgrib
Using the xarray and cfgrib can open the grib file with the command ds=xr.open_dataset('a.grib',engine='cfgrib').
However, the dimensions of ds sometimes are different from those obtained from the offical.
For example, the dimension of ds should be…

Yongwu Xiu
- 125
- 1
- 9
1
vote
1 answer
mapping GRIB2 variable names from pynio to cfgrib
I have a working program on an x86 linux machine that uses pynio to read grib2 files from NOAA's NBM product. A simplified version of the code looks like the following:
import Nio
f = Nio.open_file('foo.grib2', mode='r', options=None)
vars =…

Grant Petty
- 1,151
- 1
- 13
- 27