cdshealpix.nested.vertices

cdshealpix.nested.vertices(ipix, depth, step=1, num_threads=0)

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

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:
ipixnumpy.ndarray

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

depthint

The depth 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)

Returns:
lon, lat(astropy.coordinates.Longitude, astropy.coordinates.Latitude)

The sky coordinates of the 4 vertices of the HEALPix cells. lon and lat are Longitude and Latitude instances respectively, containing a \(N\) x \(4\) numpy array where N is the number of HEALPix cell given in ipix.

Raises:
ValueError

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

Examples

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