Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-47738: Update for refactored meas_extensions_scarlet #405

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading