Skip to content

Commit

Permalink
Only add the invalid psf flag if it is not present in the schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed May 7, 2024
1 parent 3beeb9b commit 743cd87
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions python/lsst/meas/base/baseMeasurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,15 @@ def initializePlugins(self, **kwds):
else:
schema = kwds["schema"]

self.keyInvalidPsf = schema.addField(
"base_InvalidPsf_flag",
type="Flag",
doc="Invalid PSF at this location.",
)
invalidPsfName = "base_InvalidPsf_flag"
if invalidPsfName in schema:
self.keyInvalidPsf = schema.find(invalidPsfName).key
else:
self.keyInvalidPsf = schema.addField(
invalidPsfName,
type="Flag",
doc="Invalid PSF at this location.",
)

def callMeasure(self, measRecord, *args, **kwds):
"""Call ``measure`` on all plugins and consistently handle exceptions.
Expand Down

0 comments on commit 743cd87

Please sign in to comment.