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#
- metrics
astropy.table.Tableorpandas.DataFrame The metrics table produced by
SpatiallySampledMetricsTaskfor a single detector.- bad_mask_threshold
float, optional Samples whose summed mask fractions across
bad_mask_columnsmeet 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_scale
float, optional Multiplicative half-width of the
diffim_chi2PerPixcolormap 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.- skymap
lsst.skymap.BaseSkyMap, optional If supplied, overlay the boundaries of every patch that touches the detector footprint on each panel, with a
tract,patchlabel 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_fontsize
intorfloat, optional Font size for the per-patch
tract,patchlabels. Only used whenskymapis supplied. Default 7.- panel_padding_pix
float, optional Detector-pixel buffer added on each side of every panel beyond the autoscaled data limits.
Returns#
- fig
matplotlib.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 tofig.savefig(...)if you want to persist the diagnostic.- metrics