22 __all__ = [
"rotateBBoxBy90"]
30 """Rotate a bounding box by an integer multiple of 90 degrees. 34 bbox : `lsst.geom.Box2I` 35 Bounding box to rotate. 37 Number of quarter rotations to perform 38 dimensions : `tuple` of `int` 39 Dimensions of the parent grid. 43 newBbox : `lsst.geom.Box` 49 document dimensions better; what does it specify? 71 raise ValueError(
"n90 must be an integer")
75 xCorner = numpy.array([(corner.getX() - centerPixel[0])
76 for corner
in bbox.getCorners()])
77 yCorner = numpy.array([(corner.getY() - centerPixel[1])
78 for corner
in bbox.getCorners()])
79 x0 =
int((c*xCorner - s*yCorner).
min())
80 y0 =
int((s*xCorner + c*yCorner).
min())
81 x1 =
int((c*xCorner - s*yCorner).
max())
82 y1 =
int((s*xCorner + c*yCorner).
max())
88 if dimensions[0]%2 == 0:
92 if dimensions[0]%2 == 0:
95 if dimensions[1]%2 == 0:
99 if dimensions[1]%2 == 0:
108 dxy0 = centerPixel[0] - centerPixel[1]
109 if n90%2 == 1
and not dxy0 == 0:
An integer coordinate rectangle.
def rotateBBoxBy90(bbox, n90, dimensions)