photutils/background/background_2d.py
def _filter_meshes(self):
        """
        Apply a 2D median filter to the low-resolution 2D mesh,
        including only pixels inside the image at the borders.
        """

        from scipy.ndimage import generic_filter
        try:
            nanmedian_func = np.nanmedian    # numpy >= 1.9
        except AttributeError:    # pragma: no cover
            from scipy.stats import nanmedian
            nanmedian_func = nanmedian

        if self.filter_threshold is None:
            # filter the entire arrays
            self.background_mesh = generic_filter(
                self.background_mesh, nanmedian_func, size=self.filter_size,
                mode='constant', cval=np.nan)
            self.background_rms_mesh = generic_filter(
                self.background_rms_mesh, nanmedian_func,
                size=self.filter_size, mode='constant', cval=np.nan)
        else:
            # selectively filter
            indices = np.nonzero(self.background_mesh > self.filter_threshold)
            self.background_mesh = self._selective_filter(
                self.background_mesh, indices)
            self.background_rms_mesh = self._selective_filter(
                self.background_rms_mesh, indices)

        return

        Apply a 2D median filter to the low-resolution 2D mesh,
        including only pixels inside the image at the borders.
        
Apply a 2D median filter to the low-resolution 2D mesh,
including only pixels inside the image at the borders.
Apply a 2D median filter to the low - resolution 2D mesh including only pixels inside the image at the borders .
def _filter_meshes(self):
        from scipy.ndimage import generic_filter
        try:
            nanmedian_func = np.nanmedian    
        except AttributeError:    
            from scipy.stats import nanmedian
            nanmedian_func = nanmedian
        if self.filter_threshold is None:
            self.background_mesh = generic_filter(
                self.background_mesh, nanmedian_func, size=self.filter_size,
                mode='constant', cval=np.nan)
            self.background_rms_mesh = generic_filter(
                self.background_rms_mesh, nanmedian_func,
                size=self.filter_size, mode='constant', cval=np.nan)
        else:
            indices = np.nonzero(self.background_mesh > self.filter_threshold)
            self.background_mesh = self._selective_filter(
                self.background_mesh, indices)
            self.background_rms_mesh = self._selective_filter(
                self.background_rms_mesh, indices)
        return
def _filter_meshes ( self ) : from scipy . ndimage import generic_filter try : nanmedian_func = np . nanmedian except AttributeError : from scipy . stats import nanmedian nanmedian_func = nanmedian if self . filter_threshold is None : self . background_mesh = generic_filter ( self . background_mesh , nanmedian_func , size = self . filter_size , mode = 'constant' , cval = np . nan ) self . background_rms_mesh = generic_filter ( self . background_rms_mesh , nanmedian_func , size = self . filter_size , mode = 'constant' , cval = np . nan ) else : indices = np . nonzero ( self . background_mesh > self . filter_threshold ) self . background_mesh = self . _selective_filter ( self . background_mesh , indices ) self . background_rms_mesh = self . _selective_filter ( self . background_rms_mesh , indices ) return
Apply a 2D median filter to the low-resolution 2D mesh,
including only pixels inside the image at the borders.
Apply a 2D median filter to the low - resolution 2D mesh including only pixels inside the image at the borders .
"""
        Apply a 2D median filter to the low-resolution 2D mesh,
        including only pixels inside the image at the borders.
        """ # numpy >= 1.9 # pragma: no cover # filter the entire arrays # selectively filter
self