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-34769: Remove characterizeImage refObjLoader #858

Merged
merged 1 commit into from
Nov 8, 2023
Merged
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
29 changes: 3 additions & 26 deletions python/lsst/pipe/tasks/characterizeImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
MeasureApCorrError,
)
from lsst.meas.algorithms.installGaussianPsf import InstallGaussianPsfTask
from lsst.meas.astrom import RefMatchTask, displayAstrometry
from lsst.meas.algorithms import LoadReferenceObjectsConfig
from lsst.meas.astrom import displayAstrometry
from lsst.meas.base import (
SingleFrameMeasurementTask,
ApplyApCorrTask,
Expand Down Expand Up @@ -195,18 +194,6 @@ class CharacterizeImageConfig(pipeBase.PipelineTaskConfig,
target=InstallGaussianPsfTask,
doc="Install a simple PSF model",
)
refObjLoader = pexConfig.ConfigField(
dtype=LoadReferenceObjectsConfig,
deprecated="This field does nothing. Will be removed after v24 (see DM-34768).",
doc="reference object loader",
)
ref_match = pexConfig.ConfigurableField(
target=RefMatchTask,
deprecated="This field was never usable. Will be removed after v24 (see DM-34768).",
doc="Task to load and match reference objects. Only used if measurePsf can use matches. "
"Warning: matching will only work well if the initial WCS is accurate enough "
"to give good matches (roughly: good to 3 arcsec across the CCD).",
)
measurePsf = pexConfig.ConfigurableField(
target=MeasurePsfTask,
doc="Measure PSF",
Expand Down Expand Up @@ -288,8 +275,6 @@ class CharacterizeImageTask(pipeBase.PipelineTask):

Parameters
----------
refObjLoader : `lsst.meas.algorithms.ReferenceObjectLoader`, optional
Reference object loader if using a catalog-based star-selector.
schema : `lsst.afw.table.Schema`, optional
Initial schema for icSrc catalog.
**kwargs
Expand Down Expand Up @@ -321,7 +306,7 @@ class CharacterizeImageTask(pipeBase.PipelineTask):
ConfigClass = CharacterizeImageConfig
_DefaultName = "characterizeImage"

def __init__(self, refObjLoader=None, schema=None, **kwargs):
def __init__(self, schema=None, **kwargs):
super().__init__(**kwargs)

if schema is None:
Expand All @@ -333,9 +318,6 @@ def __init__(self, refObjLoader=None, schema=None, **kwargs):
if self.config.doMaskStreaks:
self.makeSubtask("maskStreaks")
self.makeSubtask("measurePsf", schema=self.schema)
# TODO DM-34769: remove this `if` block
if self.config.doMeasurePsf and self.measurePsf.usesMatches:
self.makeSubtask("ref_match", refObjLoader=refObjLoader)
self.algMetadata = dafBase.PropertyList()
self.makeSubtask('detection', schema=self.schema)
if self.config.doDeblend:
Expand Down Expand Up @@ -565,12 +547,7 @@ def detectMeasureAndEstimatePsf(self, exposure, idGenerator, background):

measPsfRes = pipeBase.Struct(cellSet=None)
if self.config.doMeasurePsf:
# TODO DM-34769: remove this `if` block, and the `matches` kwarg from measurePsf.run below.
if self.measurePsf.usesMatches:
matches = self.ref_match.loadAndMatch(exposure=exposure, sourceCat=sourceCat).matches
else:
matches = None
measPsfRes = self.measurePsf.run(exposure=exposure, sources=sourceCat, matches=matches,
measPsfRes = self.measurePsf.run(exposure=exposure, sources=sourceCat,
expId=idGenerator.catalog_id)
self.display("measure_iter", exposure=exposure, sourceCat=sourceCat)

Expand Down