From ac8f9b5f2d8fe15bc5bf8b9067e7fe1c62635935 Mon Sep 17 00:00:00 2001 From: Baudouin Raoult Date: Thu, 5 Oct 2023 16:09:21 +0100 Subject: [PATCH] hindcasts --- .gitignore | 1 + ai_models/__init__.py | 2 +- ai_models/outputs/__init__.py | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 332e091..9afb532 100644 --- a/.gitignore +++ b/.gitignore @@ -173,3 +173,4 @@ bar *.nc *.npz *.json +*.req diff --git a/ai_models/__init__.py b/ai_models/__init__.py index 6d6af52..970b767 100644 --- a/ai_models/__init__.py +++ b/ai_models/__init__.py @@ -5,4 +5,4 @@ # granted to it by virtue of its status as an intergovernmental organisation # nor does it submit to any jurisdiction. -__version__ = "0.2.6" +__version__ = "0.2.7" diff --git a/ai_models/outputs/__init__.py b/ai_models/outputs/__init__.py index aa94eb6..c18aa44 100644 --- a/ai_models/outputs/__init__.py +++ b/ai_models/outputs/__init__.py @@ -21,10 +21,13 @@ def __init__(self, owner, path, metadata, **kwargs): LOG.info("Writing results to %s.", path) self.path = path self.owner = owner + + edition = metadata.pop("edition", 2) + self.output = cml.new_grib_output( path, split_output=True, - edition=2, + edition=edition, generatingProcessIdentifier=self.owner.version, **metadata, ) @@ -44,7 +47,8 @@ def write(self, *args, **kwargs): else: date = kwargs["template"]["date"] - kwargs["date"] = self.owner.hindcast_reference_date + kwargs.pop("date", None) + kwargs["referenceDate"] = self.owner.hindcast_reference_date kwargs["hdate"] = date return self.output.write(*args, **kwargs)