DonutBlitzPlotTask#
- class lsst.ts.wep.blitz.DonutBlitzPlotTask(**kwargs)#
Bases:
PipelineTaskPipelineTask regenerating diagnostic plots from a blitz catalog.
Reads
donutBlitzCornerResults. Can run standalone (reading from the butler) or be called as a subtask ofDonutBlitzCornerTaskwhensavePlots=True.runbuilds figures andputPlotswrites them, which is what lets the two contexts share one implementation: as a subtask the parent owns the quantum context and hands it toputPlots, and standalone this task’s ownrunQuantumdoes the same with its own.Runs written before that dataset type was renamed hold their catalog as
donutBlitzResults; point this task at one with-c donutBlitzPlot:connections.cornerResults=donutBlitzResults.- Parameters:
kwargs (
Any)
Methods Summary
makeDonutDiagnosticPlot(catalog)One figure with a section per detector.
makeFocalPlanePlot(catalog, detector_images, ...)The focal-plane selection plot, one panel per detector.
makeWfDiagnosticPlot(catalog)A WF diagnostic figure modeled on the AOS donut-fits layout.
putPlots(butlerQC, outputRefs, plots)Write whichever figures
runbuilt.run(catalog[, detector_images, ...])Build the diagnostic plots for one blitz visit.
runQuantum(butlerQC, inputRefs, outputRefs)Read the catalog and optional tables, then build and write plots.
Methods Documentation
- makeDonutDiagnosticPlot(catalog)#
One figure with a section per detector.
- Layout per detector:
Left column: stats text (timing, WCS scatter, donut count, errors)
Remaining columns: donut stamps (up to maxDonuts), each annotated with its SNR, shape-fraction cuts, magnitude, field angle and id
- Parameters:
catalog (QTable) – Per-donut table from
_buildCatalog. Per-detector metadata is incatalog.meta["det_meta"], keyed byf"{det_name}_{visit_id}"; visit-level scalars are incatalog.meta.- Returns:
figure – None when no detector has donuts to show.
- Return type:
matplotlib.figure.Figure or None
- makeFocalPlanePlot(catalog, detector_images, overlays)#
The focal-plane selection plot, one panel per detector.
One panel per corner sensor, each rotated by its own
n_quarterso the eight panels together read as the focal plane, arranged as a 2x2 of corners. Over each image go the three stages of the selection funnel and the donuts that survived, plus themaxFieldDistboundary; inpairedmode, lines join each intra/extra pair across its corner.Skipped with one log line when the image table is absent – the case where
DonutBlitzCornerTaskran withoutdoSelectionOutputand this task was pointed at the catalog alone.- Parameters:
catalog (QTable) – Per-donut table, read for the accepted/rejected donuts and pairing.
detector_images (QTable or None) – Per-detector binned images. None or empty skips the plot.
overlays (QTable or None) – Long-form selection sources. None draws images and donuts only.
- Returns:
figure – None when there are no detector images to draw on.
- Return type:
matplotlib.figure.Figure or None
- makeWfDiagnosticPlot(catalog)#
A WF diagnostic figure modeled on the AOS donut-fits layout.
Layout: 2×2 grid of corners (R00, R04, R40, R44). Within each corner: one row per fit result. Each row: intra data|model|resid|zk_bar extra data|model|resid|zk_bar. Zernike bars are vertical, ±1 µm, no tick labels.
- Parameters:
catalog (QTable) – Per-donut table from
_buildCatalog.- Returns:
figure – None when no fit left anything to draw.
- Return type:
matplotlib.figure.Figure or None
- putPlots(butlerQC, outputRefs, plots)#
Write whichever figures
runbuilt.The one writer of the plot datasets, reached both from this task’s
runQuantumand fromDonutBlitzCornerTask’s, so that a figure built as a subtask lands in the butler on the same terms as one built standalone.A figure is None when that plot had nothing to draw, and a ref is absent when the caller’s config switched the dataset off; both are ordinary outcomes, not errors.
- Parameters:
butlerQC (QuantumContext) – The caller’s quantum context – this task never owns one of its own when running as a subtask.
outputRefs (OutputQuantizedConnection) – The caller’s output refs, holding whichever of the three plot connections its config left in place.
plots (lsst.pipe.base.Struct) – As returned by
run.
- Return type:
- run(catalog, detector_images=None, selection_overlays=None)#
Build the diagnostic plots for one blitz visit.
The two optional tables are what the focal-plane selection plot needs. Both paths into this method supply them the same way: as a subtask,
DonutBlitzCornerTaskpasses the in-memory tables it just built, regardless of whether it also persisted them; standalone,runQuantumpasses whatever the butler had. Absent either way, that one plot is skipped and the other two are unaffected.- Parameters:
catalog (QTable) – Per-donut table as produced by
DonutBlitzCornerTask._buildCatalog. Visit-level and per-detector metadata are incatalog.meta.detector_images (QTable, optional) – Per-detector binned images, from
_build_detector_image_table.selection_overlays (QTable, optional) – Long-form selection sources, from
_build_overlay_table.
- Returns:
result –
donutDiagPlot,wfDiagPlotandselectionDiagPlot, each amatplotlib.figure.Figureor None where that plot had nothing to draw.putPlotspersists them.- Return type:
lsst.pipe.base.Struct
- runQuantum(butlerQC, inputRefs, outputRefs)#
Read the catalog and optional tables, then build and write plots.
- Parameters:
butlerQC (lsst.pipe.base.QuantumContext) – Quantum context used to fetch inputs and persist outputs.
inputRefs (lsst.pipe.base.InputQuantizedConnection) – References to this quantum’s inputs.
outputRefs (lsst.pipe.base.OutputQuantizedConnection) – References to this quantum’s outputs.
- Return type: