healpy.pixelfunc.pix2ang¶
- healpy.pixelfunc.pix2ang(nside, ipix, nest=False)¶
pix2ang : nside,ipix,nest=False -> theta[rad],phi[rad] (default RING)
Parameters: nside : int or array-like
The healpix nside parameter, must be a power of 2
ipix : int or array-like
Angular coordinates of a point on the sphere
nest : bool, optional
if True, assume NESTED pixel ordering, otherwise, RING pixel ordering
Returns: theta, phi : float, scalar or array-like
The angular coordinates corresponding to ipix. Scalar if all input are scalar, array otherwise. Usual numpy broadcasting rules apply.
Examples
>>> import healpy as hp >>> hp.pix2ang(16, 1440) (1.5291175943723188, 0.0)
>>> hp.pix2ang(16, [1440, 427, 1520, 0, 3068]) (array([ 1.52911759, 0.78550497, 1.57079633, 0.05103658, 3.09055608]), array([ 0. , 0.78539816, 1.61988371, 0.78539816, 0.78539816]))
>>> hp.pix2ang([1, 2, 4, 8], 11) (array([ 2.30052398, 0.84106867, 0.41113786, 0.2044802 ]), array([ 5.49778714, 5.89048623, 5.89048623, 5.89048623]))