diff --git a/config/coaddDepthMetricsWholeSkyPlot.py b/config/coaddDepthMetricsWholeSkyPlot.py index eadd549ad..c1d3b3722 100644 --- a/config/coaddDepthMetricsWholeSkyPlot.py +++ b/config/coaddDepthMetricsWholeSkyPlot.py @@ -10,7 +10,7 @@ "coadd_depth_summary_metrics_depth_above_threshold_3_{band}_mean", "coadd_depth_summary_metrics_depth_above_threshold_5_{band}_mean", "coadd_depth_summary_metrics_depth_above_threshold_12_{band}_mean", - ] +] for key in keysWithBand: atoolName = key.replace("_{band}", "") @@ -19,7 +19,7 @@ atool = getattr(config.atools, atoolName) setattr(atool, "metric", key) - plot = getattr(getattr(atool, 'produce'), 'plot') + plot = getattr(getattr(atool, "produce"), "plot") setattr(plot, "showOutliers", False) setattr(plot, "showNaNs", False) setattr(plot, "labelTracts", True) diff --git a/config/objectParentTableCoreWholeSkyPlot.py b/config/objectParentTableCoreWholeSkyPlot.py new file mode 100644 index 000000000..1068d2712 --- /dev/null +++ b/config/objectParentTableCoreWholeSkyPlot.py @@ -0,0 +1,23 @@ +# Configuration for instances of lsst.analysis.tools.tasks.WholeSkyAnalysisTask +# that aggregates metrics from objectParentTableCore analysis. + +from lsst.analysis.tools.atools import WholeSkyPlotTool + +# Keys without `band` +keys = [ + "skippedDeblenderMetrics_numSkippedPeaks", + "skippedDeblenderMetrics_numSkippedBlends", + "skippedDeblenderMetrics_numBlendParentTooBig", + "skippedDeblenderMetrics_numBlendTooManyPeaks", + "skippedDeblenderMetrics_numBlendTooManyMasked", +] +if hasattr(parameters, "objectParentTableCoreWholeSkyPlotKeys"): + keys = parameters.objectParentTableCoreWholeSkyPlotKeys + +for atoolName in keys: + setattr(config.atools, atoolName, WholeSkyPlotTool) + atool = getattr(config.atools, atoolName) + setattr(atool, "metric", atoolName) + setattr(atool, "parameterizedBand", False) + +config.addOutputNamePrefix = True diff --git a/config/objectTableCoreWholeSkyPlot.py b/config/objectTableCoreWholeSkyPlot.py index cdfd47982..add625e90 100644 --- a/config/objectTableCoreWholeSkyPlot.py +++ b/config/objectTableCoreWholeSkyPlot.py @@ -40,11 +40,6 @@ "wPerpPSF_wPerp_psfFlux_sigmaMAD", "yPerpPSF_yPerp_psfFlux_median", "yPerpPSF_yPerp_psfFlux_sigmaMAD", - "skippedDeblenderMetrics_numSkippedPeaks", - "skippedDeblenderMetrics_numSkippedBlends", - "skippedDeblenderMetrics_numBlendParentTooBig", - "skippedDeblenderMetrics_numBlendTooManyPeaks", - "skippedDeblenderMetrics_numBlendTooManyMasked", ] if hasattr(parameters, "objectTableCoreWholeSkyPlotKeys"): keys = parameters.objectTableCoreWholeSkyPlotKeys diff --git a/pipelines/coaddQualityCore.yaml b/pipelines/coaddQualityCore.yaml index edcde2652..128f86840 100644 --- a/pipelines/coaddQualityCore.yaml +++ b/pipelines/coaddQualityCore.yaml @@ -10,10 +10,6 @@ tasks: atools.e2Diff: E2DiffScatter # shapes.py atools.skyFluxStatisticMetric: SkyFluxStatisticMetric atools.skyFluxStatisticMetric.applyContext: CoaddContext - atools.parentDeblenderMetrics: ParentDeblenderMetrics - atools.skippedDeblenderMetrics: SkippedDeblenderMetrics - atools.blendMetrics: BlendMetrics - atools.isolatedDeblenderMetrics: IsolatedDeblenderMetrics atools.wPerpPSF: WPerpPSF atools.wPerpCModel: WPerpCModel atools.xPerpPSF: XPerpPSF @@ -73,6 +69,19 @@ tasks: python: | from lsst.analysis.tools.atools import * from lsst.analysis.tools.contexts import * + analyzeObjectParentTableCore: + class: lsst.analysis.tools.tasks.ObjectTableTractAnalysisTask + config: + connections.data: object_parent + connections.inputName: object_parent + connections.outputName: objectParentTableCore + atools.parentDeblenderMetrics: ParentDeblenderMetrics + atools.skippedDeblenderMetrics: SkippedDeblenderMetrics + atools.blendMetrics: BlendMetrics + atools.isolatedDeblenderMetrics: IsolatedDeblenderMetrics + python: | + from lsst.analysis.tools.atools import * + from lsst.analysis.tools.contexts import * analyzeObjectTableSurveyCore: class: lsst.analysis.tools.tasks.ObjectTableSurveyAnalysisTask config: diff --git a/pipelines/wholeSkyCore.yaml b/pipelines/wholeSkyCore.yaml index 3feeb8b28..99ec05c37 100644 --- a/pipelines/wholeSkyCore.yaml +++ b/pipelines/wholeSkyCore.yaml @@ -10,6 +10,17 @@ tasks: class: lsst.analysis.tools.tasks.WholeSkyAnalysisTask config: file: $ANALYSIS_TOOLS_DIR/config/objectTableCoreWholeSkyPlot.py + makeMetricTableObjectParentTableCore: + class: lsst.analysis.tools.tasks.MakeMetricTableTask + config: + connections.metricBundleName: "objectParentTableCore_metrics" + connections.outputTableName: "objectParentTableCore_metricsTable" + objectParentTableCoreWholeSkyPlot: + class: lsst.analysis.tools.tasks.WholeSkyAnalysisTask + config: + connections.inputName: "objectParentTableCore_metricsTable" + connections.outputName: "objectParentTableCore_wholeSky" + file: $ANALYSIS_TOOLS_DIR/config/objectParentTableCoreWholeSkyPlot.py makeMetricTableObjectTableCoreRefCatMatch: class: lsst.analysis.tools.tasks.MakeMetricTableTask config: diff --git a/python/lsst/analysis/tools/actions/vector/selectors.py b/python/lsst/analysis/tools/actions/vector/selectors.py index b03b7ef8a..3e1dabddc 100644 --- a/python/lsst/analysis/tools/actions/vector/selectors.py +++ b/python/lsst/analysis/tools/actions/vector/selectors.py @@ -616,10 +616,8 @@ class ParentObjectSelector(FlagSelector): def setDefaults(self): # This selects all of the parents self.selectWhenFalse = [ - "detect_isDeblendedModelSource", "sky_object", ] - self.selectWhenTrue = ["detect_isPatchInner"] class ChildObjectSelector(RangeSelector): diff --git a/python/lsst/analysis/tools/atools/deblenderMetric.py b/python/lsst/analysis/tools/atools/deblenderMetric.py index 028b8f09b..98e45c40e 100644 --- a/python/lsst/analysis/tools/atools/deblenderMetric.py +++ b/python/lsst/analysis/tools/atools/deblenderMetric.py @@ -72,13 +72,20 @@ def setDefaults(self): self.prep.selectors.parentSelector = ParentObjectSelector() self.prep.selectors.skippedSelector = FlagSelector() self.prep.selectors.skippedSelector.selectWhenTrue = ["deblend_skipped"] - self.prep.selectors.skippedSelector.selectWhenFalse = ["deblend_failed", "deblend_isolatedParent"] + self.prep.selectors.skippedSelector.selectWhenFalse = [ + "deblend_failed", + "deblend_skipped_isolatedParent", + ] # Statistics for skipped blends self.process.calculateActions.numSkippedBlends = CountAction(vectorKey="parentObjectId") - self.process.calculateActions.numBlendParentTooBig = SumAction(vectorKey="deblend_parentTooBig") - self.process.calculateActions.numBlendTooManyPeaks = SumAction(vectorKey="deblend_tooManyPeaks") - self.process.calculateActions.numBlendTooManyMasked = SumAction(vectorKey="deblend_masked") + self.process.calculateActions.numBlendParentTooBig = SumAction( + vectorKey="deblend_skipped_parentTooBig" + ) + self.process.calculateActions.numBlendTooManyPeaks = SumAction( + vectorKey="deblend_skipped_tooManyPeaks" + ) + self.process.calculateActions.numBlendTooManyMasked = SumAction(vectorKey="deblend_skipped_masked") # Total number of skipped peaks self.process.calculateActions.numSkippedPeaks = SumAction(vectorKey="deblend_nPeaks") @@ -111,12 +118,12 @@ def setDefaults(self): # Statistics for blended parents self.process.calculateActions.numBlends = CountAction(vectorKey="parentObjectId") self.process.calculateActions.meanBlendIterations = MeanAction(vectorKey="deblend_iterations") - self.process.calculateActions.meanBlendLogL = MeanAction(vectorKey="deblend_logL") + self.process.calculateActions.meanBlendChi2 = MeanAction(vectorKey="deblend_chi2") self.produce.metric.units = { "numBlends": "", "meanBlendIterations": "", - "meanBlendLogL": "", + "meanBlendChi2": "", } @@ -138,12 +145,12 @@ def setDefaults(self): # Statistics for isolated parent scarlet_lite models self.process.calculateActions.numIsolated = CountAction(vectorKey="parentObjectId") self.process.calculateActions.meanIsolatedIterations = MeanAction(vectorKey="deblend_iterations") - self.process.calculateActions.meanIsolatedLogL = MeanAction(vectorKey="deblend_logL") + self.process.calculateActions.meanIsolatedChi2 = MeanAction(vectorKey="deblend_chi2") self.produce.metric.units = { "numIsolated": "", "meanIsolatedIterations": "", - "meanIsolatedLogL": "", + "meanIsolatedChi2": "", }