LSSTApplications  15.0+21,16.0+1,16.0+3,16.0+4,16.0+8,16.0-1-g2115a9e+2,16.0-1-g4515a79+6,16.0-1-g5c6f5ee+4,16.0-1-g7bb14cc,16.0-1-g80120d7+4,16.0-1-g98efed3+4,16.0-1-gb7f560d+1,16.0-14-gb4f0cd2fa,16.0-2-g1ad129e+1,16.0-2-g2ed7261+1,16.0-2-g311bfd2,16.0-2-g568a347+3,16.0-2-g852da13+6,16.0-2-gd4c87cb+3,16.0-3-g099ede0,16.0-3-g150e024+3,16.0-3-g1f513a6,16.0-3-g958ce35,16.0-4-g08dccf71+4,16.0-4-g128aaef,16.0-4-g84f75fb+5,16.0-4-gcfd1396+4,16.0-4-gde8cee2,16.0-4-gdfb0d14+1,16.0-5-g7bc0afb+3,16.0-5-g86fb31a+3,16.0-6-g2dd73041+4,16.0-7-g95fb7bf,16.0-7-gc37dbc2+4,w.2018.28
LSSTDataManagementBasePackage
footprintMerge.py
Go to the documentation of this file.
1 
2 from ._footprintMerge import FootprintMergeList
3 
4 __all__ = [] # only imported for side effects
5 
6 
7 def getMergedSourceCatalog(self, catalogs, filters,
8  peakDist, schema, idFactory, samePeakDist):
9  """Add multiple catalogs and get the SourceCatalog with merged Footprints"""
10  import lsst.afw.table as afwTable
11 
12  table = afwTable.SourceTable.make(schema, idFactory)
13  mergedList = afwTable.SourceCatalog(table)
14 
15  # if peak is not an array, create an array the size of catalogs
16  try:
17  len(samePeakDist)
18  except TypeError:
19  samePeakDist = [samePeakDist] * len(catalogs)
20 
21  try:
22  len(peakDist)
23  except TypeError:
24  peakDist = [peakDist] * len(catalogs)
25 
26  if len(peakDist) != len(catalogs):
27  raise ValueError("Number of catalogs (%d) does not match length of peakDist (%d)"
28  % (len(catalogs), len(peakDist)))
29 
30  if len(samePeakDist) != len(catalogs):
31  raise ValueError("Number of catalogs (%d) does not match length of samePeakDist (%d)"
32  % (len(catalogs), len(samePeakDist)))
33 
34  if len(filters) != len(catalogs):
35  raise ValueError("Number of catalogs (%d) does not match number of filters (%d)"
36  % (len(catalogs), len(filters)))
37 
38  self.clearCatalog()
39  for cat, filter, dist, sameDist in zip(catalogs, filters, peakDist, samePeakDist):
40  self.addCatalog(table, cat, filter, dist, True, sameDist)
41 
42  self.getFinalSources(mergedList)
43  return mergedList
44 
45 
46 FootprintMergeList.getMergedSourceCatalog = getMergedSourceCatalog
def getMergedSourceCatalog(self, catalogs, filters, peakDist, schema, idFactory, samePeakDist)