From 35fcf9a150e04464fbb8e51de054ae70deb7a792 Mon Sep 17 00:00:00 2001 From: Carsten Ehbrecht Date: Mon, 6 Nov 2023 19:45:27 +0100 Subject: [PATCH] added cf standard-name to realization coord --- rook/utils/concat_utils.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rook/utils/concat_utils.py b/rook/utils/concat_utils.py index cd07233..ffd3339 100644 --- a/rook/utils/concat_utils.py +++ b/rook/utils/concat_utils.py @@ -20,7 +20,7 @@ from .decadal_fixes import apply_decadal_fixes coord_by_standard_name = { - "realization": "realization_index", + "realization": "realization", } @@ -80,9 +80,8 @@ def _calculate(self): dims = dimension_parameter.DimensionParameter( self.params.get("dims", None) ).value - # standard_name = dims[0] - # dim = coord_by_standard_name.get(standard_name, None) - dim = dims[0] + standard_name = dims[0] + dim = coord_by_standard_name.get(standard_name, None) processed_ds = xr.concat( datasets, @@ -91,10 +90,10 @@ def _calculate(self): processed_ds = processed_ds.assign_coords( {dim: (dim, np.array(processed_ds[dim].values, dtype="int32"))} ) - # processed_ds.coords[dim].attrs = {"standard_name": standard_name} + processed_ds.coords[dim].attrs = {"standard_name": standard_name} # optional: average if self.params.get("apply_average", False): - processed_ds = average(processed_ds, dims=["realization"]) + processed_ds = average(processed_ds, dims=[dim]) # subset outputs = subset( processed_ds,