From 9847127828638bb8625214059f0f3348fa823e28 Mon Sep 17 00:00:00 2001 From: Bart Schilperoort Date: Wed, 16 Aug 2023 14:17:43 +0200 Subject: [PATCH] Allow datasets without time dim in recipe --- src/zampy/recipe.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zampy/recipe.py b/src/zampy/recipe.py index cac5274..5351680 100644 --- a/src/zampy/recipe.py +++ b/src/zampy/recipe.py @@ -118,7 +118,8 @@ def run(self) -> None: ds = converter.convert(ds, dataset, convention=self.convention) - ds = ds.resample(time=self.frequency).mean() + if "time" in ds.dims: # Dataset with only DEM (e.g.) has no time dim. + ds = ds.resample(time=self.frequency).mean() comp = dict(zlib=True, complevel=5) encoding = {var: comp for var in ds.data_vars}