healpy.pixelfunc.vec2pix

healpy.pixelfunc.vec2pix(nside, x, y, z, nest=False)

vec2pix : nside,x,y,z,nest=False -> ipix (default:RING)

Parameters :

nside : int or array-like

The healpix nside parameter, must be a power of 2

x,y,z : floats or array-like

vector coordinates defining point on the sphere

nest : bool, optional

if True, assume NESTED pixel ordering, otherwise, RING pixel ordering

Returns :

ipix : int, scalar or array-like

The healpix pixel number corresponding to input vector. Scalar if all input are scalar, array otherwise. Usual numpy broadcasting rules apply.

See also

ang2pix, pix2ang, pix2vec

Examples

>>> import healpy as hp
>>> hp.vec2pix(16, 1, 0, 0)
1504
>>> hp.vec2pix(16, [1, 0], [0, 1], [0, 0])
array([1504, 1520])
>>> hp.vec2pix([1, 2, 4, 8], 1, 0, 0)
array([  4,  20,  88, 368])

Project Versions

Previous topic

healpy.pixelfunc.ang2pix

Next topic

healpy.pixelfunc.vec2ang

This Page