display_images#
- lsst.analysis.ap.display_images(butler, visit, detector, backend='firefly', *, reliability_threshold=0.1, show_unfiltered=True, show_trailed=True, show_rejected=True, show_standardized=True, show_marginal=True, show_kernel_sources=True, show_solar_system=True, show_apdb=True, show_reliability_labels=True, show_dipoles=True, show_trail_geometry=True, line_length_scale=1.0, label_size=3, color_by=None, unfiltered_style='footprint', mask_transparency=80, strip_metadata=True, skymap=None, skymap_ctype='green', skymap_label_size=1.5, image_datasets={'difference': 'difference_image', 'science': 'preliminary_visit_image', 'template': 'template_detector'}, use_fakes=False, dry_run=False)#
Display the science, template, and difference images for a given visit+detector with diagnostic catalog markers overlaid.
Three frames are produced (science, template, difference) and the same overlays are drawn on each. Catalogs that are missing from the butler are silently skipped, so the same call works against partial outputs.
Default overlay key. Rows are in AP-pipeline creation order, so the last marker drawn at any pixel reflects the latest classification the pipeline assigned. Circle sizes step by 2 so successive
omarkers nest rather than stack.catalog
symbol
size
color
psf-matching kernel sources
o12
green
unfiltered candidates
footprint
–
red (
unfiltered_style)rejected diaSources
+10
orange
long-trailed sources
x30
magenta
standardized diaSources
+10
blue
APDB, reliability > threshold
o14
blue (+ score text)
APDB, reliability ≤ threshold
o14
red
solar-system matches
o16
cyan
marginal new diaSources
+10
yellow
By default the
dia_source_unfilteredcatalog is drawn as Firefly footprint outlines rather than+markers; seeunfiltered_style.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”).
- reliability_threshold
float, optional APDB diaSources with reliability strictly greater than this are drawn as “good” (blue); the rest as “bad” (red).
show_unfiltered, show_trailed, show_rejected, show_standardized, show_marginal, show_kernel_sources, show_solar_system, show_apdb :
bool, optionalToggle individual catalog overlays.
show_kernel_sourcesloadsdifference_kernel_sources, the PSF-matching constraint sources from image subtraction — useful for seeing where the kernel was actually anchored vs extrapolated.- show_reliability_labels
bool, optional If True, annotate each good APDB diaSource with its reliability score.
- show_dipoles
bool, optional If True, draw a 10-px white line segment through each source in
dia_source_unfilteredwithip_diffim_DipoleFit_classificationset, oriented alongip_diffim_DipoleFit_orientation(radians, detector-frame). The length is fixed rather than measured becauseip_diffim_DipoleFit_separationis sub-pixel for the vast majority of classified dipoles; the line is a fixed-size marker of orientation rather than a physical extent. Sourced from the unfiltered catalog rather than the standardized or APDB catalogs becausefilterDiaSourceremoves dipoles before those stages.- show_trail_geometry
bool, optional If True, draw a magenta line segment along
ext_trailedSources_Naive_anglewith lengthext_trailedSources_Naive_lengthfor every source india_source_unfilteredwhose trail length exceeds 3 px. Long-trailed sources removed byfilterDiaSourcestill show up separately undershow_trailedasxmarkers.- line_length_scale
float, optional Multiplicative factor applied to the drawn length of the trail line segments after the 3 px trail filter, so a below-threshold trail stays hidden regardless of the scale. Does not affect the dipole marker, which is drawn at a fixed 10 px length by design. Default 1.0 (draw trails at their measured length); use larger values to make short trails easier to see against the image.
- label_size
int, optional Text size (in pixels) for the reliability score and solar-system designation annotations.
- color_bysequence of
str, optional Flag column names from
dia_source_unfiltered. When supplied, the unfiltered-candidate overlay is split into buckets colored by which named flag fires first (list order = color and priority), with a residual white bucket for rows that match none of them. Unknown column names are silently skipped. Applies whether the unfiltered catalog is drawn as footprints or markers. Example:color_by=["pixelFlags_bad", "pixelFlags_edge", "ip_diffim_DipoleFit_classification", "pixelFlags_saturated"]
- unfiltered_style{“footprint”, “marker”}, optional
How to draw
dia_source_unfiltered."footprint"(default) overlays each source’sFootprintoutline using Firefly’s native footprint rendering;"marker"draws the old red+markers. Footprints need the"firefly"backend, so any other backend (e.g. ds9) silently falls back to markers. Two caveats with footprints, both warned about at call time: (1) when combined withcolor_by, footprint layers from a previous call are not auto-erased (Firefly offers no way to delete or enumerate them), so clearing them before re-running is your responsibility; (2) switchingunfiltered_stylefrom"footprint"to"marker"leaves the previous footprints on the frame — re-run in footprint mode or reset the frame to clear them. Re-running in the default (nocolor_by) footprint mode overwrites the single layer in place, so it is unaffected.- 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.- skymap
lsst.skymap.BaseSkyMap, optional If supplied, overlay the boundaries of every tract/patch that touches each frame, labeled
tract,patch.- skymap_ctype
str, optional Display color for the tract/patch outlines and labels.
- skymap_label_size
float, optional Text size for the
tract,patchlabels.- image_datasets
dict[str,str], optional Mapping from image-type key (
"science","template","difference") to butler dataset name. Override to point at alternate dataset types.- use_fakes
bool, optional If True, load the fake-source-injected versions of the science and template images:
fakes_prefix on the science dataset andinjectedTemplate_prefix on the template dataset. The difference image and every catalog keep their non-prefixed names, per the fake-source pipeline’s output convention. Default False.- dry_run
bool, optional If True, load every requested image and catalog and print the overlay/footprint legends, but skip constructing the afw display and drawing anything. Useful for sanity-checking which datasets are available for a (visit, detector) without opening a viewer. Default False.
- butler