cdshealpix.nested.healpix_to_lonlat

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

Get the longitudes and latitudes of the center of some HEALPix cells at a given depth.

This method does the opposite transformation of lonlat_to_healpix. It’s wrapped around the center method from the cdshealpix Rust crate.

Parameters:
ipixnumpy.ndarray

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

depthnumpy.ndarray

The HEALPix cell depth given as a np.uint8 numpy array.

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:
lon, lat(astropy.coordinates.Longitude, astropy.coordinates.Latitude)

The sky coordinates of the center of the HEALPix cells given as a longitude, latitude tuple.

Raises:
ValueError

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

Examples

>>> from cdshealpix import healpix_to_lonlat
>>> import numpy as np
>>> ipix = np.array([42, 6, 10])
>>> depth = np.array([12, 20])
>>> lon, lat = healpix_to_lonlat(ipix[:, np.newaxis], depth[np.newaxis, :])