From 30faaf2f315ff1ad993e7623c2877496938b9020 Mon Sep 17 00:00:00 2001 From: vikvnieu Date: Mon, 19 Aug 2024 12:23:38 +0200 Subject: [PATCH] Small optimisation in excprob function --- pysteps/postprocessing/ensemblestats.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pysteps/postprocessing/ensemblestats.py b/pysteps/postprocessing/ensemblestats.py index 54d90aaeb..351ec4a31 100644 --- a/pysteps/postprocessing/ensemblestats.py +++ b/pysteps/postprocessing/ensemblestats.py @@ -99,10 +99,9 @@ def excprob(X, X_thr, ignore_nan=False): scalar_thr = False for x in X_thr: - X_ = X.copy() + X_ = np.zeros(X.shape) X_[X >= x] = 1.0 - X_[X < x] = 0.0 X_[~np.isfinite(X)] = np.nan if ignore_nan: