Skip to content

Commit 9803d54

Browse files
viktor40vikvnieu
andauthored
Small optimisation in excprob function (#424)
Co-authored-by: vikvnieu <viktor.vannieuwenhuize@ugent.be>
1 parent 917c83b commit 9803d54

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pysteps/postprocessing/ensemblestats.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,9 @@ def excprob(X, X_thr, ignore_nan=False):
9999
scalar_thr = False
100100

101101
for x in X_thr:
102-
X_ = X.copy()
102+
X_ = np.zeros(X.shape)
103103

104104
X_[X >= x] = 1.0
105-
X_[X < x] = 0.0
106105
X_[~np.isfinite(X)] = np.nan
107106

108107
if ignore_nan:

0 commit comments

Comments
 (0)