Skip to content

Commit

Permalink
Update for refactored meas_extensions_scarlet
Browse files Browse the repository at this point in the history
  • Loading branch information
fred3m committed Jan 9, 2025
1 parent 6e5c4a0 commit c895390
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions python/lsst/meas/algorithms/setPrimaryFlags.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,20 @@ def getDeblendPrimaryFlags(sources):
# the number of deblended sources in the catalog,
# because some peaks might have been culled during deblending.
nPeaks = sources["deblend_nPeaks"]
parentNChild = sources["deblend_parentNChild"]
nChild = sources["deblend_nChild"]
parentNPeaks = sources["deblend_parentNPeaks"]
depth = sources["deblend_depth"]
# It is possible for a catalog to contain a hierarchy of sources,
# so we mark the leaves (end nodes of the hierarchy tree with no
# children).
isLeaf = nPeaks == 1
fromBlend = parentNChild > 1
isIsolated = isLeaf & ((parent == 0) | parentNChild == 1)
isDeblendedSource = (fromBlend & isLeaf) | (isIsolated & (parent == 0))
isDeblendedModelSource = (parent != 0) & isLeaf
isLeaf = nChild == 0
isChild = depth > 0
isSibling = parentNPeaks > 1
isDeblendedModelSource = isLeaf & isChild
fromBlend = isDeblendedModelSource & (isSibling | depth > 1)
isIsolatedParent = (depth == 0) & (nPeaks == 1)
isIsolated = isIsolatedParent | ((depth == 1) & ~isSibling)
isDeblendedSource = fromBlend | isIsolatedParent
else:
# Set the flags for meas_deblender
fromBlend = parent != 0
Expand Down

0 comments on commit c895390

Please sign in to comment.