Skip to content

Commit

Permalink
Fix median filter
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud committed Jun 28, 2023
1 parent 51835e1 commit d22e117
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions satpy/modifiers/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import logging

import xarray as xr
from dask_image.ndfilters import median_filter

from satpy.modifiers import ModifierBase

logger = logging.getLogger('filters')
logger = logging.getLogger(__name__)


class Median(ModifierBase):
Expand All @@ -25,6 +24,8 @@ def __init__(self, median_filter_params, **kwargs):

def __call__(self, arrays, **info):
"""Get the median filtered band."""
from dask_image.ndfilters import median_filter

data = arrays[0]
logger.debug(f"Apply median filtering with parameters {self.median_filter_params}.")
res = xr.DataArray(median_filter(data.data, **self.median_filter_params),
Expand Down

0 comments on commit d22e117

Please sign in to comment.