question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support to open multiple GRIB files as a single Stream / Dataset

See original GitHub issue

At low level we use an explicit file path and file offset in several places.

Note that xr.open_mfdataset handles opening and merging of multiple files without any additional support from the low-level driver so this feature is low priority.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
ShaneMill1commented, Jan 15, 2020

Hello, I have a quick question regarding this topic. I notice that cfgrib has the following ability:

cfgrib also provides a function that automate the selection of appropriate filter_by_keys and returns a list of all valid xarray.Dataset’s in the GRIB file using the cfgrib.open_datasets().

I wanted to ask if this is only for a single grib file, or if it is possible to supply a path that will create the datasets similar to xarray.open_mfdataset(). I’m looking for the ability to automate the selection of filter_by_keys with the ability to open multiple files to create the datasets.

Thanks!

EDIT: it appears that cfgrib.open_datasets() only handles one grib file at a time. however, if you have a directory of grib files, you can “cat” these files into one grib file and then read with cfgrib.open_datasets()

1reaction
alexamicicommented, Nov 9, 2018

@aolt the theory was that everything was lazy already… but in practice I noticed yesterday a really dumb bug that was loading the whole dataset into memory unconditionally at open 🤦‍♂️

The bug is fixed in version 0.9.4, please upgrade and try again.

I’m currently running a mean on 320Gb of GRIB files on 10 dask.distributed nodes, so I’m confident it’s working now 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

GRIB Feature Collections Tutorial | TDS User's Guide
The featureCollection element is a way to tell the TDS to serve collections of CDM Feature Datasets. Currently, this is used mostly for...
Read more >
How to get GRIB data with multiple variables
Hi all,. I would like to get some ERA5 hourly data at single levels for some variables, through the CDS Toolbox. I have...
Read more >
Multidimensional raster types—Help | ArcGIS for Desktop
The GRIB raster type allows you to add GRIB 1 and GRIB 2 data into mosaic ... Whether you should put all variables...
Read more >
MetPy Mondays #135 - Reading GRIB files - YouTube
This week we start learning about GRIB and why it can be a problematic format to deal with!Unidata does not offer support via...
Read more >
wgrib2: grib2 utility - Climate Prediction Center
Wgrib2 has the ability to convert grib files from one grid to another. The conversion uses a user-selected interpolation scheme: bilinear ( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found