Closed floriankrb closed 5 months ago
Hi @floriankrb , I also could do with this feature, so I've linked a branch I have been working on. If you still have an active use case for this, maybe you could give it a go? https://github.com/ecmwf/cfgrib/tree/ignore_keys
@sandorkertesz would these ignore_keys still be needed in earthkit.data ?
When a user wants to open a grib file containing multiple gribs with inconsistent values, cfgrib refuses (rightfully) to merge them, leading to an error such as:
While this solves some issues, it is not enough when the user does not want to filter, but prefers to ignore this key. I would like to extend the
filter_keys
option and add a newignore_keys
option.For a key in the list provided by the user in
ignore_keys
, cfgrib should force the value to None when reading these keys. And the error message above could become:This is related to https://github.com/ecmwf/climetlab/issues/33 (and maybe others, such as https://github.com/ecmwf/cfgrib/issues/263 and https://github.com/ecmwf/cfgrib/issues/268 and https://gis.stackexchange.com/questions/372729/unable-to-read-grib-datas-with-xarray).