LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
LSSTDataManagementBasePackage
Functions | Variables
lsst.synpipe.showFootprints Namespace Reference

Functions

def getMosaic (sources, exposure, idname)
 
def main (root, visit, ccd, fakes=None, blends=False, listobj=16, filt=None)
 

Variables

 parser = argparse.ArgumentParser()
 
 help
 
 type
 
 int
 
 str
 
 default
 
 dest
 
 action
 
 False
 
 args = parser.parse_args()
 
 fakes
 
 fake
 
 listobj
 
 blends
 
 filt
 

Detailed Description

function to show a list of src footprints in a mosaic

Function Documentation

◆ getMosaic()

def lsst.synpipe.showFootprints.getMosaic (   sources,
  exposure,
  idname 
)
make a mosaic for the given source list from the given exposure

stolen from psfMosaic.py on the sphinx documentation

Definition at line 17 of file showFootprints.py.

17 def getMosaic(sources, exposure, idname):
18  """
19  make a mosaic for the given source list from the given exposure
20 
21  stolen from psfMosaic.py on the sphinx documentation
22  """
23  img = exposure.getMaskedImage().getImage()
24  subImages = []
25  labels = []
26  for src in sources:
27  footBBox = src.getFootprint().getBBox()
28  subimg = lsst.afw.image.ImageF(img, footBBox,
29  lsst.afw.image.PARENT, True)
30  footMask = lsst.afw.image.ImageU(footBBox)
31  src.getFootprint().insertIntoImage(footMask, 1, footBBox)
32  subimg *= footMask.convertF()
33  subImages.append(subimg)
34  labels.append('ID=%s' % str(src.get(idname)))
35 
36  m = afwDisplay.utils.Mosaic()
37  m.setGutter(2)
38  m.setBackground(0)
39  m.setMode("square")
40 
41  # create the mosaic
42  for img in subImages:
43  m.append(img)
44  mosaic = m.makeMosaic()
45 
46  # display it with labels
47  disp = afwDisplay.Display()
48  disp.mtv(mosaic, title="mosaic")
49  m.drawLabels(labels)
50 
51 
def getMosaic(sources, exposure, idname)

◆ main()

def lsst.synpipe.showFootprints.main (   root,
  visit,
  ccd,
  fakes = None,
  blends = False,
  listobj = 16,
  filt = None 
)

Definition at line 52 of file showFootprints.py.

52 def main(root, visit, ccd, fakes=None, blends=False, listobj=16, filt=None):
53 
54  butler = lsst.daf.persistence.Butler(root)
55  dataId = {'visit': visit,
56  'ccd': int(ccd)} if filt is None else {'tract': visit,
57  'patch': ccd,
58  'filter': filt}
59 
60  if fakes is not None:
61  src = matchFakes.getFakeSources(butler, dataId,
62  extraCols=('zeropoint'),
63  radecMatch=fakes)
64  else:
65  src = butler.get('src' if filt is None else 'deepCoadd-src', dataId)
66  if not blends:
67  src = [s for s in src if ((s.get('deblend.nchild') == 0) &
68  (s.get('parent') == 0))]
69  else:
70  src = [s for s in src if (s.get('deblend.nchild') == 0)]
71 
72  exposure = butler.get('calexp' if filt is None else 'deepCoadd', dataId)
73 
74  if type(listobj) is int:
75  listobj = numpy.random.choice(list(range(len(src))), listobj, False)
76 
77  srcList = [src[i] for i in listobj]
78 
79  getMosaic(srcList, exposure, 'fakeId' if fakes else 'id')
80 
81 
def getMosaic(sources, exposure, idname)
table::Key< int > type
Definition: Detector.cc:167
def main(root, visit, ccd, fakes=None, blends=False, listobj=16, filt=None)
daf::base::PropertyList * list
Definition: fits.cc:885

Variable Documentation

◆ action

lsst.synpipe.showFootprints.action

Definition at line 94 of file showFootprints.py.

◆ args

lsst.synpipe.showFootprints.args = parser.parse_args()

Definition at line 97 of file showFootprints.py.

◆ blends

lsst.synpipe.showFootprints.blends

Definition at line 101 of file showFootprints.py.

◆ default

lsst.synpipe.showFootprints.default

Definition at line 87 of file showFootprints.py.

◆ dest

lsst.synpipe.showFootprints.dest

Definition at line 91 of file showFootprints.py.

◆ fake

lsst.synpipe.showFootprints.fake

Definition at line 100 of file showFootprints.py.

◆ fakes

lsst.synpipe.showFootprints.fakes

Definition at line 100 of file showFootprints.py.

◆ False

lsst.synpipe.showFootprints.False

Definition at line 95 of file showFootprints.py.

◆ filt

lsst.synpipe.showFootprints.filt

Definition at line 101 of file showFootprints.py.

◆ help

lsst.synpipe.showFootprints.help

Definition at line 84 of file showFootprints.py.

◆ int

lsst.synpipe.showFootprints.int

Definition at line 85 of file showFootprints.py.

◆ listobj

lsst.synpipe.showFootprints.listobj

Definition at line 100 of file showFootprints.py.

◆ parser

lsst.synpipe.showFootprints.parser = argparse.ArgumentParser()

Definition at line 83 of file showFootprints.py.

◆ str

lsst.synpipe.showFootprints.str

Definition at line 86 of file showFootprints.py.

◆ type

lsst.synpipe.showFootprints.type

Definition at line 85 of file showFootprints.py.