CellPointSpreadFunction#
- class lsst.images.cells.CellPointSpreadFunction(array: ndarray, bounds: CellGridBounds, resampling_kernel: Literal['lanczos3', 'lanczos5'] = 'lanczos5')#
Bases:
PointSpreadFunctionA PSF model that is at least approximately constant over cells.
Parameters#
- array
A 4-d array of PSF kernel images with with shape
(n_cells_y, n_cells_x, psf_shape_y, psf_shape_x).- bounds
Description of the cell grid and any missing cells. Array entries for missing cells should be NaN.
- resampling_kernel
Name of the resampling kernel to use when shifting the kernel image into the stellar image.
Notes#
Unlike most PSF model types,
CellPointSpreadFunctioncan be subset via slicing:a bounding
Boxfor a subimage, which returns a new PSF with only the cells that cover that subimage;a
CellIJindex, which returns the kernel image for that cell.
Attributes Summary
The bounds where the PSF can be evaluated (
CellGridBounds).The grid that defines the PSF's cells (
CellGrid).Bounding box of all images returned by
compute_kernel_image.Methods Summary
compute_kernel_image(*, x, y)Evaluate the PSF model into an image suitable for convolution.
compute_stellar_bbox(*, x, y)Return the bounding box of the image that would be returned by
compute_stellar_image.compute_stellar_image(*, x, y)Evaluate the PSF model into an image suitable for comparison with the image of an astrophysical point source.
from_legacy(legacy_psf[, bounds])Make a PSF object from a legacy
lsst.afw.detection.Psfinstance.serialize(archive)Attributes Documentation
- bounds#
The bounds where the PSF can be evaluated (
CellGridBounds).
- grid#
The grid that defines the PSF’s cells (
CellGrid).Notes#
This is usually (but is not guaranteed to be) the grid for a full patch, even when the PSF only covers a subimage.
- kernel_bbox#
Methods Documentation
- compute_kernel_image(*, x: float, y: float) Image#
Evaluate the PSF model into an image suitable for convolution.
Parameters#
- x
Column position coordinate to evaluate at.
- y
Row position coordinate to evaluate at.
Returns#
- Image
An image of the PSF, centered on the center of the center pixel, which is defined to be
(0, 0)by the image’s origin.
- compute_stellar_bbox(*, x: float, y: float) Box#
Return the bounding box of the image that would be returned by
compute_stellar_image.Parameters#
- x
Column position coordinate to evaluate at.
- y
Row position coordinate to evaluate at.
Returns#
- Box
The bounding box of the image that would be returned by
compute_stellar_imageat the given point.
- compute_stellar_image(*, x: float, y: float) Image#
Evaluate the PSF model into an image suitable for comparison with the image of an astrophysical point source.
Parameters#
- x
Column position coordinate to evaluate at.
- y
Row position coordinate to evaluate at.
Returns#
- Image
An image of the PSF, centered on the given coordinates, just like the postage stamp of a star would be.
- classmethod from_legacy(legacy_psf: Any, bounds: Bounds | None = None) CellPointSpreadFunction#
Make a PSF object from a legacy
lsst.afw.detection.Psfinstance.Parameters#
- legacy_psf
Legacy PSF object.
- bounds
The region where this PSF model is valid.
Returns#
PointSpreadFunctionThe converted PSF object.
Notes#
This base class method is a factory dispatch function that automatically selects the right
PointSpreadFunctionsubclass to use. When that is already known, a subclassfrom_legacymethod can be called instead.
- serialize(archive: OutputArchive[Any]) CellPointSpreadFunctionSerializationModel#