healpy.pixelfunc.vec2ang

healpy.pixelfunc.vec2ang(vectors, lonlat=False)

vec2ang: vectors [x, y, z] -> theta[rad], phi[rad]

Parameters:
vectorsfloat, array-like

the vector(s) to convert, shape is (3,) or (N, 3)

lonlatbool, optional

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

Returns:
theta, phifloat, tuple of two arrays

the colatitude and longitude in radians

See also

ang2vec, rotator.vec2dir, rotator.dir2vec