Skip to content

Commit

Permalink
Modify detection task so that flags.negative is only created if needed
Browse files Browse the repository at this point in the history
As per the Jira discussion of DM-903, add this flag only if a schema is
provided and thresholdPolarity=="both"
  • Loading branch information
pgee2000 committed Feb 16, 2017
1 parent d0bfd0a commit 0185dfd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/lsst/meas/algorithms/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,15 @@ def __init__(self, schema=None, **kwds):
\param schema An lsst::afw::table::Schema used to create the output lsst.afw.table.SourceCatalog
\param **kwds Keyword arguments passed to lsst.pipe.base.task.Task.__init__.
If schema is not None, a 'flags.negative' field will be added to label detections
made with a negative threshold.
If schema is not None and configured for 'both' detections,
a 'flags.negative' field will be added to label detections made with a
negative threshold.
\note This task can add fields to the schema, so any code calling this task must ensure that
these columns are indeed present in the input match list; see \ref Example
"""
pipeBase.Task.__init__(self, **kwds)
if schema is not None:
if schema is not None and self.config.thresholdPolarity == "both":
self.negativeFlagKey = schema.addField(
"flags_negative", type="Flag",
doc="set if source was detected as significantly negative"
Expand Down

0 comments on commit 0185dfd

Please sign in to comment.