26 __all__ = [
"PatchInfo"]
30 """Information about a patch within a tract of a sky map 32 See TractInfo for more information. 35 def __init__(self, index, innerBBox, outerBBox):
36 """Construct a PatchInfo 38 @param[in] index: x,y index of patch (a pair of ints) 39 @param[in] innerBBox: inner bounding box (an afwGeom.Box2I) 40 @param[in] outerBBox: inner bounding box (an afwGeom.Box2I) 45 if not outerBBox.contains(innerBBox):
46 raise RuntimeError(
"outerBBox=%s does not contain innerBBox=%s" % (outerBBox, innerBBox))
49 """Return patch index: a tuple of (x, y) 54 """Get inner bounding box 59 """Get outer bounding box 64 """Return a patch out bbox as a sphgeom.ConvexPolygon. 67 corners = [
Point2D(c)
for c
in bbox.getCorners()]
68 vertices = tractWcs.pixelToSky(corners)
69 points = [
UnitVector3d(*sp.getVector())
for sp
in vertices]
75 return (self.
getIndex() == rhs.getIndex()) \
82 return not self.
__eq__(rhs)
85 """Return a brief string representation 87 return "PatchInfo(index=%s)" % (self.
getIndex(),)
90 """Return a detailed string representation 92 return "PatchInfo(index=%s, innerBBox=%s, outerBBox=%s)" % \
def getPolygon(self, tractWcs)
def __init__(self, index, innerBBox, outerBBox)