subtraction_quality_report#

lsst.analysis.ap.subtraction_quality_report(metrics, bad_mask_threshold=0.2, bad_mask_columns=('bad_mask_fraction', 'sat_mask_fraction', 'edge_mask_fraction', 'no_data_mask_fraction'), chi2_scale=1.0, skymap=None, label_fontsize=7, panel_padding_pix=150)#

Print a headline metric summary and build the diagnostic plot.

Parameters#

metricsastropy.table.Table or pandas.DataFrame

The metrics table produced by SpatiallySampledMetricsTask for a single detector.

bad_mask_thresholdfloat, optional

Samples whose summed mask fractions across bad_mask_columns meet or exceed this value are dropped before computing statistics and rendering the figure.

bad_mask_columnsiterable of str, optional

Names of mask-fraction columns to sum when deciding whether a sample sits on a usable patch of the detector. Columns missing from the input table are silently ignored.

chi2_scalefloat, optional

Multiplicative half-width of the diffim_chi2PerPix colormap around its nominal value of 1.0. The colorbar covers [1/(1+chi2_scale), 1+chi2_scale] so a deviation by a factor of (1+chi2_scale) above or below 1 sits at the colormap extremes.

skymaplsst.skymap.BaseSkyMap, optional

If supplied, overlay the boundaries of every patch that touches the detector footprint on each panel, with a tract,patch label anchored just inside the lower-left corner of each patch. The local sky↔pixel mapping is inferred from the sample positions’ (x, y) and (coord_ra, coord_dec) columns via a least-squares affine fit, so the alignment is approximate When omitted, no outlines are drawn.

label_fontsizeint or float, optional

Font size for the per-patch tract,patch labels. Only used when skymap is supplied. Default 7.

panel_padding_pixfloat, optional

Detector-pixel buffer added on each side of every panel beyond the autoscaled data limits.

Returns#

figmatplotlib.figure.Figure

The 1x3 diagnostic figure (diffim_chi2PerPix, PSF match residual, dipole density). The kernel centroid offset quiver is overlaid on every panel, with a quiverkey reference arrow.

Notes#

The headline summary is printed via print, so the function is intended for direct use in a notebook cell. Pass the returned figure to fig.savefig(...) if you want to persist the diagnostic.