Skip to content

Commit

Permalink
Fix CalibrateTask trying to write nonexistent astrometry matches.
Browse files Browse the repository at this point in the history
The Gen 2 code checked whether the matches existed; the Gen 3
code did not.
  • Loading branch information
kfindeisen committed Mar 26, 2020
1 parent 52b617a commit 094ed12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/lsst/pipe/tasks/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def __init__(self, *, config=None):
if config.doPhotoCal is False:
self.prerequisiteInputs.remove("photoRefCat")

if config.doWriteMatches is False:
if config.doWriteMatches is False or config.doAstrometry is False:
self.outputs.remove("matches")
if config.doWriteMatchesDenormalized is False:
if config.doWriteMatchesDenormalized is False or config.doAstrometry is False:
self.outputs.remove("matchesDenormalized")


Expand All @@ -162,7 +162,7 @@ class CalibrateConfig(pipeBase.PipelineTaskConfig, pipelineConnections=Calibrate
doWriteMatches = pexConfig.Field(
dtype=bool,
default=True,
doc="Write reference matches (ignored if doWrite false)?",
doc="Write reference matches (ignored if doWrite or doAstrometry false)?",
)
doWriteMatchesDenormalized = pexConfig.Field(
dtype=bool,
Expand Down Expand Up @@ -607,7 +607,7 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):

outputs = self.run(**inputs)

if self.config.doWriteMatches:
if self.config.doWriteMatches and self.config.doAstrometry:
normalizedMatches = afwTable.packMatches(outputs.astromMatches)
normalizedMatches.table.setMetadata(outputs.matchMeta)
if self.config.doWriteMatchesDenormalized:
Expand Down

0 comments on commit 094ed12

Please sign in to comment.