cdshealpix.nested.neighbours¶
- cdshealpix.nested.neighbours(ipix, depth, num_threads=0)¶
Get the neighbouring cells of some HEALPix cells at a given depth.
This method returns a \(N\) x \(9\)
np.uint64
numpy array containing the neighbours of each cell of the \(N\) sizedipix
array. This method is wrapped around the neighbours method from the cdshealpix Rust crate.- Parameters:
- ipix
numpy.ndarray
The HEALPix cell indexes given as a
np.uint64
numpy array.- depthint
The depth of the HEALPix cells.
- 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:
- neighbours
numpy.ndarray
A \(N\) x \(9\)
np.int64
numpy array containing the neighbours of each cell. The \(5^{th}\) element corresponds to the index of HEALPix cell from which the neighbours are evaluated. All its 8 neighbours occup the remaining elements of the line.
- neighbours
- Raises:
- ValueError
When the HEALPix cell indexes given have values out of \([0, 4^{29 - depth}[\).
Examples
>>> from cdshealpix import neighbours >>> import numpy as np >>> ipix = np.array([42, 6, 10]) >>> depth = 12 >>> neighbours = neighbours(ipix, depth)