[GRASS-SVN] r56125 - grass/trunk/scripts/r.mask

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 4 21:25:55 PDT 2013


Author: hamish
Date: 2013-05-04 21:25:55 -0700 (Sat, 04 May 2013)
New Revision: 56125

Modified:
   grass/trunk/scripts/r.mask/r.mask.html
   grass/trunk/scripts/r.mask/r.mask.py
Log:
sync updated strings from devbr6

Modified: grass/trunk/scripts/r.mask/r.mask.html
===================================================================
--- grass/trunk/scripts/r.mask/r.mask.html	2013-05-05 03:52:58 UTC (rev 56124)
+++ grass/trunk/scripts/r.mask/r.mask.html	2013-05-05 04:25:55 UTC (rev 56125)
@@ -3,24 +3,26 @@
 <em><b>r.mask</b></em> - Facilitates creation of a raster "MASK" map to
 control raster operations.
 
-<p>The MASK is only applied when <em>reading</em> an existing GRASS raster map,
+<p>
+The MASK is only applied when <em>reading</em> an existing GRASS raster map,
 for example when used in a module as an input map.
 
 The MASK will block out certain areas of a raster map from analysis and/or
 display, by "hiding" them from sight of other GRASS modules. Data falling
 within the bounaries of the MASK can be modified and operated upon by other
 GRASS raster modules; data falling outside the MASK is treated as if it were NULL.
-<p>Because the MASK is actually only a reclass map named "MASK", it can be
+<p>
+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 "<tt>r.mask -r</tt>" or <em>g.remove</em>.
-
-<p>Grid cells in the MASK map containing <tt>0</tt> or <tt>NULL</tt>
+<p>
+Grid cells in the MASK map containing <tt>0</tt> or <tt>NULL</tt>
 will replace data with NULL, while cells containing other values will allow
 data to pass through unaltered.
-
-<p>To restore raster operations to normal (i.e., all cells of the current region),
+<p>
+To restore raster operations to normal (i.e., all cells of the current region),
 remove the MASK file by setting the <b>-r</b> remove MASK flag. In this case, a
 dummy value must also be given for the input parameter.
 A MASK also can be removed by using <em>g.remove</em>
@@ -34,13 +36,13 @@
 areas outside the MASK will be ignored until the MASK file
 is removed.
 <p>
-The mask is read as an integer map. If MASK is actually a
+The MASK is read as an integer map. If MASK is actually a
 floating-point map, the values will be converted to integers using the
 map's quantisation rules (this defaults to round-to-nearest, but can
 be changed with r.quant).
 <p>
 <em>r.mask</em> uses <em>r.reclass</em> to create a reclassification of an
-existing raster map and name it MASK. A reclass map takes up less space, but
+existing raster map and name it <tt>MASK</tt>. A reclass map takes up less space, but
 is affected by any changes to the underlying map from which it was created.
 The user can select category values from the input raster to use in the MASK
 with the <em>maskcats</em> parameter; if <em>r.mask</em> is run from the
@@ -51,6 +53,7 @@
 <em>r.mask</em> can be done using <em>r.mapcalc</em>, 
 <em>g.region</em>, and other commands.
 
+
 <h2>EXAMPLES</h2>
 
 Creating a raster mask, for showing only elevations of lakes:
@@ -77,6 +80,7 @@
 d.rast geology_30m
 </pre></div>
 
+
 <h2>SEE ALSO</h2>
 <em>
 <a href="g.region.html">g.region</a>,
@@ -86,8 +90,10 @@
 <a href="g.rename.html">g.rename</a>
 </em>
 
+
 <h2>AUTHOR</h2>
 
 Michael Barton, Arizona State University
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

Modified: grass/trunk/scripts/r.mask/r.mask.py
===================================================================
--- grass/trunk/scripts/r.mask/r.mask.py	2013-05-05 03:52:58 UTC (rev 56124)
+++ grass/trunk/scripts/r.mask/r.mask.py	2013-05-05 04:25:55 UTC (rev 56125)
@@ -8,7 +8,7 @@
 #               Converted to Python by Glynn Clements
 #               Markus Metz
 # PURPOSE:      Facilitates creation of raster MASK
-# COPYRIGHT:	(C) 2005-2012 by the GRASS Development Team
+# COPYRIGHT:	(C) 2005-2013 by the GRASS Development Team
 #
 #		This program is free software under the GNU General Public
 #		License (>=v2). Read the file COPYING that comes with GRASS
@@ -31,7 +31,8 @@
 #%option
 #% key: maskcats
 #% type: string
-#% description: Raster values to use for mask (format: 1 2 3 thru 7 *)
+#% label: Raster values to use for mask
+#% description: format: 1 2 3 thru 7 *
 #% answer: *
 #% guisection: Raster
 #%end
@@ -115,7 +116,8 @@
 
             if maskcats != '*' and not remove:
                 if grass.raster_info(raster)['datatype'] != "CELL":
-                    grass.fatal(_("Raster map %s must be integer for maskcats parameter") % raster)
+                    grass.fatal(_("The raster map <%s> must be integer (CELL type) "
+                                  " in order to use the 'maskcats' parameter") % raster)
 
             p = grass.feed_command('r.reclass', input = raster, output = 'MASK', overwrite = True, rules = '-')
             p.stdin.write("%s = 1" % maskcats)
@@ -158,18 +160,17 @@
 	    tmp = "r_mask_%d" % os.getpid()
 	    grass.run_command('g.rename', rast = ('MASK', tmp), quiet = True)
             grass.message(_("Creating inverted raster MASK..."))
-	    grass.mapcalc("MASK=if(isnull($tmp),1,null())", tmp = tmp)
+	    grass.mapcalc("MASK = if(isnull($tmp), 1, null())", tmp = tmp)
 	    grass.verbose(_("Inverted raster MASK created"))
 	else:
 	    grass.verbose(_("Raster MASK created"))
 
-        grass.message(_("All subsequent raster operations will be limited to MASK area. ") +
-                      "Removing or renaming raster map named MASK will " +
-                      "restore raster operations to normal.")
+        grass.message(_("All subsequent raster operations will be limited to "
+                        "the MASK area. Removing or renaming raster map named "
+                        "'MASK' will restore raster operations to normal."))
 
 if __name__ == "__main__":
     options, flags = grass.parser()
     tmp = tmp_hull = None
     atexit.register(cleanup)
     main()
-



More information about the grass-commit mailing list