r.mask.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <h2>DESCRIPTION</h2>
  2. <em><b>r.mask</b></em> - Facilitates creation of a raster "MASK" map to
  3. control raster operations.
  4. <p>
  5. The MASK is only applied when <em>reading</em> an existing GRASS raster map,
  6. for example when used in a module as an input map.
  7. The MASK will block out certain areas of a raster map from analysis and/or display, by
  8. "hiding" them from sight of other GRASS modules. Data falling within the bounaries of the MASK
  9. can be modified and operated upon by other GRASS raster modules; data
  10. falling outside the MASK is treated as if it were NULL.
  11. <p>
  12. Because the MASK is actually only a reclass map named "MASK", it can be
  13. copied, renamed, removed, and used in analyses, just like other GRASS
  14. raster map layers. The user should be aware that a MASK remains in
  15. place until a user renames it to something other than "MASK", or removes
  16. it using "<tt>r.mask -r</tt>" or <em><a HREF="g.remove.html">g.remove</a></em>.
  17. <p>
  18. Grid cells in the MASK map containing <tt>0</tt> or <tt>NULL</tt>
  19. will replace data with NULL, while cells containing other values will allow
  20. data to pass through unaltered.
  21. <p>
  22. To restore raster operations to normal (i.e., all cells of the current region),
  23. remove the MASK file by setting the <b>-r</b> remove MASK flag. In this case, a
  24. dummy value must also be given for the input parameter.
  25. A MASK also can&nbsp;be removed by using <em><a href="g.remove.html">g.remove</a></em>
  26. or by renaming it to any other name with <em><a href="g.rename.html">g.rename</a></em>.
  27. <h2>NOTES</h2>
  28. The above method for specifying a "mask" may seem
  29. counterintuitive. Areas inside the MASK are not hidden;
  30. areas outside the MASK will be ignored until the MASK file
  31. is removed.
  32. <p>
  33. The mask is read as an integer map. If MASK is actually a
  34. floating-point map, the values will be converted to integers using the
  35. map's quantisation rules (this defaults to round-to-nearest, but can
  36. be changed with r.quant).
  37. <p>
  38. <em>r.mask</em> uses <em>r.reclass</em> to create a reclassification of an
  39. existing raster map and name it MASK. A reclass map takes up less space, but
  40. is affected by any changes to the underlying map from which it was created. The user
  41. can select category values from the input raster to use in the MASK with the <em>maskcats</em> parameter;
  42. if <em>r.mask</em> is run from the command line, the category values listed in <em>maskcats</em>
  43. must be quoted (see example below).
  44. <p>
  45. Somewhat similar program functions to those performed by
  46. <em>r.mask</em> can be done using
  47. <em><a HREF="r.mapcalc.html">r.mapcalc</a></em>,
  48. <em><a HREF="g.region.html">g.region</a></em>,
  49. and other programs.
  50. <p>
  51. <em>(GRASS Shell Script)</em>
  52. <h2>EXAMPLES</h2>
  53. Creating a raster mask:
  54. <div class="code"><pre>
  55. <b>r.mask input=</b>geology
  56. MASK created. All subsequent raster operations
  57. will be limited to MASK area
  58. Removing or renaming raster file named MASK will
  59. restore raster operations to normal
  60. [Raster MASK present]
  61. </pre></div>
  62. Removing a raster mask with the -r flag:
  63. <div class="code"><pre>
  64. <b>r.mask -r input=</b>anything_you_wish
  65. Removing raster &lt;MASK&gt;
  66. Raster MASK removed
  67. </pre></div>
  68. Creating a mask from categories 3 through 6 in the spearfish 'geology' raster map:
  69. <div class="code"><pre>
  70. <b>r.mask input=</b>geology <b>maskcats=</b>"3 thru 6"
  71. MASK created. All subsequent raster operations
  72. will be limited to MASK area
  73. Removing or renaming raster file named MASK will
  74. restore raster operations to normal
  75. [Raster MASK present]
  76. </pre></div>
  77. <h2>SEE ALSO</h2>
  78. <em>
  79. <a HREF="g.region.html">g.region</a>,
  80. <a HREF="r.mapcalc.html">r.mapcalc</a>,
  81. <a href="r.reclass.html">r.reclass</a>
  82. <a href="g.remove.html">g.remove</a>
  83. <a href="g.rename.html">g.rename</a>
  84. </em>
  85. <h2>AUTHOR</h2>
  86. Michael Barton, Arizona State University
  87. <p>
  88. <i>Last changed: $Date$</i></p>