neighbours_nest

This subroutine returns the number and locations (in terms of pixel numbers) of the topological neighbours of a central pixel. The pixels are ordered in a clockwise sense about the central pixel with the southernmost pixel in first element. For the 4 pixels in the southern corners of the equatorial faces which have two equally southern neighbours the routine returns the southwestern pixel first and proceeds clockwise.

Location in HEALPix directory tree: src/f90/mod/pix_tools.F90 


FORMAT

call neighbours_nest( nside, ipix, list, nneigh )


ARGUMENTS

name & dimensionality kind in/out description
       
nside I4B IN The $N_{\mathrm{side}}$ parameter of the map.
ipix I4B/ I8B IN The NESTED pixel index of the central pixel.
list(8) I4B/ I8B OUT On exit, the vector of neighbouring pixels. This contains nneigh relevant elements.
nneigh I4B OUT The number of neighbours (mostly 8, except at 8 sites, where there are only 7 neighbours).


EXAMPLE:

use pix_tools
integer :: nneigh, list(1:8)
call neighbours_nest(4, 1, list, nneigh)
print*,nneigh
print*,list(1:nneigh)
This returns nneigh$=8$ and a vector list, which contains the pixel numbers ( 90, 0, 2, 3, 6, 4, 94, 91).


MODULES & ROUTINES

This section lists the modules and routines used by neighbours_nest.

mk_xy2pix, mk_pix2xy
precomputing arrays for the conversion of NESTED pixel numbers to Cartesian coords in each face.
pix2xy_nest, xy2pix_nest
Conversion between NESTED pixel numbers to Cartesian coords in each face.
bit_manipulation
module, containing:
invMSB, invLSB,swapLSBMSB,invswapLSBMSB
functions which manipulate the bit vector which represents the NESTED pixel numbers. They correspond to NorthWest<->SouthEast, SouthWest<->NorthEast, East<->West and North-South flips of the diamond faces, respectively.


RELATED ROUTINES

This section lists the routines related to neighbours_nest

pix2ang, ang2pix
convert between angle and pixel number.
pix2vec, vec2pix
convert between a cartesian vector and pixel number.

Version 3.82, 2022-07-28