Skip to content

Commit

Permalink
Simplify setting of selection flags now that DM-6981 is done.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed May 25, 2023
1 parent eea4854 commit 714cbe6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions python/lsst/meas/algorithms/sourceSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,8 @@ def run(self, sourceCat, sourceSelectedField=None, matches=None, exposure=None):
matches=matches)

if sourceSelectedField is not None:
if isinstance(sourceCat, (pandas.DataFrame, astropy.table.Table)):
sourceCat[sourceSelectedField] = result.selected
else:
source_selected_key = \
sourceCat.getSchema()[sourceSelectedField].asKey()
# TODO: Remove for loop when DM-6981 is completed.
for source, flag in zip(sourceCat, result.selected):
source.set(source_selected_key, bool(flag))
sourceCat[sourceSelectedField] = result.selected

return pipeBase.Struct(sourceCat=sourceCat[result.selected],
selected=result.selected)

Expand Down

0 comments on commit 714cbe6

Please sign in to comment.