25from ._detection
import FootprintMergeList
31 peakDist, schema, idFactory, samePeakDist):
32 """Add multiple catalogs and get the SourceCatalog with merged Footprints
38 filters : `list` [`str`]
40 peakDist : `float` or `list` [`float`]
41 distance between source peaks
44 samePeakDist : `float`
or `list [`float`]
45 distance between source peaks (check)
50 merged list of sources
60 table = afwTable.SourceTable.make(schema, idFactory)
61 mergedList = afwTable.SourceCatalog(table)
67 samePeakDist = [samePeakDist] * len(catalogs)
72 peakDist = [peakDist] * len(catalogs)
74 if len(peakDist) != len(catalogs):
75 raise ValueError(
"Number of catalogs (%d) does not match length of peakDist (%d)"
76 % (len(catalogs), len(peakDist)))
78 if len(samePeakDist) != len(catalogs):
79 raise ValueError(
"Number of catalogs (%d) does not match length of samePeakDist (%d)"
80 % (len(catalogs), len(samePeakDist)))
82 if len(filters) != len(catalogs):
83 raise ValueError(
"Number of catalogs (%d) does not match number of filters (%d)"
84 % (len(catalogs), len(filters)))
87 for cat, filter, dist, sameDist
in zip(catalogs, filters, peakDist, samePeakDist):
88 self.addCatalog(table, cat, filter, dist,
True, sameDist)
90 self.getFinalSources(mergedList)
A polymorphic functor base class for generating record IDs for a table.
Defines the fields and offsets for a table.
Table class that contains measurements made on a single exposure.