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