Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-2850: Remove getSchemaCatalogs methods #732

Merged
merged 1 commit into from
Nov 18, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions python/lsst/pipe/tasks/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,14 +680,6 @@ def run(self, exposure, exposureIdInfo=None, background=None,
outputBackground=background,
)

def getSchemaCatalogs(self):
"""Return a dict of empty catalogs for each catalog dataset produced
by this task.
"""
sourceCat = afwTable.SourceCatalog(self.schema)
sourceCat.getTable().setMetadata(self.algMetadata)
return {"src": sourceCat}

def setMetadata(self, exposure, photoRes=None):
"""Set task and exposure metadata.

Expand Down
9 changes: 1 addition & 8 deletions python/lsst/pipe/tasks/characterizeImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import lsst.daf.base as dafBase
import lsst.pipe.base.connectionTypes as cT
from lsst.afw.math import BackgroundList
from lsst.afw.table import SourceTable, SourceCatalog
from lsst.afw.table import SourceTable
from lsst.meas.algorithms import SubtractBackgroundTask, SourceDetectionTask, MeasureApCorrTask
from lsst.meas.algorithms.installGaussianPsf import InstallGaussianPsfTask
from lsst.meas.astrom import RefMatchTask, displayAstrometry
Expand Down Expand Up @@ -532,13 +532,6 @@ def detectMeasureAndEstimatePsf(self, exposure, exposureIdInfo, background):
psfCellSet=measPsfRes.cellSet,
)

def getSchemaCatalogs(self):
"""Return a dict of empty catalogs for each catalog dataset produced by this task.
"""
sourceCat = SourceCatalog(self.schema)
sourceCat.getTable().setMetadata(self.algMetadata)
return {"icSrc": sourceCat}

def display(self, itemName, exposure, sourceCat=None):
"""Display exposure and sources on next frame (for debugging).

Expand Down
13 changes: 0 additions & 13 deletions python/lsst/pipe/tasks/mergeDetections.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,19 +363,6 @@ def cullPeaks(self, catalog):
culledPeaks += 1
self.log.info("Culled %d of %d peaks", culledPeaks, totalPeaks)

def getSchemaCatalogs(self):
"""Return a dict of empty catalogs for each catalog dataset produced by this task.

Returns
----------
dictionary : `dict`
Dictionary of empty catalogs.
"""
mergeDet = afwTable.SourceCatalog(self.schema)
peak = afwDetect.PeakCatalog(self.merged.getPeakSchema())
return {self.config.coaddName + "Coadd_mergeDet": mergeDet,
self.config.coaddName + "Coadd_peak": peak}

def getSkySourceFootprints(self, mergedList, skyInfo, seed):
"""Return a list of Footprints of sky objects which don't overlap with anything in mergedList.

Expand Down
4 changes: 1 addition & 3 deletions python/lsst/pipe/tasks/multiBand.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# NOTE: these imports are a convenience so multiband users only have to import this file.
from .mergeDetections import MergeDetectionsConfig, MergeDetectionsTask # noqa: F401
from .mergeMeasurements import MergeMeasurementsConfig, MergeMeasurementsTask # noqa: F401
from .multiBandUtils import CullPeaksConfig, _makeGetSchemaCatalogs # noqa: F401
from .multiBandUtils import CullPeaksConfig # noqa: F401
from .deblendCoaddSourcesPipeline import DeblendCoaddSourcesSingleConfig # noqa: F401
from .deblendCoaddSourcesPipeline import DeblendCoaddSourcesSingleTask # noqa: F401
from .deblendCoaddSourcesPipeline import DeblendCoaddSourcesMultiConfig # noqa: F401
Expand Down Expand Up @@ -164,7 +164,6 @@ class DetectCoaddSourcesTask(PipelineTask):

_DefaultName = "detectCoaddSources"
ConfigClass = DetectCoaddSourcesConfig
getSchemaCatalogs = _makeGetSchemaCatalogs("det")

def __init__(self, schema=None, **kwargs):
# N.B. Super is used here to handle the multiple inheritance of PipelineTasks, the init tree
Expand Down Expand Up @@ -530,7 +529,6 @@ class MeasureMergedCoaddSourcesTask(PipelineTask):

_DefaultName = "measureCoaddSources"
ConfigClass = MeasureMergedCoaddSourcesConfig
getSchemaCatalogs = _makeGetSchemaCatalogs("meas")

def __init__(self, butler=None, schema=None, peakSchema=None, refObjLoader=None, initInputs=None,
**kwargs):
Expand Down
20 changes: 0 additions & 20 deletions python/lsst/pipe/tasks/multiBandUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,9 @@

__all__ = ["CullPeaksConfig"]

import lsst.afw.table as afwTable

from lsst.pex.config import Config, RangeField


def _makeGetSchemaCatalogs(datasetSuffix):
"""Construct a getSchemaCatalogs instance method

These are identical for most of the classes here, so we'll consolidate
the code.

datasetSuffix: Suffix of dataset name, e.g., "src" for "deepCoadd_src"
"""

def getSchemaCatalogs(self):
"""Return a dict of empty catalogs for each catalog dataset produced by this task."""
src = afwTable.SourceCatalog(self.schema)
if hasattr(self, "algMetadata"):
src.getTable().setMetadata(self.algMetadata)
return {self.config.coaddName + "Coadd_" + datasetSuffix: src}
return getSchemaCatalogs


class CullPeaksConfig(Config):
"""Configuration for culling garbage peaks after merging footprints.

Expand Down