Because the mask is actually only a reclass file called "MASK" that is created when the user identifies a mask using r.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 or g.remove.
r.mask provides the following options:
1 Remove the current mask 2 Identify a new mask RETURN Exit from programThe user establishes a new mask by choosing option (2). The user will be asked to name an existing raster map layer from among those available in the current mapset search path. Once done, the user is shown a listing of this map's categories, and is asked to assign a value of "1" or "0" to each map category. Areas assigned category value "1" will become part of the mask's surface, while areas assigned category value "0" will become "no data" areas in the MASK file.
If a category is not assigned category value "1" it will automatically be assigned the category value "0" in the resulting MASK file. Any cells falling in category "0" will fall outside the newly formed mask, and their presence will be ignored by GRASS programs run later on, as long as the MASK file remains in place.
This program actually creates a raster map layer (reclass type) called MASK, which can be manipulated (renamed, removed, copied, etc.) like any other raster map layer.
Somewhat similar program functions to those performed by r.mask can be done using r.mapcalc, g.region, and other programs.
This program can only be run interactively.
Note that some programs, like r.stats, have options that allow the user to see the effects of the current mask without removing the current mask. See, for example, use of the -m option for r.stats.