healpix_geo.auto.healpix_to_lonlat#
- healpix_geo.auto.healpix_to_lonlat(ipix, grid, *, num_threads=0)#
Get the longitudes and latitudes of the center of some HEALPix cells.
- Parameters:
ipix (numpy.ndarray) – The HEALPix cell indexes given as a np.uint64 numpy array.
grid (
Grid) – The definition of the HEALPix grid.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:
lon, lat (
numpy.ndarray) – The coordinates of the center of the HEALPix cells given as a longitude, latitude tuple.
Examples
>>> import healpix_geo.auto as hg >>> import numpy as np >>> ipix = np.array([42, 6, 10]) >>> grid = hg.Grid(level=3, indexing_scheme="nested", ellipsoid="WGS84") >>> lon, lat = hg.healpix_to_lonlat(ipix, grid) >>> lon array([ 5.625, 50.625, 28.125]) >>> lat array([41.93785391, 19.55202227, 19.55202227])