Bases: astropy.convolution.Kernel2D
2D Box filter kernel.
The Box filter or running mean is a smoothing filter. It is not isotropic and can produce artifact, when applied repeatedly to the same data.
By default the Box kernel uses the linear_interp discretization mode, which allows non-shifting, even-sized kernels. This is achieved by weighting the edge pixels with 1/2.
Parameters: | width : number
mode : str, optional
factor : number, optional
|
---|
See also
Box2DKernel, Tophat2DKernel, MexicanHat2DKernel, Ring2DKernel, TrapezoidDisk2DKernel, AiryDisk2DKernel
Examples
Kernel response:
import matplotlib.pyplot as plt from astropy.convolution import Box2DKernel box_2D_kernel = Box2DKernel(9) plt.imshow(box_2D_kernel, interpolation='none', origin='lower', vmin=0.0, vmax=0.015) plt.xlim(-1, 9) plt.ylim(-1, 9) plt.xlabel('x [pixels]') plt.ylabel('y [pixels]') plt.colorbar() plt.show()(Source code, png, hires.png, pdf)