22 from __future__
import absolute_import, division, print_function
26 from lsst.utils
import continueClass
27 from ..base
import Catalog
28 from .source
import SourceCatalog, SourceTable
30 Catalog.register(
"Source", SourceCatalog)
37 """Return the subset of self for which the parent field equals the given value.
39 In order for this method to return the correct result, it must be sorted by parent
40 (i.e. self.isSorted(SourceTable.getParentKey()) must be True). This is naturally the
41 case with SourceCatalogs produced by the detection and deblending tasks, but it may
42 not be true when concatenating multiple such catalogs.
44 Additional Catalogs or sequences whose elements correspond in order to the records
45 of self (i.e. zip(self, *args) is valid) will be subset using the same slice object
46 used on self, and these subsets will be returned along with the subset of self.
48 if not self.isSorted(SourceTable.getParentKey()):
50 "The table is not sorted by parent, so cannot getChildren")
51 s = self.equal_range(parent, SourceTable.getParentKey())
53 return (self[s],) + tuple(arg[s]
for arg
in args)