104 def run(self, sources, skyMap=None, tractInfo=None, patchInfo=None):
105 """Set isPrimary and related flags on sources.
107 For coadded imaging, the `isPrimary` flag returns True when an object
108 has no children, is in the inner region of a coadd patch, is in the
109 inner region of a coadd trach, and is not detected in a pseudo-filter
110 (e.g., a sky_object).
111 For single frame imaging, the isPrimary flag returns True when a
112 source has no children and is not a sky source.
116 sources : `lsst.afw.table.SourceCatalog`
117 A sourceTable. Reads in centroid fields and an nChild field.
118 Writes is-patch-inner, is-tract-inner, and is-primary flags.
119 skyMap : `lsst.skymap.BaseSkyMap`
120 Sky tessellation object
121 tractInfo : `lsst.skymap.TractInfo`, optional
122 Tract object; required if ``self.isSingleFrame`` is False.
123 patchInfo : `lsst.skymap.PatchInfo`
124 Patch object; required if ``self.isSingleFrame`` is False.
132 isPrimary = isTractInner & isPatchInner & ~isPseudo
139 if "sky_source" in sources.schema:
140 isSky = sources[
"sky_source"]
142 isSky = np.zeros(len(sources), dtype=bool)
147 fromBlend, isIsolated, isDeblendedSource, isDeblendedModelSource = result
153 isPrimary = isPrimary & isDeblendedSource