0

I am currently working with .grib data using xarrays and I can open the datasets as shown in the xarray documentation:

ds_grib = xr.open_dataset("example.grib", engine="cfgrib")

However, for a larger dataset this process is escaling unreasonably with size. For example, for the same dataset but covering a larger time interval, while a 2mb dataset would be read almost instantly a 20mb dataset would take several minutes to load.

Is there a way to speed up this process? Or the most straightforward way would be to break the data in smaller samples and load-merge the different time intervals?

Thanks.

Chicrala
  • 994
  • 12
  • 23
  • 1
    what's the shape of the data? Cfgrib can be very slow when the number of time-steps is very high, see here https://github.com/ecmwf/cfgrib/issues/142 – Matteo De Felice Aug 13 '21 at 11:43
  • Ah then that may be the case as the data covers 13 years of hourly observations for weather. Do you know any alternatives? – Chicrala Aug 13 '21 at 15:21
  • 1
    Yes, open an issue on GitHub (they are often very supportive) or convert the file to netcdf before importing it (using grib2netcdf) – Matteo De Felice Aug 15 '21 at 07:48

0 Answers0