Skip to content

Commit

Permalink
fix w-avg
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed Oct 30, 2023
1 parent a5da5eb commit 267b7f8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rook/utils/weighted_average_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import numpy as np
import xarray as xr

import collections

from roocs_utils.parameter import collection_parameter
Expand Down Expand Up @@ -62,9 +64,15 @@ def _calculate(self):
# add to list
datasets.append(ds_weighted)

# concat over time
processed_ds = xr.concat(
datasets,
"time",
)

# average
outputs = average_over_dims(
datasets,
processed_ds,
dims=["latitude", "longitude"],
output_type="nc",
)
Expand Down

0 comments on commit 267b7f8

Please sign in to comment.