manual
Commands

A summary table of basic mangle commands appears in the QuickStart section; a full table of all mangle commands is given below. The QuickStart commands yield a functioning polygon file, while the more advanced commands below let you play with it. See the individual linked pages for more detailed information about each command. There is a standard set of command line switches for all commands:

Also, there is a suite of Fortran subroutines which is responsible for the angular mathematics in mangle:

The mangle commands are:

Basic mangle commands
command does purpose
pixelize splits polygons in the mask so that each polygon is in only one pixel Several mangle commands require comparing each polygon to all of the other polygons in the mask. If the mask is pixelized first, mangle only needs to compare a polygon to the other polygons in the same pixel, which speeds up the processing considerably.
snap identifies almost coincident cap boundaries and snaps them together The positions of the intersections of two almost but not exactly coincident cap boundaries may be subject to significant numerical uncertainty. To avoid numerical problems, such boundaries must be made exactly coincident.
balkanize subdivides the angular mask into many disjoint polygons Polygons must not overlap, to avoid regions being double-counted.
weight assigns a weight to each polygon Define the weight to be applied to each polygon, for example in computing the weighted sum of spherical harmonics of polygons. This command may be avoided in many cases: see Losing Weight.
unify unifies polygons where possible Reduce the number of polygons, for grace and efficiency.
Advanced mangle commands
harmonize computes the spherical harmonics of a mask Investigations of large scale structure, especially at the largest scales, often proceed most advantageously through spherical harmonics. The area of the mask is proportional to the zeroth harmonic.
map maps the mask reconstructed from its spherical harmonics So you can see what you got.
drangle computes the angle subtended by that part of a circle lying within the mask This is the basic element needed to compute the cross-correlation (commonly denoted <DR>, for Data-Random, in cosmological parlance), between a given point and points in the mask separated from it by a given angle.

If the points are random points generated by ransack, then the result will be a Monte Carlo realization of the auto-correlation (commonly denoted <RR>, for Random-Random, in cosmological parlance), between pairs of points in the mask separated by a given angle.

ransack generates random points within the mask Correlation functions are often measured with the help of random backgrounds of points.
poly2poly converts a polygon file from one format to another For example, you can generate points suitable for plotting the polygons of your mask by converting to graphics format. Or, you can determine the vertices of the polygons of your mask by converting to vertices format, or you can find a point inside each polygon of your mask by converting to midpoint format.
polyid determines which polygon(s) a point lies inside Useful utility. Is there such a thing as a useless utility?
rasterize pixelizes a mask according to a user-defined pixelization scheme, returns a polygon file describing the area-averaged weight within each pixel One direction of the HEALPix ⇔ mangle conversion scheme, although it works with any spherical pixelization scheme. Allows one to take a standard mangle polygon file and make a discrete approximation to it according to an arbitrary pixelization scheme (e.g., HEALPix); the output can then be converted to a FITS file (using the weight in each HEALPix pixel) or turned into another polygon file in mangle (using poly2poly).
pixelmap takes a mask pixelized by one of mangle's pixelization schemes, returns a polygon file describing the area-averaged weight within each pixel This routine uses the internal mangle pixelization information to produce a discrete approximation to a mask without the additional steps used in rasterize. It can produce a pixelmap using any of the pixelization schemes available in pixelize.