diff --git a/pipelines/_ingredients/MetricsRuntime.yaml b/pipelines/_ingredients/MetricsRuntime.yaml index 479e0eaa..79435936 100644 --- a/pipelines/_ingredients/MetricsRuntime.yaml +++ b/pipelines/_ingredients/MetricsRuntime.yaml @@ -119,6 +119,13 @@ tasks: connections.metric: PackageAlertsTime connections.labelName: diaPipe target: diaPipe:alertPackager.run + timing_filterDiaSrcCat: + class: lsst.verify.tasks.commonMetrics.TimingMetricTask + config: + connections.package: ap_association + connections.metric: FilterDiaSourceCatalogTime + connections.labelName: filterDiaSrcCat + target: filterDiaSrcCat.run cputiming_isr: class: lsst.verify.tasks.commonMetrics.CpuTimingMetricTask config: @@ -233,6 +240,13 @@ tasks: connections.metric: PackageAlertsCpuTime connections.labelName: diaPipe target: diaPipe:alertPackager.run + cputiming_filterDiaSrcCat: + class: lsst.verify.tasks.commonMetrics.TimingMetricTask + config: + connections.package: ap_association + connections.metric: FilterDiaSourceCatalogCpuTime + connections.labelName: filterDiaSrcCat + target: filterDiaSrcCat.run memory_apPipe: class: lsst.verify.tasks.commonMetrics.MemoryMetricTask config: @@ -253,4 +267,4 @@ tasks: connections.package: ap_association connections.metric: PackageAlertsMemory connections.labelName: diaPipe - target: diaPipe:alertPackager.run + target: diaPipe:alertPackager.run \ No newline at end of file diff --git a/python/lsst/ap/verify/testPipeline.py b/python/lsst/ap/verify/testPipeline.py index b328bfbe..b764bf53 100644 --- a/python/lsst/ap/verify/testPipeline.py +++ b/python/lsst/ap/verify/testPipeline.py @@ -39,7 +39,8 @@ from lsst.ip.diffim import GetTemplateConfig, AlardLuptonSubtractConfig, DetectAndMeasureConfig from lsst.pipe.tasks.characterizeImage import CharacterizeImageConfig from lsst.pipe.tasks.calibrate import CalibrateConfig -from lsst.ap.association import TransformDiaSourceCatalogConfig, DiaPipelineConfig +from lsst.ap.association import (TransformDiaSourceCatalogConfig, + DiaPipelineConfig, FilterDiaSourceCatalogConfig) class MockIsrTask(PipelineTask): @@ -433,6 +434,30 @@ def run(self, science, matchedTemplate, difference, ) +class MockFilterDiaSourceCatalogTask(PipelineTask): + """A do-nothing substitute for FilterDiaSourceCatalogTask. + """ + ConfigClass = FilterDiaSourceCatalogConfig + _DefaultName = "notFilterDiaSourceCatalog" + + def run(self, diaSourceCat): + """Produce filtering outputs with no processing. + + Parameters + ---------- + diaSourceCat : `lsst.afw.table.SourceCatalog` + Catalog of sources measured on the difference image. + + Returns + ------- + results : `lsst.pipe.base.Struct` + Results struct with components. + """ + return Struct(filteredDiaSourceCat=afwTable.SourceCatalog(), + rejectedDiaSources=afwTable.SourceCatalog(), + ) + + class MockTransformDiaSourceCatalogTask(PipelineTask): """A do-nothing substitute for TransformDiaSourceCatalogTask. """ diff --git a/tests/MockApPipe.yaml b/tests/MockApPipe.yaml index 73b0aa80..d906c865 100644 --- a/tests/MockApPipe.yaml +++ b/tests/MockApPipe.yaml @@ -35,6 +35,11 @@ tasks: config: connections.coaddName: parameters.coaddName doSkySources: True + filterDiaSrcCat: + class: lsst.ap.verify.testPipeline.MockFilterDiaSourceCatalogTask + config: + doRemoveSkySources: True + connections.coaddName: parameters.coaddName transformDiaSrcCat: class: lsst.ap.verify.testPipeline.MockTransformDiaSourceCatalogTask config: @@ -61,6 +66,8 @@ contracts: - detectAndMeasure.connections.ConnectionsClass(config=detectAndMeasure).subtractedMeasuredExposure.name == transformDiaSrcCat.connections.ConnectionsClass(config=transformDiaSrcCat).diffIm.name - detectAndMeasure.connections.ConnectionsClass(config=detectAndMeasure).diaSources.name == + filterDiaSrcCat.connections.ConnectionsClass(config=filterDiaSrcCat).diaSourceCat.name + - filterDiaSrcCat.connections.ConnectionsClass(config=filterDiaSrcCat).filteredDiaSourceCat.name == transformDiaSrcCat.connections.ConnectionsClass(config=transformDiaSrcCat).diaSourceCat.name - detectAndMeasure.connections.ConnectionsClass(config=detectAndMeasure).subtractedMeasuredExposure.name == diaPipe.connections.ConnectionsClass(config=diaPipe).diffIm.name