23__all__ = [
"coordFromVec",
"makeSkyPolygonFromBBox",
"Index2D"]
25from typing
import NamedTuple
31_TinyFloat = numpy.finfo(float).tiny
35 """Convert an ICRS cartesian vector to an ICRS lsst.geom.SpherePoint
39 vec : `list` of `float`
40 An ICRS catesian vector.
42 The RA to use
if the vector
is too near a pole;
43 ignored
if not near a pole.
48 If vec too near a pole
and defRA
is None.
50 if abs(vec[0]) < _TinyFloat
and abs(vec[1]) < _TinyFloat:
52 raise RuntimeError(
"At pole and defRA==None")
61def makeSkyPolygonFromBBox(bbox, wcs):
62 """Make an on-sky polygon from a bbox and a SkyWcs
67 Bounding box of region,
in pixel coordinates
77 skyPoints = wcs.pixelToSky(pixelPoints)
82 """Two dimensional index for patches and cells.
84 This class contains the
x and
y values of the location of a patch
85 within a tract,
or a cell within a patch.
def coordFromVec(vec, defRA=None)