From a2ba23e1244f3c096c7ae1d5210a5eab729b3c2b Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Wed, 8 Nov 2023 18:33:00 +0100 Subject: [PATCH] keep attributes --- rook/utils/weighted_average_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rook/utils/weighted_average_utils.py b/rook/utils/weighted_average_utils.py index 2880e30..02ac99d 100644 --- a/rook/utils/weighted_average_utils.py +++ b/rook/utils/weighted_average_utils.py @@ -27,7 +27,7 @@ def calc_weighted_mean(ds): # apply weights ds_weighted = ds.weighted(weights) # apply mean - ds_weighted_mean = ds_weighted.mean(["lat", "lon"]) + ds_weighted_mean = ds_weighted.mean(["lat", "lon"], keep_attrs=True) return ds_weighted_mean