class astropy.convolution.Model1DKernel(model, **kwargs)[source] [edit on github]

Bases: astropy.convolution.Kernel1D

Create kernel from 1D model.

The model has to be centered on x = 0.

model : Fittable1DModel

Kernel response function model

x_size : odd int, optional

Size in x direction of the kernel array. Default = 8 * width.

mode : str, optional
One of the following discretization modes:
  • ‘center’ (default)
    Discretize model by taking the value at the center of the bin.
  • ‘linear_interp’
    Discretize model by linearly interpolating between the values at the corners of the bin.
  • ‘oversample’
    Discretize model by taking the average on an oversampled grid.
  • ‘integrate’
    Discretize model by integrating the model over the bin.
factor : number, optional

Factor of oversampling. Default factor = 10.


If model is not an instance of Fittable1DModel

See also

Create kernel from Fittable2DModel
Create kernel from list or array


Define a Gaussian1D model:

>>> from astropy.modeling.models import Gaussian1D
>>> from astropy.convolution.kernels import Model1DKernel
>>> gauss = Gaussian1D(1, 0, 2)

And create a custom one dimensional kernel from it:

>>> gauss_kernel = Model1DKernel(gauss, x_size=9)

This kernel can now be used like a usual Astropy kernel.