31 peakDist, schema, idFactory, samePeakDist):
32 """Add multiple catalogs and get the SourceCatalog with merged Footprints
36 catalogs : `list` [`lsst.afw.table.SourceCatalog`]
38 filters : `list` [`str`]
40 peakDist : `float` or `list` [`float`]
41 distance between source peaks
42 schema : `lsst.afw.table.Schema`
43 idFactory : `lsst.afw.table.IdFactory`
44 samePeakDist : `float` or `list [`float`]
45 distance between source peaks (check)
49 mergedList : `lsst.afw.table.SourceCatalog`
50 merged list of sources
54 lsst.afw.table.SourceTable
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)