Extraction#

class lsst.dax.images.cutout.Extraction(cutout: Image | Mask | MaskedImage | Exposure | lsst.images.GeneralizedImage, sky_stencil: SkyStencil, pixel_stencil: PixelStencil, metadata: astropy.io.fits.Header, origin_ref: DatasetRef)#

Bases: object

A struct that aggregates the results of extracting subimages in the image cutout backend.

Attributes Summary

cutout

The image cutout itself.

metadata

Provenance FITS header cards describing the cutout process.

origin_ref

Fully-resolved reference to the dataset the cutout is from.

pixel_stencil

A pixel-coordinate representation of the stencil.

sky_stencil

The original sky-coordinate stencil.

Methods Summary

mask([name])

Set the bitmask to show the approximate coverage of nonrectangular stencils.

write_fits(path[, logger])

Write the cutout to a FITS file.

Attributes Documentation

cutout: Image | Mask | MaskedImage | Exposure | lsst.images.GeneralizedImage = <dataclasses._MISSING_TYPE object>#

The image cutout itself.

metadata: astropy.io.fits.Header = <dataclasses._MISSING_TYPE object>#

Provenance FITS header cards describing the cutout process.

Written to the primary header on output. For afw cutout types it is converted to a PropertyList first.

origin_ref: DatasetRef = <dataclasses._MISSING_TYPE object>#

Fully-resolved reference to the dataset the cutout is from.

pixel_stencil: PixelStencil = <dataclasses._MISSING_TYPE object>#

A pixel-coordinate representation of the stencil.

sky_stencil: SkyStencil = <dataclasses._MISSING_TYPE object>#

The original sky-coordinate stencil.

Methods Documentation

mask(name: str = 'OUTSIDE_STENCIL') None#

Set the bitmask to show the approximate coverage of nonrectangular stencils.

Parameters#

namestr, optional

Name of the mask plane to add and set.

Notes#

This method modifies cutout in place if it is a Mask, MaskedImage, or Exposure. It does nothing if cutout is an Image.

write_fits(path: str, logger: Logger | None = None) None#

Write the cutout to a FITS file.

Parameters#

pathstr

Local path to the file.

loggerlogging.Logger, optional

Logger to use for timing messages. If None, a default logger will be used.

Notes#

If cutout is an Exposure, this will merge metadata into the cutout’s attached metadata. In other cases, metadata is written to the primary header without modifying cutout.