healpy.pixelfunc.vec2pix¶
- healpy.pixelfunc.vec2pix(nside, x, y, z, nest=False)¶
vec2pix : nside,x,y,z,nest=False -> ipix (default:RING)
- Parameters:
- nsideint or array-like
The healpix nside parameter, must be a power of 2, less than 2**30
- x,y,zfloats or array-like
vector coordinates defining point on the sphere
- nestbool, optional
if True, assume NESTED pixel ordering, otherwise, RING pixel ordering
- Returns:
- ipixint, 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.
Examples
>>> import healpy as hp >>> hp.vec2pix(16, 1, 0, 0) 1504
>>> print(hp.vec2pix(16, [1, 0], [0, 1], [0, 0])) [1504 1520]
>>> print(hp.vec2pix([1, 2, 4, 8], 1, 0, 0)) [ 4 20 88 368]