NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links


Routine to find the index of all pixels enclosed in a polygon. The polygon should be convex, or have only one concave vertex. The edges should not intersect each other. The output indices can be either in the RING or NESTED scheme

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


call query_polygon( nside, vlist, nv, listpix, nlist [, nest, inclusive] )


name & dimensionality kind in/out description
nside I4B IN the Nside parameter of the map.
vlist(1:3,0:*) DP IN cartesian vector pointing at polygon respective vertices.
nv I4B IN number of vertices, should be equal to 3 or larger.
listpix(0:*) I4B 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 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 polygon are listed, otherwise only those whose center lies within the polygon are listed.


real(dp), dimension(1:3,0:9) :: vertices
vertices(:,0) = (/0.,0.,1./) ! +z
vertices(:,1) = (/1.,0.,0./) ! +x
vertices(:,2) = (/1.,1.,-1./) ! x+y-z
vertices(:,3) = (/0.,1.,0./) ! +y

call query_polygon(256,vertices,4,listpix,nlist,nest=0)

Returns the RING pixel index of all pixels in the polygon with vertices of cartesian coordinates (0,0,1), (1,0,0), (1,1,-1) and (0,1,0) in a Nside=256 map.


This section lists the modules and routines used by query_polygon.

routine to sort integer number
render the list of pixels enclosed in a given triangle
computes the surface of a spherical triangle defined by 3 vertices
routine to compute the vectorial product of two 3D vectors


This section lists the routines related to query_polygon

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

Eric Hivon 2010-06-18
Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:

CL 03-2650