42 questions
0
votes
1
answer
98
views
Reading multiple GRIB files using Xarray with cfgrib engine with index files in custom location
I am trying to read multiple ERA5 GRIB files using the Python Xarray's xr.mfopen_dataset() method. My ERA5 input files are on a server in a location where I only have read permission for. Therefore, I ...
3
votes
1
answer
830
views
How can I resolve xarray "unrecognized engine cfgrib"?
An example HRRR file I'm trying to open with xarray: https://storage.googleapis.com/high-resolution-rapid-refresh/hrrr.20250427/conus/hrrr.t18z.wrfprsf06.grib2
When trying to open the dataset with ...
0
votes
1
answer
145
views
Getting [Errno 22] Invalid argument when trying to access data variables
I have a grib file containing reanalysis (an), ensemble mean (em), and ensemble spread (es) data. The dataset I access is the analysis data,
import xarray as xr
import cfgrib
file = 'C:/Users/...
0
votes
1
answer
2k
views
How to open grib2 file with xarray in python?
import xarray as xr
import cfgrib
import eccodes
import pandas as pd
data = xr.open_dataset(r"C:\Users\new\forecast_data.grib2", engine = "cfgrib")
I want to read this file using ...
2
votes
1
answer
714
views
No module named 'cfgrib' / 'ecmwflib'
I try to run this script in a SH file this script python3.6 Scriptfile.py /route
The script:
import os
import xarray as xr
import ecmwflibs
import cfgrib
import sys
data_path = r'/grib' + '/'
ds = xr....
2
votes
1
answer
6k
views
How do I properly install cfgrib and eccodes?
I'm trying to run this code on my Mac: https://github.com/EWolffWX/MRMS_Derecho_Composites
When I run it, I get this error ValueError: unrecognized engine cfgrib must be one of: ['netcdf4', 'h5netcdf',...
1
vote
1
answer
2k
views
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 ...
3
votes
0
answers
323
views
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 ...
1
vote
0
answers
377
views
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 ...
0
votes
1
answer
2k
views
Grib2 data extraction with xarray and cfgrib very slow, how to improve the code?
The code is taking about 20 minutes to load a month for each variable with 168 time steps for the cycle of 00 and 12 UTC of each day. When it comes to saving to csv, the code takes even longer, it's ...
1
vote
0
answers
581
views
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....
0
votes
1
answer
1k
views
Xarray mfdataset combining files with different variables using cfgrib engine
I have a folder with several files in .grib2 extension and some of them have the tcc variable (cloud cover) and others don't. I would like to open all files in a single array with this variable but it ...
0
votes
1
answer
2k
views
'cfgrib' is not showing in xarray engine list, when the python code is packaged with pyinstaller to get exe file
I am trying to create an executable file from python code with 'Pyinstaller' package. The code runs in conda environment where the cfgrib selfcheck is good:
Found: eccodes v2.27.0.
your system is ...
0
votes
0
answers
412
views
Setting environment variable in python has no effect on cfgrib
I am using xarray with cfgrib to load grib files in Python. I have custom grib definitions, which I am providing to eccodes (backend for cfgrib) via the environment variable GRIB_DEFINITION_PATH.
This ...
0
votes
1
answer
300
views
MetPy and grb2 file opening issue: xarray's Value Error
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, ...