Skip to content

Commit

Permalink
fix for issue where np.nan was not ignored for stats
Browse files Browse the repository at this point in the history
  • Loading branch information
bhjolly committed Jan 22, 2025
1 parent 49cd367 commit c1ab717
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rios/calcstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,8 @@ def doStatsAccum(self, arr):
"""
if self.nullval is None:
values = arr.flatten()
elif numpy.isnan(self.nullval):
values = arr[~numpy.isnan(arr)]
else:
values = arr[arr != self.nullval]
if len(values) > 0:
Expand Down

0 comments on commit c1ab717

Please sign in to comment.