def _cartesian_to_sphere(x, y, z):
 hypotxy = np.hypot(x, y)
 r = np.hypot(hypotxy, z)
 elev = np.arctan2(z, hypotxy)
 az = np.arctan2(y, x)
 return (az, elev, r)

def _cartesian_to_sphere ( x , y , z ) : hypotxy = np . hypot ( x , y ) r = np . hypot ( hypotxy , z ) elev = np . arctan2 ( z , hypotxy ) az = np . arctan2 ( y , x ) return ( az , elev , r )
convert using old function .