Skip to content

Commit

Permalink
Fix l2 parameter in SAL verification (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
EsmailGhaemi committed Mar 16, 2023
1 parent 1c90e44 commit 18d87c8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pysteps/verification/salscores.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,9 @@ def _sal_l2_param(prediction, observation, thr_factor, thr_quantile, tstorm_kwar
maximum_distance = sqrt(
((observation.shape[0]) ** 2) + ((observation.shape[1]) ** 2)
)
obs_r = (
_sal_weighted_distance(observation, thr_factor, thr_quantile, tstorm_kwargs)
) * (np.nanmean(observation))
forc_r = (
_sal_weighted_distance(prediction, thr_factor, thr_quantile, tstorm_kwargs)
) * (np.nanmean(prediction))
obs_r = _sal_weighted_distance(observation, thr_factor, thr_quantile, tstorm_kwargs)
forc_r = _sal_weighted_distance(prediction, thr_factor, thr_quantile, tstorm_kwargs)

location_2 = 2 * ((abs(obs_r - forc_r)) / maximum_distance)
return float(location_2)

Expand Down

0 comments on commit 18d87c8

Please sign in to comment.