Skip to content

Commit

Permalink
Remove extra index increment leading to possible IndexError
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkkins committed Jan 27, 2022
1 parent ba2c811 commit 672a5cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pysteps/nowcasts/sprog.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def _compute_sprog_mask(R, war):
i = np.argmin(abs(x - war))
# handle ties
if R_s[i] == R_s[i + 1]:
i = np.where(R_s == R_s[i])[0][-1] + 1
i = np.where(R_s == R_s[i])[0][-1]
R_pct_thr = R_s[i]

# determine a mask using the above threshold value to preserve the
Expand Down

0 comments on commit 672a5cc

Please sign in to comment.