Skip to content

Commit

Permalink
Fix for avg filtering non-nan masked raster
Browse files Browse the repository at this point in the history
  • Loading branch information
SorooshMani-NOAA committed Aug 24, 2023
1 parent 17321c4 commit ab591ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ocsmesh/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,13 @@ def average_filter(
mask_below = ma.getdata(outband) < drop_below
outband[mask_below] = np.nan

# Since the nbmean checks for isnan, other fill values
# will be treated as normal numbers
outband_new = generic_filter(
outband, LowLevelCallable(nbmean.ctypes), size=size)
outband.filled(np.nan),
LowLevelCallable(nbmean.ctypes),
size=size
)

# Mask raster based on result of filter?
if drop_above is not None:
Expand Down

0 comments on commit ab591ea

Please sign in to comment.