Skip to content

Commit

Permalink
make aperture correction registration optional
Browse files Browse the repository at this point in the history
The aperture correction registration has been done when the plugin is
instantiated because the column names are derived from the configuration
rather than being static. Sometimes you want to turn this off, e.g., when
you will use aperture corrections derived from somewhere else through the
'proxy' mechanism.
  • Loading branch information
PaulPrice committed Jul 11, 2018
1 parent 3a54830 commit 5ce7b43
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions python/lsst/meas/extensions/convolved/convolved.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ class BaseConvolvedFluxConfig(Config):
maxSincRadius = Field(dtype=float, default=10.0,
doc="Largest aperture for which to use the sinc aperture code for Kron (pixels)")
kronRadiusForFlux = Field(dtype=float, default=2.5, doc="Number of Kron radii for Kron flux")
registerForApCorr = Field(dtype=bool, default=True,
doc="Register measurements for aperture correction?\n"
"The aperture correction registration is done when the plugin is\n"
"instantiated because the column names are derived from the configuration\n"
"rather than being static. Sometimes you want to turn this off, e.g.,\n"
"when you will use aperture corrections derived from somewhere else\n"
"through the 'proxy' mechanism.")

def setDefaults(self):
Config.setDefaults(self)
Expand Down Expand Up @@ -261,11 +268,12 @@ def __init__(self, config, name, schema, metadata):
flagDefs = lsst.meas.base.FlagDefinitionList()
flagDefs.addFailureFlag("error in running ConvolvedFluxPlugin")
self.flagHandler = lsst.meas.base.FlagHandler.addFields(schema, name, flagDefs)
# Trigger aperture corrections for all flux measurements
for apName in self.config.getAllApertureResultNames(name):
lsst.meas.base.addApCorrName(apName)
for kronName in self.config.getAllKronResultNames(name):
lsst.meas.base.addApCorrName(kronName)
if self.config.registerForApCorr:
# Trigger aperture corrections for all flux measurements
for apName in self.config.getAllApertureResultNames(name):
lsst.meas.base.addApCorrName(apName)
for kronName in self.config.getAllKronResultNames(name):
lsst.meas.base.addApCorrName(kronName)

self.centroidExtractor = lsst.meas.base.SafeCentroidExtractor(schema, name)

Expand Down

0 comments on commit 5ce7b43

Please sign in to comment.