26 __all__ = [
"PatchInfo",
"makeSkyPolygonFromBBox"]
30 """Make an on-sky polygon from a bbox and a SkyWcs 34 bbox : `lsst.afw.geom.Box2I` or `lsst.afw.geom.Box2D` 35 Bounding box of region, in pixel coordinates 36 wcs : `lsst.afw.geom.SkyWcs` 41 polygon : `lsst.sphgeom.ConvexPolygon` 44 pixelPoints =
Box2D(bbox).getCorners()
45 skyPoints = wcs.pixelToSky(pixelPoints)
46 return ConvexPolygon.convexHull([sp.getVector()
for sp
in skyPoints])
50 """Information about a patch within a tract of a sky map 52 See TractInfo for more information. 55 def __init__(self, index, innerBBox, outerBBox):
56 """Construct a PatchInfo 58 @param[in] index: x,y index of patch (a pair of ints) 59 @param[in] innerBBox: inner bounding box (an afwGeom.Box2I) 60 @param[in] outerBBox: inner bounding box (an afwGeom.Box2I) 65 if not outerBBox.contains(innerBBox):
66 raise RuntimeError(
"outerBBox=%s does not contain innerBBox=%s" % (outerBBox, innerBBox))
69 """Return patch index: a tuple of (x, y) 74 """Get inner bounding box 79 """Get outer bounding box 84 """Get the inner on-sky region as an sphgeom.ConvexPolygon. 89 """Get the outer on-sky region as a sphgeom.ConvexPolygon. 96 return (self.
getIndex() == rhs.getIndex()) \
103 return not self.
__eq__(rhs)
106 """Return a brief string representation 108 return "PatchInfo(index=%s)" % (self.
getIndex(),)
111 """Return a detailed string representation 113 return "PatchInfo(index=%s, innerBBox=%s, outerBBox=%s)" % \
def makeSkyPolygonFromBBox(bbox, wcs)
def getInnerSkyPolygon(self, tractWcs)
def getOuterSkyPolygon(self, tractWcs)
def __init__(self, index, innerBBox, outerBBox)