cdshealpix.nested.lonlat_to_xy¶
- cdshealpix.nested.lonlat_to_xy(lon, lat, num_threads=0)¶
Project sky coordinates to the HEALPix space.
- Parameters:
- lon
astropy.coordinates.Longitude
The longitudes of the sky coordinates.
- lat
astropy.coordinates.Latitude
The latitudes of the sky coordinates.
- 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)
- lon
- Returns:
- x, y: (
numpy.ndarray
,numpy.ndarray
) The position of the (
lon
,lat
) coordinates in the HEALPix space. \(x \in [0, 8[\) and \(y \in [-2, 2]\)
- x, y: (
Examples
>>> from cdshealpix import lonlat_to_xy >>> from astropy.coordinates import Longitude, Latitude >>> import astropy.units as u >>> import numpy as np >>> lon = Longitude([10, 25], u.deg) >>> lat = Latitude([5, 10], u.deg) >>> x, y = lonlat_to_xy(lon, lat)