healpy.rotator.vec2dir

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

Transform a vector to angle given by theta,phi.

Parameters:
vecfloat, 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

vyfloat, scalar or array-like, optional

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

vzfloat, scalar or array-like, optional

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

lonlatbool, optional

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

Returns:
anglesfloat, 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()