DESCRIPTION

r.mask - Facilitates creation of a raster "MASK" map to control raster operations. The MASK will block out certain areas of a raster map from analysis, by "hiding" them from sight of other GRASS modules. While a mask exists, most GRASS raster modules will operate only on data falling inside the masked area, and treat any data falling outside of the mask as if its value were NULL.

The mask is only applied when reading an existing GRASS raster map, for example when used in a module as an input map.

r.mask uses r.reclass to create a reclassification of an existing raster map and name it MASK. The user can select cat values to use in the MASK.

Because the mask is actually only a reclass map named "MASK", it can be copied, renamed, removed, and used in analyses, just like other GRASS raster map layers. The user should be aware that a mask remains in place until a user renames it to something other than "MASK", or removes it using "r.mask -r" or g.remove.

As long as the file named MASK exists in the current mapset, most raster operations will only take place in the grid cells specified by the MASK. Grid cells in the MASK map containing 0 or NULL will replace data with NULL, cells containing other values will allow data to pass through unaltered.

To restore raster operations to normal (i.e., all cells of the current region), remove the MASK file by setting the -r remove MASK flag. A MASK also can be removed by using g.remove or by renaming it to any other name with g.rename.

NOTES

The above method for specifying a "mask" may seem counterintuitive. Areas inside the mask are not hidden; areas outside the mask will be ignored until the MASK file is removed.

Somewhat similar program functions to those performed by r.mask can be done using r.mapcalc, g.region, and other programs.

(GRASS Shell Script)

SEE ALSO

g.region, r.mapcalc, r.reclass

AUTHOR

Michael Barton, Arizona State University

Last changed: $Date$