query_triangle

Routine to find the index of all pixels enclosed in a spherical triangle described by its three vertices. The output indices can be either in the RING or NESTED scheme

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


FORMAT

call query_triangle( nside, v1, v2, v3, listpix, nlist[, nest, inclusive] )


ARGUMENTS

name&dimensionality kind in/out description
       
nside I4B IN the $N_{\mathrm{side}}$ parameter of the map.
v1(3) DP IN cartesian vector pointing at the triangle first vertex.
v2(3) DP IN cartesian vector pointing at the triangle second vertex.
v3(3) DP IN cartesian vector pointing at the triangle third vertex.
listpix(0:*) I4B/ I8B OUT the index for all pixels enclosed in the triangle. Make sure that the size of the array is big enough to contain all pixels.
nlist I4B/ I8B OUT The number of pixels listed in listpix.
nest (OPTIONAL) I4B IN The pixel indices are in the NESTED numbering scheme if nest=1, and in RING scheme otherwise.
inclusive (OPTIONAL) I4B IN If set to 1, all the pixels overlapping (even partially) with the triangle are listed, otherwise only those whose center lies within the triangle are listed.


EXAMPLE:

call query_triangle(256,(/1,0,0/),(/0,1,0/),(/0,0,1/),listpix,nlist)
Returns the RING pixel index of the (98560) pixels in the octant ($x,y,z>0$) in a $N_{\mathrm{side}}=256$ map.

MODULES & ROUTINES

This section lists the modules and routines used by query_triangle.

in_ring
routine to find the pixels in a certain slice of a given ring.
intrs_intrv
routine to compute the intersection of 2 intervals on a circle
ring_num
function to return the ring number corresponding to the coordinate $z$
vect_prod
routine to compute the vectorial product of two 3D vectors


RELATED ROUTINES

This section lists the routines related to query_triangle

pix2ang, ang2pix
convert between angle and pixel number.
pix2vec, vec2pix
convert between a cartesian vector and pixel number.
query_disc, query_polygon,
query_strip, query_triangle
render the list of pixels enclosed respectively in a given disc, polygon, latitude strip and triangle
surface_triangle
computes the surface in steradians of a spherical triangle defined by 3 vertices

Version 3.82, 2022-07-28