23 from matplotlib
import pyplot
28 """Plot the bounding boxes of an observation catalog (see MockCoaddTask.buildObservationCatalog)
29 using matplotlib, in the coordinates defined by the given Wcs (usually a skymap Wcs).
31 for record
in catalog:
35 iWcs = record.getWcs()
36 for xi, yi
in box.getCorners():
38 coord = iWcs.pixelToSky(xi, yi)
39 xo, yo = wcs.skyToPixel(coord)
43 print "WARNING: point %d, %d failed" % (xi, yi)
44 pyplot.fill(x, y, facecolor=
'r', alpha=0.1, edgecolor=None)
47 """Plot the patches in a skymap tract using matplotlib.
49 nPatchX, nPatchY = tractInfo.getNumPatches()
50 for iPatchX
in range(nPatchX):
51 for iPatchY
in range(nPatchY):
52 patchInfo = tractInfo.getPatchInfo((iPatchX, iPatchY))
53 xp1, yp1 = zip(*patchInfo.getOuterBBox().getCorners())
54 xp2, yp2 = zip(*patchInfo.getInnerBBox().getCorners())
55 pyplot.fill(xp1, yp1, fill=
False, edgecolor=
'g', linestyle=
'dashed')
56 pyplot.fill(xp2, yp2, fill=
False, edgecolor=
'g')
59 """Plot the objects in a truth catalog as dots using matplotlib, in the coordinate
60 system defined by the given Wcs.
64 for record
in catalog:
65 x, y = wcs.skyToPixel(record.getCoord())
68 pyplot.plot(xp, yp,
'k+')
71 """Display coadd images with DS9 in different frames, with the bounding boxes of the
72 observations that went into them overlayed.
77 skyMap = butler.get(
"deepCoadd_skyMap")
79 task = lsst.pipe.tasks.mocks.MockCoaddTask()
80 coadds = [patchRef.get(
"deepCoadd", immediate=
True)
81 for patchRef
in task.iterPatchRefs(butler, tractInfo)]
82 for n, coadd
in enumerate(coadds):
84 for n, coadd
in enumerate(coadds):
89 """Convenience function to make all matplotlib plots.
94 skyMap = butler.get(
"deepCoadd_skyMap")
95 observations = butler.get(
"observations", tract=0)
96 truth = butler.get(
"truth", tract=0)
101 pyplot.axis(
"scaled")
A floating-point coordinate rectangle geometry.