healpy.pixelfunc.pix2vec¶
- healpy.pixelfunc.pix2vec(nside, ipix, nest=False)¶
pix2vec : nside,ipix,nest=False -> x,y,z (default RING)
- Parameters:
- nsideint, scalar or array-like
The healpix nside parameter, must be a power of 2, less than 2**30
- ipixint, scalar or array-like
Healpix pixel number
- nestbool, optional
if True, assume NESTED pixel ordering, otherwise, RING pixel ordering
- Returns:
- x, y, zfloats, scalar or array-like
The coordinates of vector corresponding to input pixels. Scalar if all input are scalar, array otherwise. Usual numpy broadcasting rules apply.
Examples
>>> import healpy as hp >>> hp.pix2vec(16, 1504) (0.99879545620517241, 0.049067674327418015, 0.0)
>>> hp.pix2vec(16, [1440, 427]) (array([ 0.99913157, 0.5000534 ]), array([ 0. , 0.5000534]), array([ 0.04166667, 0.70703125]))
>>> hp.pix2vec([1, 2], 11) (array([ 0.52704628, 0.68861915]), array([-0.52704628, -0.28523539]), array([-0.66666667, 0.66666667]))