template_pixel_nest, template_pixel_ring

Routines to provide the index of the template pixel associated with a given HEALPix pixel, for a resolution parameter $N_{\mathrm{side}}$.

Any pixel can be matched in shape to a single of these templates by a combination of a rotation around the polar axis with reflexion(s) around a meridian and/or the equator.

The template pixels are all located in the Northern Hemisphere, or on the Equator. They are chosen to have their center located at
$\displaystyle z=\cos(\theta)\ge 2/3 \mycomma0< \phi \leq \pi/2,$      
$\displaystyle %[Nside*(Nside+2)/4]
2/3 > z \geq 0 \mycomma\phi=0, \quad{\rm or}\quad \phi=\frac{\pi}{4N_{\mathrm{side}}}. %\nonumber %[Nside]
$     (24)

They are numbered continuously from 0, starting at the North Pole, with the index increasing in $\phi$, and then increasing for decreasing $z$.

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


FORMAT

call template_pixel_nest, template_pixel_ring( nside, pixel_nest, template, reflexion )


FORMAT

call template_pixel_nest, template_pixel_ring( nside, pixel_ring, template, reflexion )


ARGUMENTS

name & dimensionality kind in/out description
       
nside I4B IN the HEALPix $N_{\mathrm{side}}$ parameter.
pixel_nest I4B/ I8B IN NESTED scheme pixel identification number over the range {0, $12N_{\mathrm{side}}^2-1$}.
pixel_ring I4B/ I8B IN RING scheme pixel identification number over the range {0, $12N_{\mathrm{side}}^2-1$}.
template I4B/ I8B OUT identification number of the template matching in shape the pixel provided (the numbering scheme of the pixel templates is the same for both routines).
reflexion I4B OUT in {0, 3} encodes the transformation(s) to apply to each pixel provided to match exactly in shape and position its respective template. 0: rotation around the polar axis only, 1: rotation + East-West swap (ie, reflexion around meridian), 2: rotation + North-South swap (ie, reflexion around Equator), 3: rotation + East-West and North-South swaps


EXAMPLE:

use healpix_modules
integer(I4B):: nside, reflexion
integer(I4B):: pixel, template ! for nside <= 8192
!integer(I8B):: pixel, template ! for any valid nside
nside = 256
pixel = 500000
call template_pixel_ring(nside, pixel, template, reflexion)
print*, template, reflexion
Returns in template the index of the template pixel (16663) whose shape matches that of the pixel #500000 for $N_{\mathrm{side}}=256$. Upon return reflexion will contain 2, meaning that the template must be reflected around a meridian and around the equator (and then rotated around the polar axis) in order to match the pixel. Note that the variables pixel and template must be of type I8B instead of I4B if $N_{\mathrm{side}}> 8192$ is to be used.


RELATED ROUTINES

This section lists the routines related to template_pixel_nest, template_pixel_ring

nside2templates
returns the number of template pixel shapes available for a given $N_{\mathrm{side}}$.
same_shape_pixels_ring
same_shape_pixels_nest
return the ordered list of pixels having the same shape as a given pixel template

Version 3.83, 2024-11-13