Model1DKernel

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

Bases: Kernel1D

Create kernel from 1D model.

The model has to be centered on x = 0.

Parameters:
modelFittable1DModel

Kernel response function model

x_sizepython:int, optional

Size in x direction of the kernel array. Default = ⌊8*width +1⌋. Must be odd.

mode{‘center’, ‘linear_interp’, ‘oversample’, ‘integrate’}, 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.

factornumber, optional

Factor of oversampling. Default factor = 10.

Raises:
TypeError

If model is not an instance of Fittable1DModel

See also

Model2DKernel

Create kernel from Fittable2DModel

CustomKernel

Create kernel from list or array

Examples

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.