cdshealpix.nested.vertices_skycoord

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

Get the sky coordinates 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, or numpy.ndarray

The depth of the HEALPix cells. If given as an array, should have the same shape than ipix

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:
verticesastropy.coordinates.SkyCoord

The sky coordinates of the 4 vertices of the HEALPix cells. vertices is a SkyCoord object containing a \(N\) x \(4\) numpy array where N is the number of HEALPix cells 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
>>> vertices = vertices(ipix, depth)