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, less than 2**30
- 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.
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])