healpy.rotator.vec2dir

healpy.rotator.vec2dir(vec, vy=None, vz=None, lonlat=False)

Transform a vector to angle given by theta,phi.

Parameters:

vec : float, scalar or array-like

The vector to transform (shape (3,) or (3,N)), or x component (scalar or shape (N,)) if vy and vz are given

vy : float, scalar or array-like, optional

The y component of the vector (scalar or shape (N,))

vz : float, scalar or array-like, optional

The z component of the vector (scalar or shape (N,))

lonlat : bool, optional

If True, return angles will be longitude and latitude in degree, otherwise, angles will be longitude and co-latitude in radians (default)

Returns:

angles : float, array

The angles (unit depending on lonlat) in an array of shape (2,) (if scalar input) or (2, N)

See also

dir2vec(), pixelfunc.ang2vec(), pixelfunc.vec2ang()