Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/coaddDepthMetricsWholeSkyPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}", "")
Expand All @@ -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)
Expand Down
23 changes: 23 additions & 0 deletions config/objectParentTableCoreWholeSkyPlot.py
Original file line number Diff line number Diff line change
@@ -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
5 changes: 0 additions & 5 deletions config/objectTableCoreWholeSkyPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 13 additions & 4 deletions pipelines/coaddQualityCore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
11 changes: 11 additions & 0 deletions pipelines/wholeSkyCore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions python/lsst/analysis/tools/actions/vector/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Copy link
Collaborator

@sr525 sr525 Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be any changes to coaddObjectSelector?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CoaddPlotFlagSelector? No, I don't think so. I know that you kind of came in the middle of the review without seeing the upstream changes but those columns still exist in the object table, just not the new object_parent table that is only used for the deblender metrics.



class ChildObjectSelector(RangeSelector):
Expand Down
23 changes: 15 additions & 8 deletions python/lsst/analysis/tools/atools/deblenderMetric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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": "",
}


Expand All @@ -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": "",
}


Expand Down
Loading