Skip to content

Commit 4c4ecc0

Browse files
Fangyh09aperezhortal
authored andcommitted
nowcast.utils.py code refactoring (#92)
* Refactoring stack_cascades function in nowcast.utils module * Add empty line at the end of the file
1 parent 536337a commit 4c4ecc0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pysteps/nowcasts/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,10 @@ def stack_cascades(R_d, n_levels, donorm=True):
122122
if donorm:
123123
mu_ = R_d[j]["means"][i]
124124
sigma_ = R_d[j]["stds"][i]
125-
if j == n_inputs - 1:
126-
mu[i] = mu_
127-
sigma[i] = sigma_
128125
R__ = (R_d[j]["cascade_levels"][i, :, :] - mu_) / sigma_
129126
R_.append(R__)
127+
mu[i] = R_d[n_inputs - 1]["means"][i]
128+
sigma[i] = R_d[n_inputs - 1]["stds"][i]
130129
R_c.append(np.stack(R_))
131130

132131
return np.stack(R_c), mu, sigma

0 commit comments

Comments
 (0)