cdshealpix.nested.healpix_to_xy

cdshealpix.nested.healpix_to_xy(ipix, depth, 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

depthnumpy.ndarray

The depth 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 import healpix_to_xy
>>> import astropy.units as u
>>> import numpy as np
>>> depth = np.array([0, 2])
>>> ipix = np.arange(12)
>>> x, y = healpix_to_xy(ipix[:, np.newaxis], depth[np.newaxis, :])