cdshealpix.nested.healpix_to_skycoord

cdshealpix.nested.healpix_to_skycoord(ipix, depth, dx=0.5, dy=0.5, num_threads=0)

Get the sky coordinates of the center of some HEALPix cells in a nested configuration at a given depth.

This method does the opposite transformation of lonlat_to_healpix. It is the equivalent of healpix_to_lonlat except that it returns astropy.coordinates.SkyCoord instead of astropy.coordinates. It’s wrapped around the center method from the cdshealpix Rust crate.

Parameters:
ipixnumpy.ndarray

The HEALPix cell indexes in a nested configuration given as a np.uint64 numpy array.

depthnumpy.ndarray

The depth of the HEALPix cells.

dxfloat, optional

The offset position \(\in [0, 1]\) along the X axis. By default, dx=0.5

dyfloat, optional

The offset position \(\in [0, 1]\) along the Y axis. By default, dy=0.5

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:
skycoordastropy.coordinates.SkyCoord

The sky coordinates of the center of the HEALPix cells given as a SkyCoord object.

Raises:
ValueError

When the HEALPix cell indexes given have values out of \([0, 4^{29 - depth}[\).

Examples

>>> from cdshealpix import healpix_to_skycoord
>>> import numpy as np
>>> ipix = np.array([42, 6, 10])
>>> depth = 12
>>> skycoord = healpix_to_skycoord(ipix, depth)
>>> print(skycoord)
<SkyCoord (ICRS): (ra, dec) in deg
    [(44.9230957 , 0.0746039 ), (45.01098633, 0.03730194),
     (44.96704102, 0.03730194)]>