Skip to content

Commit 18d87c8

Browse files
authored
Fix l2 parameter in SAL verification (#324)
1 parent 1c90e44 commit 18d87c8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pysteps/verification/salscores.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,9 @@ def _sal_l2_param(prediction, observation, thr_factor, thr_quantile, tstorm_kwar
300300
maximum_distance = sqrt(
301301
((observation.shape[0]) ** 2) + ((observation.shape[1]) ** 2)
302302
)
303-
obs_r = (
304-
_sal_weighted_distance(observation, thr_factor, thr_quantile, tstorm_kwargs)
305-
) * (np.nanmean(observation))
306-
forc_r = (
307-
_sal_weighted_distance(prediction, thr_factor, thr_quantile, tstorm_kwargs)
308-
) * (np.nanmean(prediction))
303+
obs_r = _sal_weighted_distance(observation, thr_factor, thr_quantile, tstorm_kwargs)
304+
forc_r = _sal_weighted_distance(prediction, thr_factor, thr_quantile, tstorm_kwargs)
305+
309306
location_2 = 2 * ((abs(obs_r - forc_r)) / maximum_distance)
310307
return float(location_2)
311308

0 commit comments

Comments
 (0)