Skip to content

Commit

Permalink
Homogenize naming of calibration flags
Browse files Browse the repository at this point in the history
This implements RFC-498 and includes:
   - calib_psfUsed -> calib_psf_used
   - calib_psfCandidate -> calib_psf_candidate
   - calib_astrometryUsed -> calib_astrometry_used

to match the other exsiting flags:
   - calib_photometry_used
   - calib_photometry_reserved

and to match the recently updated documentation in afw/doc/table.dox, in
particular: "if the prefix of a field name represents a conceptual group
of multiple fields, use underscores to join the group name to the group
elements."
  • Loading branch information
laurenam committed Aug 7, 2018
1 parent 3605315 commit 4fa9783
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/lsst/meas/algorithms/flaggedSourceSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

class FlaggedSourceSelectorConfig(BaseSourceSelectorTask.ConfigClass):
field = lsst.pex.config.Field(
dtype=str, default="calib_psfUsed",
dtype=str, default="calib_psf_used",
doc="Name of a flag field that is True for Sources that should be used.",
)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_flaggedSourceSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def addGoodSource(src, num=0):
record['slot_Centroid_y'] = 20. + num
record['slot_ApFlux_flux'] = 100. + num
record['slot_ApFlux_fluxErr'] = 1.
record.set("calib_psfUsed", True)
record.set("calib_psf_used", True)


class TestFlaggedSourceSelector(lsst.utils.tests.TestCase):
Expand All @@ -50,7 +50,7 @@ def setUp(self):
schema = lsst.meas.base.tests.TestDataset.makeMinimalSchema()
schema.addField("slot_ApFlux_flux", type=float)
schema.addField("slot_ApFlux_fluxErr", type=float)
schema.addField("calib_psfUsed", type="Flag")
schema.addField("calib_psf_used", type="Flag")

self.src = afwTable.SourceCatalog(schema)
self.sourceSelector = sourceSelector.sourceSelectorRegistry['flagged']()
Expand All @@ -72,7 +72,7 @@ def testSelectSourcesBad(self):
that our output array is indeed empty.
"""
addGoodSource(self.src, 1)
self.src[0].set('calib_psfUsed', False)
self.src[0].set('calib_psf_used', False)
result = self.sourceSelector.run(self.src)
self.assertNotIn(self.src['id'][0], result.sourceCat['id'])

Expand Down

0 comments on commit 4fa9783

Please sign in to comment.