cdshealpix.ring.healpix_to_xy

cdshealpix.ring.healpix_to_xy(ipix, nside, num_threads=0)

Project the center of a HEALPix cell to the xy-HEALPix plane.

Parameters:
ipixnumpy.ndarray

The HEALPix cells which centers will be projected

nsidenumpy.ndarray

The nside of the HEALPix cells

num_threadsint, optional

Specifies the number of threads to use for the computation. Default to 0 means it will choose the number of threads based on the RAYON_NUM_THREADS environment variable (if set), or the number of logical CPUs (otherwise)

Returns:
x, y: (numpy.ndarray, numpy.ndarray)

The position of the HEALPix centers in the xy-HEALPix plane. \(x \in [0, 8[\) and \(y \in [-2, 2]\)

Examples

>>> from cdshealpix.ring import healpix_to_xy
>>> import astropy.units as u
>>> import numpy as np
>>> depth = np.array([0, 10])
>>> nside = 2 ** depth
>>> ipix = np.arange(12)
>>> x, y = healpix_to_xy(ipix[:, np.newaxis], nside[np.newaxis, :])