diff --git a/src/ai_models/inputs/interpolate.py b/src/ai_models/inputs/interpolate.py index 3fe04dd..a23c41d 100644 --- a/src/ai_models/inputs/interpolate.py +++ b/src/ai_models/inputs/interpolate.py @@ -31,16 +31,7 @@ def __call__(self, ds): result = [] for f in tqdm.tqdm(ds, delay=0.5, desc="Interpolating", leave=False): data = ekr.interpolate(f.to_numpy(), dict(grid=self.source), dict(grid=self.grid)) - template = f - - if self._reduced_gg: - # template is missing the pl matrix required to output a reduced_gg grib - # this is a hack to let earthkit generate it for us - template = None - keys = ("shortName", "levelist", "date", "time", "step", "number") - self.metadata.update({key: f._metadata[key] for key in keys if key in f._metadata}) - - out.write(data, template=template, **self.metadata) + out.write(data, template=f, **self.metadata) out.close() diff --git a/src/ai_models/inputs/opendata.py b/src/ai_models/inputs/opendata.py index 718c444..4af9948 100644 --- a/src/ai_models/inputs/opendata.py +++ b/src/ai_models/inputs/opendata.py @@ -22,11 +22,7 @@ LOG = logging.getLogger(__name__) -CONSTANTS = ( - "z", - "sdor", - "slor", -) +CONSTANTS = ("z", "sdor", "slor") CONSTANTS_URL = "https://get.ecmwf.int/repository/test-data/ai-models/opendata/constants-{resol}.grib2" diff --git a/src/ai_models/outputs/__init__.py b/src/ai_models/outputs/__init__.py index 7260f8b..9ecf386 100644 --- a/src/ai_models/outputs/__init__.py +++ b/src/ai_models/outputs/__init__.py @@ -58,9 +58,6 @@ def output(self): def write(self, data, *args, check=False, **kwargs): - if kwargs.get("param") in ("cp", "tp"): - kwargs["edition"] = 1 - try: handle, path = self.output.write(data, *args, **kwargs)