cdshealpix.ring.vertices¶
- cdshealpix.ring.vertices(ipix, nside, step=1, num_threads=0)¶
Get the longitudes and latitudes of the vertices of some HEALPix cells at a given nside.
This method returns the 4 vertices of each cell in
ipix
. This method is wrapped around the vertices method from the cdshealpix Rust crate.- Parameters:
- ipix
numpy.ndarray
The HEALPix cell indexes given as a
np.uint64
numpy array.- nsideint
The nside of the HEALPix cells.
- stepint, optional
The number of vertices returned per HEALPix side. By default it is set to 1 meaning that it will only return the vertices of the cell. 2 means that it will returns the vertices of the cell plus one more vertex per edge (the middle of it). More generally, the number of vertices returned is
4 * step
.- 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)
- ipix
- Returns:
- lon, lat(
astropy.coordinates.Longitude
,astropy.coordinates.Latitude
) The sky coordinates of the 4 vertices of the HEALPix cells.
lon
andlat
areLongitude
andLatitude
instances respectively, containing a \(N\) x \(4\) numpy array where N is the number of HEALPix cell given inipix
.
- lon, lat(
- Raises:
- ValueError
When the HEALPix cell indexes given have values out of \([0, 12\) x \(N_{side} ^ 2[\).
Warning
step
is currently not implemented for the ring scheme. Therefore it is set to 1 by default.Examples
>>> from cdshealpix.ring import vertices >>> import numpy as np >>> ipix = np.array([42, 6, 10]) >>> depth = 12 >>> lon, lat = vertices(ipix, (1 << depth))