gavo.stc.bboxes module
Computing bboxes for STC geometries.
A bbox coming out of this module is a 4-tuple of (ra0, de0, ra1, de1) in
ICRS degrees.
(You’re right, this should be part of the dm classes; but it’s enough
messy custom code that I found it nicer to break it out).
-
class gavo.stc.bboxes.GCSegment(long1, lat1, long2, lat2)[source]
Bases: object
A great circle segment on a sphere. It is assumed that it’s no larger
than pi.
Construction is long,lat, long, lat in rad (or use the fromDegrees
class method.
Very small (<1e-8 rad, say) segments are not supported. You should
probably work in the tangential plane on that kind of scale.
-
classmethod fromDegrees(long1, lat1, long2, lat2)[source]
-
getBBs()[source]
returns a sequence of bounding boxes for this great circle segment.
Actually, the sequence contains one box for a segment that does not
cross the stitching line, two boxes for those that do.
-
latForLong(long)[source]
returns the latitude the great circle is on for a given longitude.
Input and output is in rad.
If the pole is part of the great circle, a constant (but fairly
meaningless) value is returned.
-
gavo.stc.bboxes.fromRad(bbox)[source]
-
gavo.stc.bboxes.getBboxes(ast)[source]
iterates over the bboxes of the areas within ast.
bboxes are (ra0, de0, ra1, de1) in ICRS degrees.
-
gavo.stc.bboxes.getHeading(long1, lat1, long2, lat2)[source]
returns the initial heading when going from one spherical position to
another along a great circle.
Everything is in rad, angle is counted north over east.
-
gavo.stc.bboxes.getStandardFrame()[source]
-
gavo.stc.bboxes.joinBboxes(*bboxes)[source]
returns a bounding box encompassing all the the bboxes passed in.
No input bbox must cross the stitching line; they must be normalized,
i.e., lower left and upper right corners.