Bases: astropy.convolution.Kernel1D
1D Box filter kernel.
The Box filter or running mean is a smoothing filter. It is not isotropic and can produce artifacts, 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. E.g a Box kernel with an effective smoothing of 4 pixel would have the following array: [0.5, 1, 1, 1, 0.5].
Parameters: | width : number
mode : str, optional
factor : number, optional
|
---|
See also
Examples
Kernel response function:
import matplotlib.pyplot as plt from astropy.convolution import Box1DKernel box_1D_kernel = Box1DKernel(9) plt.plot(box_1D_kernel, drawstyle='steps') plt.xlim(-1, 9) plt.xlabel('x [pixels]') plt.ylabel('value') plt.show()(Source code, png, hires.png, pdf)