diff --git a/src/anemoi/inference/outputs/gribfile.py b/src/anemoi/inference/outputs/gribfile.py index 49118f6..dd4cc9e 100644 --- a/src/anemoi/inference/outputs/gribfile.py +++ b/src/anemoi/inference/outputs/gribfile.py @@ -23,6 +23,22 @@ LOG = logging.getLogger(__name__) +# There is a bug with hindcasts, where these keys are not added to the 'mars' namespace +MARS_MAYBE_MISSING_KEYS = ( + "number", + "step", + "time", + "date", + "hdate", + "type", + "stream", + "expver", + "class", + "levtype", + "levelist", + "param", +) + class ArchiveCollector: """Collects archive requests""" @@ -129,7 +145,7 @@ def collect_archive_requests(self, written, template, **keys): mars = handle.as_namespace("mars") # There is a bug with hincasts, where the 'number' is not added to the 'mars' namespace - for key in ("number",): + for key in MARS_MAYBE_MISSING_KEYS: if key in keys and key not in mars: mars[key] = keys[key] warnings.warn(f"collect_archive_requests: missing key {key} in 'mars' namespace, using {keys[key]}")