26 __all__ = [
"coordFromVec"]
28 _TinyFloat = numpy.finfo(float).tiny
32 """Convert an ICRS cartesian vector to an ICRS lsst.afw.geom.SpherePoint 34 @param[in] vec: an ICRS catesian vector as a sequence of three floats 35 @param[in] defRA: the RA to use if the vector is too near a pole (an afwGeom Angle); 36 ignored if not near a pole 38 @throw RuntimeError if vec too near a pole and defRA is None 40 if abs(vec[0]) < _TinyFloat
and abs(vec[1]) < _TinyFloat:
42 raise RuntimeError(
"At pole and defRA==None")
47 return afwGeom.SpherePoint(defRA, decDeg*afwGeom.degrees)
48 return afwGeom.SpherePoint(afwGeom.Point3D(*vec))
def coordFromVec(vec, defRA=None)