MultipleCellCoadd

class lsst.cell_coadds.MultipleCellCoadd(cells: Iterable[SingleCellCoadd], grid: UniformGrid, outer_cell_size: Extent2I, psf_image_size: Extent2I, *, common: CommonComponents, inner_bbox: Box2I | None = None)

Bases: CommonComponentsProperties

A data structure for coadds built from many overlapping cells.

Notes

MultipleCellCoadd is designed to be used both by measurement algorithms that are able to take advantage of cell boundaries and overlap regions (which can use the .cells attribute to access SingleCellCoadd objects directly) and measurement algorithms that just want one image and don’t care (or don’t care much) about discontinuities (which can use stitch to obtain such an image).

Indexing with Box2I yields a MultipleCellCoadd view containing just the cells that overlap that region.

Attributes Summary

band

String label for the filter bandpass.

cells

The grid of single-cell coadds, indexed by (y, x).

common

Struct of image components common to all cells in a patch.

grid

Object that defines the inner geometry for all cells.

identifiers

Struct of unique identifiers for this coadd's patch.

inner_bbox

The rectangular region fully covered by all cell inner bounding boxes.

mask_fraction_names

The names of all mask planes whose fractions were propagated in any cell.

n_noise_realizations

The number of noise realizations cells are guaranteed to have.

outer_bbox

The rectangular region fully covered by all cell outer bounding boxes.

outer_cell_size

Dimensions of the outer region of each cell.

psf_image_size

Dimensions of PSF model images.

units

Units of the coadd's data pixels.

wcs

World Coordinate System object that maps the pixel grid to sky coordinates.

Methods Summary

explode([pad_psfs_with])

Return a coadd whose image planes stitch together the outer regions of each cell, duplicating pixels in the overlap regions.

readFits(*args, **kwargs)

Alias to read_fits method.

read_fits(filename)

Read a MultipleCellCoadd from a FITS file.

stitch([bbox])

Return a contiguous (but in general discontinuous) coadd by stitching together inner cells.

writeFits(*args, **kwargs)

Alias to write_fits method.

write_fits(filename[, overwrite, metadata])

Write the coadd as a FITS file.

Attributes Documentation

band

String label for the filter bandpass.

May be None only for coadds that represent a combination of multiple passbands (e.g. chi^2 detection coadds), not just to indicate absence of knowledge.

cells

The grid of single-cell coadds, indexed by (y, x).

common
grid

Object that defines the inner geometry for all cells.

identifiers

Struct of unique identifiers for this coadd’s patch.

inner_bbox

The rectangular region fully covered by all cell inner bounding boxes.

mask_fraction_names

The names of all mask planes whose fractions were propagated in any cell.

Cells that do not have a mask fraction for a particular name may be assumed to have the fraction for that mask plane uniformly zero.

n_noise_realizations

The number of noise realizations cells are guaranteed to have.

outer_bbox

The rectangular region fully covered by all cell outer bounding boxes.

outer_cell_size

Dimensions of the outer region of each cell.

psf_image_size

Dimensions of PSF model images.

units

Units of the coadd’s data pixels.

wcs

World Coordinate System object that maps the pixel grid to sky coordinates.

Methods Documentation

explode(pad_psfs_with: float | None = None) ExplodedCoadd

Return a coadd whose image planes stitch together the outer regions of each cell, duplicating pixels in the overlap regions.

Parameters:
pad_psfs_withfloat or None, optional

A floating-point value to pad PSF images with so each PSF-image cell has the same dimensions as the image (outer) cell it corresponds to. If None, PSF images will not be padded and the full PSF image will generally be smaller than the exploded image it corresponds to.

Returns:
explodedExplodedCoadd

Exploded version of the coadd.

classmethod readFits(*args, **kwargs) MultipleCellCoadd

Alias to read_fits method.

Notes

This method exists for compatability with the rest of the codebase. The presence of this method allows for reading in via lsst.obs.base.formatters.FitsGenericFormatter. Whenever possible, use read_fits instead, since this method may be deprecated in the near future.

classmethod read_fits(filename: str) MultipleCellCoadd

Read a MultipleCellCoadd from a FITS file.

Parameters:
filenamestr

The path to the FITS file to read.

Returns:
cell_coaddMultipleCellCoadd

The MultipleCellCoadd object read from the FITS file.

stitch(bbox: Box2I | None = None) StitchedCoadd

Return a contiguous (but in general discontinuous) coadd by stitching together inner cells.

Parameters:
bboxBox2I, optional

Region for the returned coadd; default is self.inner_bbox.

Returns:
stitchedStitchedCellCoadd

Contiguous coadd covering the given area. Each image plane is actually constructed when first accessed, not when this method is called.

writeFits(*args, **kwargs) None

Alias to write_fits method.

Notes

This method exists for compatability with the rest of the codebase. The presence of this method allows for persistence via lsst.obs.base.formatters.FitsGenericFormatter. Whenever possible, use write_fits instead, since this method may be deprecated in the near future.

write_fits(filename: str, overwrite: bool = False, metadata: PropertySet | None = None) None

Write the coadd as a FITS file.

Parameters:
filenamestr

The path to the FITS file to write.

overwritebool, optional

Whether to overwrite an existing file?

metadataPropertySet, optional

Additional metadata to write to the FITS header.