display_coadd_coverage#
- lsst.analysis.ap.display_coadd_coverage(butler, visit, detector, backend='firefly', *, patch_extent='full', patch_margin=100, show_diffim_outline=True, show_patch_outlines=True, diffim_ctype='red', label_size=1.5, mask_transparency=80, strip_metadata=True, align='Standard', skymap_name=None, image_datasets={'difference': 'difference_image', 'science': 'preliminary_visit_image', 'template': 'template_detector'}, coadd_dataset='template_coadd', dry_run=False)#
Display a difference image alongside every coadd patch that went into its template.
Frame 0 shows the difference image, with the outline of each contributing patch drawn and labeled
tract,patch. Frames 1..N show the coadd patches themselves, one per frame in(tract, patch)order, each with the difference image’s footprint outlined on it.The contributing patches are read from the template’s
coaddInputs, whichGetTemplateTaskfills with one record per patch that supplied valid pixels. That is a stricter set than a skymap lookup would give: patches that overlap the detector geometrically but contributed nothing were already dropped when the template was built.Parameters#
- butler
lsst.daf.butler.Butler Butler to load data from.
- visit, detector
int Visit and detector ids to load data for.
- backend
str, optional afw display backend (typically “firefly” or “ds9”).
- patch_extent{“full”, “overlap”}, optional
How much of each coadd to display.
"full"(default) shows the whole patch, which is what puts the detector’s footprint in context but sends a full-size coadd to the backend per frame;"overlap"trims each patch to the difference image’s footprint pluspatch_margin, which is much faster to display but makes every frame look alike.- patch_margin
int, optional Pixels of coadd to keep around the difference image’s footprint when
patch_extent="overlap". Ignored for"full".- show_diffim_outline
bool, optional If True, outline the difference image’s footprint on each coadd frame, labeled
visit,detector.- show_patch_outlines
bool, optional If True, outline each contributing patch on the difference-image frame, labeled
tract,patch. Outlines are drawn for missing coadds too, since the geometry comes from the template’s records rather than from the coadd itself.- diffim_ctype
str, optional Display color for the difference-image outline. The patch outlines cycle through a fixed palette instead, so that a patch’s color on frame 0 identifies its own frame in the printed legend.
- label_size
float, optional Text size for the outline labels.
- mask_transparency
intorNone, optional Mask-plane transparency forwarded to the display (0 = opaque, 100 = fully transparent). Pass
Noneto leave the backend’s current setting untouched.- strip_metadata
bool, optional Drop
LTV1/LTV2keywords from each exposure’s metadata before sending to the backend. Needed for ds9 to align frames.- align
strorNone, optional match_typepassed toalignImages. Defaults to"Standard"(align by WCS) rather than the pixel matchingdisplay_imagesuses, because these frames do not share a pixel grid. Pass None to leave the frames unaligned.- skymap_name
str, optional Skymap the coadds live in. Only needed when the contributing tracts and patches match coadds in more than one skymap, which is an error otherwise.
- image_datasets
dict[str,str], optional Mapping from image-type key (
"science","template","difference") to butler dataset name. Only the"template"and"difference"entries are used here; the template is read as a.coaddInputscomponent, so its pixels are never loaded.- coadd_dataset
str, optional Dataset name of the coadds the template was built from. The default matches what
ApPipe.yamlbinds to the template task’scoaddExposuresinput.- dry_run
bool, optional If True, work out which patches contributed and print the legend, but skip constructing the afw display and loading any pixels. Useful for checking a template’s provenance without a viewer. Default False.
- butler