Skip to content

Commit

Permalink
updated concat to use realization variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed Nov 6, 2023
1 parent 5c24413 commit 7398300
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rook/utils/concat_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ 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)
# standard_name = dims[0]
# dim = coord_by_standard_name.get(standard_name, None)
dim = dims[0]

processed_ds = xr.concat(
datasets,
Expand All @@ -90,7 +91,7 @@ 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"])
Expand Down

0 comments on commit 7398300

Please sign in to comment.