ecmwf / cfgrib

A Python interface to map GRIB files to the NetCDF Common Data Model following the CF Convention using ecCodes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

conditional load of grib keys depending on productDefinitionTemplateNumber

cosunae opened this issue · comments

Hi

I have a question concerning how the grib keys are loaded into a dataset.
Here we see a set of predefined keys that will be loaded
https://github.com/ecmwf/cfgrib/blob/27071067bcdd7505b1abbcb2cea282cf23b36598/cfgrib/dataset.py

additionally the user can add any list using the read_keys in the open_dataset call.
The issue I have is that many grib keys will be present/needed depending on the value of productDefinitionTemplateNumber.
Therefore a static list of keys does not work while opening a file that contains various records with different productDefinitionTemplateNumber.
Something similar to what happen with the grid type, which seems to be solved using this map.

GRID_TYPE_MAP = {

Is there any solution envisioned ?