DifferenceImageTemplateInfo#

pydantic model lsst.images.DifferenceImageTemplateInfo#

Information about how a template image contributed to a difference image.

Parameters:

data (Any)

Fields:
field bounds: Polygon [Required]#

The approximate intersection of the template and the science image, in the science image’s pixel coordinate system.

field dataset_id: uuid.UUID [Required]#

Universally unique butler identifier for this template.

field dataset_run: str [Required]#

Name of the butler RUN collection for this template.

field instrument: str = 'UNKNOWN'#

Name of the instrument whose observations were coadded to make this template, or ‘UNKNOWN’ if it could not be determined.

field patch: int [Required]#

ID of the patch (all patches within a tract share a projection).

field psf_shape_flag: bool [Required]#

Flag set if the second moments of the effective template PSF could not be computed.

field psf_shape_xx: float [Required]#

Second moment of the effective PSF of the template.

field psf_shape_xy: float [Required]#

Second moment of the effective PSF of the template.

field psf_shape_yy: float [Required]#

Second moment of the effective PSF of the template.

field skymap: str [Required]#

Name of the skymap that defines the tract/patch tiling.

field tract: int [Required]#

ID of the tract (each tract is a different projection).

static from_legacy(detector_frame, legacy_template_psf, legacy_template_metadata, coadd_data_ids_by_uuid, coadd_dataset_type='template_coadd', log=None, instrument=None)#

Construct a list of template information structs from information stored in a legacy stitched template image.

Parameters:
  • detector_frame (DetectorFrame) – Coordinate system and bounding box of the science image.

  • legacy_template_psf (TypeAliasType) – The lazy-evaluation PSF model for the stitched template; used to extract the tract and patch IDs of the coadds actually used and their PSF models.

  • legacy_template_metadata (Mapping[str, Any]) – The FITS-style metadata of the stitched template; used to extract butler UUIDs and RUN collection names for all potential input coadds.

  • coadd_data_ids_by_uuid (Mapping[UUID, DataCoordinate | Mapping[str, Any]]) – A mapping from butler dataset ID to {tract, patch, band} data ID for all coadds that may have contributed to the template. May be a much larger superset of the needed datasets.

  • coadd_dataset_type (str, default: 'template_coadd') – The name of the coadd template dataset type.

  • log (Logger | None, default: None) – Logger to use for diagnostic messages.

  • instrument (str | None, default: None) – Name of the instrument whose observations were coadded to make the templates, or None if it is not known; an unknown instrument is recorded as "UNKNOWN".

Returns:

One struct for each input coadd that overlaps the science image, sorted by tract and patch.

Return type:

list [DifferenceImageTemplateInfo]

Raises:
  • KeyError – Raised if a PSF component’s (tract, patch) has no matching input coadd in the metadata, or if an input coadd’s dataset ID is missing from coadd_data_ids_by_uuid.

  • RuntimeError – Raised if the input coadds come from more than one skymap.

See also

from_legacy_psf

static from_legacy_psf(detector_frame, legacy_template_psf, skymap, butler_info, log=None, instrument=None)#

Construct a list of template information structs from a legacy stitched template PSF and butler provenance held by the caller.

Parameters:
  • detector_frame (DetectorFrame) – Coordinate system and bounding box of the science image.

  • legacy_template_psf (TypeAliasType) – The lazy-evaluation PSF model for the stitched template; used to extract the tract and patch IDs of the coadds actually used and their PSF models.

  • skymap (str) – Name of the skymap that defines the tract and patch tiling.

  • butler_info (Mapping[tuple[int, int], tuple[UUID, str]]) – A mapping from (tract, patch) to the butler dataset ID and RUN collection name of that coadd. May be a superset of the coadds that contributed to the template.

  • log (Logger | None, default: None) – Logger to use for diagnostic messages.

  • instrument (str | None, default: None) – Name of the instrument whose observations were coadded to make the templates, or None if it is not known; an unknown instrument is recorded as "UNKNOWN".

Returns:

One struct for each input coadd that overlaps the science image, sorted by tract and patch.

Return type:

list [DifferenceImageTemplateInfo]

Raises:

KeyError – Raised if a PSF component’s (tract, patch) is missing from butler_info.

See also

from_legacy

Notes

A task that builds the template has its input coadd references in hand and can call this directly. from_legacy is for a caller that has only the stored template, and reads the same provenance out of its FITS metadata.

This page was last modified on .