Skip to content

Commit 5428664

Browse files
authored
Ensure clim window has same size as skill today and place forecast_prev update at end of extrapolation loop (#274)
* make sure skill window has the same size as skill today * place forecast_prev update at the end of extrapolation loop
1 parent 8936236 commit 5428664

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pysteps/blending/clim.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def save_skill(
6060
current_skill,
6161
validtime,
6262
outdir_path,
63-
n_models=1,
6463
window_length=30,
64+
**kwargs,
6565
):
6666
"""
6767
Add the current NWP skill to update today's daily average skill. If the day
@@ -79,8 +79,6 @@ def save_skill(
7979
outdir_path: string
8080
Path to folder where the historical skill are stored. Defaults to
8181
path_workdir from rcparams.
82-
n_models: int, optional
83-
Number of NWP models. Defaults to 1.
8482
window_length: int, optional
8583
Length of window (in days) of daily skill that should be retained.
8684
Defaults to 30.
@@ -124,7 +122,7 @@ def save_skill(
124122
if (
125123
past_skill is not None
126124
and past_skill.shape[2] == n_cascade_levels
127-
and past_skill.shape[1] == n_models
125+
and past_skill.shape[1] == skill_today["mean_skill"].shape[0]
128126
):
129127
past_skill = np.append(past_skill, [skill_today["mean_skill"]], axis=0)
130128
else:

pysteps/blending/steps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,6 @@ def worker(j):
974974

975975
t_prev[j] = t_sub
976976

977-
forecast_prev[j] = precip_cascade[j]
978-
979977
if len(R_f_ep_out) > 0:
980978
R_f_ep_out = np.stack(R_f_ep_out)
981979
Yn_ep_out = np.stack(Yn_ep_out)
@@ -1051,6 +1049,8 @@ def worker(j):
10511049

10521050
t_prev[j] = t + 1
10531051

1052+
forecast_prev[j] = precip_cascade[j]
1053+
10541054
# 8.5 Blend the cascades
10551055
R_f_out = []
10561056

0 commit comments

Comments
 (0)