25 from ._base
import Catalog
26 from ._table
import SourceCatalog, SourceTable
28 Catalog.register(
"Source", SourceCatalog)
35 """Return the subset of self for which the parent field equals the
38 In order for this method to return the correct result, it must be
39 sorted by parent (i.e. self.isSorted(SourceTable.getParentKey()) must
40 be True). This is naturally the case with SourceCatalogs produced by
41 the detection and deblending tasks, but it may not be true when
42 concatenating multiple such catalogs.
44 Additional Catalogs or sequences whose elements correspond in order to
45 the records of self (i.e. ``zip(self, *args)`` is valid) will be
46 subset using the same slice object used on self, and these subsets
47 will be returned along with the subset of self.
52 ID of the parent to get children for.
53 args : `~lsst.afw.table.Catalog`
54 Additional catalogs to subset for the childrens to return.
58 children : iterable of `~lsst.afw.table.SourceRecord`
61 if not self.isSorted(SourceTable.getParentKey()):
63 "The table is not sorted by parent, so cannot getChildren")
64 s = self.equal_range(parent, SourceTable.getParentKey())
66 return (self[s],) + tuple(arg[s]
for arg
in args)