LSSTApplications  16.0-11-g09ed895+2,16.0-11-g12e47bd,16.0-11-g9bb73b2+6,16.0-12-g5c924a4+6,16.0-14-g9a974b3+1,16.0-15-g1417920+1,16.0-15-gdd5ca33+1,16.0-16-gf0259e2,16.0-17-g31abd91+7,16.0-17-g7d7456e+7,16.0-17-ga3d2e9f+13,16.0-18-ga4d4bcb+1,16.0-18-gd06566c+1,16.0-2-g0febb12+21,16.0-2-g9d5294e+69,16.0-2-ga8830df+6,16.0-20-g21842373+7,16.0-24-g3eae5ec,16.0-28-gfc9ea6c+4,16.0-29-ge8801f9,16.0-3-ge00e371+34,16.0-4-g18f3627+13,16.0-4-g5f3a788+20,16.0-4-ga3eb747+10,16.0-4-gabf74b7+29,16.0-4-gb13d127+6,16.0-49-g42e581f7+6,16.0-5-g27fb78a+7,16.0-5-g6a53317+34,16.0-5-gb3f8a4b+87,16.0-6-g9321be7+4,16.0-6-gcbc7b31+42,16.0-6-gf49912c+29,16.0-7-gd2eeba5+51,16.0-71-ge89f8615e,16.0-8-g21fd5fe+29,16.0-8-g3a9f023+20,16.0-8-g4734f7a+1,16.0-8-g5858431+3,16.0-9-gf5c1f43+8,master-gd73dc1d098+1,w.2019.01
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 ds9 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 ds9 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 
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 in ds9
47  ds9.mtv(mosaic)
48  m.drawLabels(labels)
49 
50 
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 51 of file showFootprints.py.

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

Variable Documentation

◆ action

lsst.synpipe.showFootprints.action

Definition at line 93 of file showFootprints.py.

◆ args

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

Definition at line 96 of file showFootprints.py.

◆ blends

lsst.synpipe.showFootprints.blends

Definition at line 100 of file showFootprints.py.

◆ default

lsst.synpipe.showFootprints.default

Definition at line 86 of file showFootprints.py.

◆ dest

lsst.synpipe.showFootprints.dest

Definition at line 90 of file showFootprints.py.

◆ fake

lsst.synpipe.showFootprints.fake

Definition at line 99 of file showFootprints.py.

◆ fakes

lsst.synpipe.showFootprints.fakes

Definition at line 99 of file showFootprints.py.

◆ False

lsst.synpipe.showFootprints.False

Definition at line 94 of file showFootprints.py.

◆ filt

lsst.synpipe.showFootprints.filt

Definition at line 100 of file showFootprints.py.

◆ help

lsst.synpipe.showFootprints.help

Definition at line 83 of file showFootprints.py.

◆ int

lsst.synpipe.showFootprints.int

Definition at line 84 of file showFootprints.py.

◆ listobj

lsst.synpipe.showFootprints.listobj

Definition at line 99 of file showFootprints.py.

◆ parser

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

Definition at line 82 of file showFootprints.py.

◆ str

lsst.synpipe.showFootprints.str

Definition at line 85 of file showFootprints.py.

◆ type

lsst.synpipe.showFootprints.type

Definition at line 84 of file showFootprints.py.