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 Dec 24, 2024
1 parent 32e5bea commit f3a2bf6
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 f3a2bf6

Please sign in to comment.