ImageBasisConvolutionKernel#

class lsst.images.convolution_kernels.ImageBasisConvolutionKernel(basis, spatial, center_y=None, center_x=None)#

Bases: ConvolutionKernel

A convolution kernel formed by a linear combination of images multiplied by BaseField instances.

Parameters:
  • basis (ndarray) – A 3-d array holding the kernel images each basis function, with shape (n, height, width).

  • spatial (Iterable[TypeAliasType]) – Iterable of fields.BaseField of length basis.shape[0], holding the spatial variation of each basis kernel.

  • center_y (int | None, default: None) – Center of the basis kernels in the x dimension. Defaults to height//2.

  • center_x (int | None, default: None) – Center of the basis kernels in the x dimension. Defaults to width//2.

Attributes Summary

basis

The kernel basis functions, as an array with shape (n, h, w) (numpy.ndarray).

bounds

The region where this convolution kernel is valid (Bounds).

kernel_bbox

Bounding box of all images returned by compute_kernel_image (Box).

spatial

The spatial variation of each basis function (Sequence [BaseField]).

Methods Summary

compute_kernel_image(*, x, y)

Evaluate the kernel at a point.

from_legacy(legacy_kernel)

Convert from a legacy lsst.afw.math.LinearCombinationKernel.

serialize(archive)

Serialize the kernel to an output archive.

to_legacy()

Convert to a legacy lsst.afw.math.LinearCombinationKernel.

Attributes Documentation

basis#

The kernel basis functions, as an array with shape (n, h, w) (numpy.ndarray).

bounds#
kernel_bbox#
spatial#

The spatial variation of each basis function (Sequence [BaseField]).

Methods Documentation

compute_kernel_image(*, x, y)#

Evaluate the kernel at a point.

Parameters:
  • x (int) – Column position coordinate to evaluate at.

  • y (int) – Row position coordinate to evaluate at.

Returns:

An image of the kernel, centered on the center of the center pixel, which is defined to be (0, 0) by the image’s origin.

Return type:

Image

static from_legacy(legacy_kernel)#

Convert from a legacy lsst.afw.math.LinearCombinationKernel.

Parameters:

legacy_kernel (TypeAliasType) – The kernel to convert. Must use Chebyshev polynomials for its spatial variation and lsst.afw.math.FixedKernel objects with a consistent shape and center for its basis functions.

Return type:

ImageBasisConvolutionKernel

serialize(archive)#

Serialize the kernel to an output archive.

Parameters:

archive (OutputArchive[Any]) – Archive to write to.

Return type:

ImageBasisConvolutionKernelSerializationModel

to_legacy()#

Convert to a legacy lsst.afw.math.LinearCombinationKernel.

This only works if all spatial variation is handled by lsst.images.ChebyshevField.

Return type:

TypeAliasType

This page was last modified on .