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.
Somewhat similar program functions to those performed by r.mask can be done using r.mapcalc, g.region, and other programs.
(GRASS Shell Script)
Last changed: $Date$