healpix_geo.zuniq.to_nested#

healpix_geo.zuniq.to_nested(ipix, num_threads=0)#

Convert from zuniq to nested

Parameters:
  • ipix (numpy.ndarray) – The HEALPix cell indexes in the zuniq scheme given as a np.uint64 numpy array.

  • num_threads (int, 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:

  • nested (numpy.ndarray of int) – The cell ids in the nested scheme.

  • depth (int or numpy.ndarray of int) – The HEALPix cell depth given as scalar or a np.uint8 numpy array.

Examples

>>> import healpix_geo.zuniq
>>> import numpy as np
>>> ipix_zuniq = np.array(
...     [
...         4683743612465315840,
...         1130403506469994496,
...         1639310264362860544,
...         206039682952200192,
...     ],
...     dtype="uint64",
... )
>>> ipix_nested, depth = healpix_geo.zuniq.to_nested(ipix_zuniq)
>>> ipix_nested
array([ 32, 125,  45,  91], dtype=uint64)
>>> depth
array([1, 3, 2, 4], dtype=uint8)