[GRASS-SVN] r59121 - grass/trunk/raster/r.spread

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 21 14:25:14 PST 2014


Author: wenzeslaus
Date: 2014-02-21 14:25:14 -0800 (Fri, 21 Feb 2014)
New Revision: 59121

Modified:
   grass/trunk/raster/r.spread/main.c
   grass/trunk/raster/r.spread/r.spread.html
Log:
r.spread: manual improvements, moving parameters descriptions from HTML

Modified: grass/trunk/raster/r.spread/main.c
===================================================================
--- grass/trunk/raster/r.spread/main.c	2014-02-21 22:24:48 UTC (rev 59120)
+++ grass/trunk/raster/r.spread/main.c	2014-02-21 22:25:14 UTC (rev 59121)
@@ -101,14 +101,17 @@
     module = G_define_module();
     G_add_keyword(_("raster"));
     G_add_keyword(_("fire"));
+    G_add_keyword(_("spread"));
+    G_add_keyword(_("hazard"));
     module->label =
-	_("Simulates elliptically anisotropic spread on a graphics window and "
-	 "generates a raster map of the cumulative time of spread, "
-	 "given raster maps containing the rates of spread (ROS), the ROS "
-	 "directions and the spread origins.");
+	_("Simulates elliptically anisotropic spread.");
     module->description =
-	_("It optionally produces raster maps to contain backlink UTM "
-	  "coordinates for tracing spread paths.");
+	_("Generates a raster map of the cumulative time of spread, "
+	  "given raster maps containing the rates of spread (ROS), "
+	  "the ROS directions and the spread origins. "
+	  "It optionally produces raster maps to contain backlink UTM "
+	  "coordinates for tracing spread paths. "
+	  "Usable for fire spread simulations.");
 
     parm.max = G_define_option();
     parm.max->key = "max";
@@ -116,8 +119,11 @@
     parm.max->required = YES;
     parm.max->gisprompt = "old,cell,raster";
     parm.max->guisection = _("Input maps");
-    parm.max->description =
-	_("Name of raster map containing MAX rate of spread (ROS) (cm/min)");
+    parm.max->label =
+	_("Raster map containing maximal ROS (cm/min)");
+	parm.max->description =
+	_("Name of an existing raster map layer in the user's current "
+	  "mapset search path containing the maximum ROS values (cm/minute).");
 
     parm.dir = G_define_option();
     parm.dir->key = "dir";
@@ -125,8 +131,12 @@
     parm.dir->required = YES;
     parm.dir->gisprompt = "old,cell,raster";
     parm.dir->guisection = _("Input maps");
+    parm.dir->label =
+	_("Raster map containing directions of maximal ROS (degree)");
     parm.dir->description =
-	_("Name of raster map containing DIRections of max ROS (degree)");
+	_("Name of an existing raster map layer in the user's "
+	  "current mapset search path containing directions of the maximum ROSes, "
+	  "clockwise from north (degree)."); /* TODO: clockwise from north? see r.ros */
 
     parm.base = G_define_option();
     parm.base->key = "base";
@@ -134,8 +144,13 @@
     parm.base->required = YES;
     parm.base->gisprompt = "old,cell,raster";
     parm.base->guisection = _("Input maps");
+    parm.base->label =
+	_("Raster map containing base ROS (cm/min)");
     parm.base->description =
-	_("Name of raster map containing BASE ROS (cm/min)");
+	_("Name of an existing raster map layer in the user's "
+	  "current mapset search path containing the ROS values in the directions "
+	  "perpendicular to maximum ROSes' (cm/minute). These ROSes are also the ones "
+	  "without the effect of directional factors.");
 
     parm.start = G_define_option();
     parm.start->key = "start";
@@ -144,31 +159,48 @@
     parm.start->gisprompt = "old,cell,raster";
     parm.start->guisection = _("Input maps");
     parm.start->description =
-	_("Name of raster map containing STARTing sources");
+	_("Raster map containing starting sources");
+    parm.start->description =
+	_("Name of an existing raster map layer in the "
+	  "user's current mapset search path containing starting locations of the "
+	  "spread phenomenon. Any positive integers in this map are recognized as "
+	  "starting sources (seeds).");
 
     parm.spotdist = G_define_option();
     parm.spotdist->key = "spot_dist";
     parm.spotdist->type = TYPE_STRING;
     parm.spotdist->gisprompt = "old,cell,raster";
     parm.spotdist->guisection = _("Input maps");
+    parm.spotdist->label =
+	_("Raster map containing maximal spotting distance (m, required with -s)");
     parm.spotdist->description =
-	_("Name of raster map containing max SPOTting DISTance (m) (required w/ -s)");
+	_("Name of an existing raster map layer in "
+	  "the user's current mapset search path containing the maximum potential "
+	  "spotting distances (meters).");
 
     parm.velocity = G_define_option();
     parm.velocity->key = "w_speed";
     parm.velocity->type = TYPE_STRING;
     parm.velocity->gisprompt = "old,cell,raster";
     parm.velocity->guisection = _("Input maps");
+    parm.velocity->label =
+	_("Raster map containing midflame wind speed (ft/min, required with -s)");
     parm.velocity->description =
-	_("Name of raster map containing midflame Wind SPEED (ft/min) (required w/ -s)");
+	_("Name of an existing raster map layer in the "
+	  "user's current mapset search path containing wind velocities at half of "
+	  "the average flame height (feet/minute).");
 
     parm.mois = G_define_option();
     parm.mois->key = "f_mois";
     parm.mois->type = TYPE_STRING;
     parm.mois->gisprompt = "old,cell,raster";
     parm.mois->guisection = _("Input maps");
+    parm.mois->label =
+	_("Raster map containing fine fuel moisture of the cell receiving a spotting firebrand (%, required with -s)");
     parm.mois->description =
-	_("Name of raster map containing fine Fuel MOISture of the cell receiving a spotting firebrand (%) (required w/ -s)");
+	_("Name of an existing raster map layer in the "
+	  "user's current mapset search path containing the 1-hour (<.25\") fuel "
+	  "moisture (percentage content multiplied by 100).");
 
     parm.least = G_define_option();
     parm.least->key = "least_size";
@@ -176,35 +208,61 @@
     parm.least->key_desc = "odd int";
     parm.least->options = "3,5,7,9,11,13,15";
     parm.least->description =
-	_("Basic sampling window SIZE needed to meet certain accuracy (3)");
+	_("Basic sampling window size needed to meet certain accuracy (3)"); /* TODO: what is 3 here? default? */
+    parm.least->description =
+	_("An odd integer ranging 3 - 15 indicating "
+	  "the basic sampling window size within which all cells will be considered "
+	  "to see whether they will be reached by the current spread cell. The default "
+	  "number is 3 which means a 3x3 window.");
 
     parm.comp_dens = G_define_option();
     parm.comp_dens->key = "comp_dens";
     parm.comp_dens->type = TYPE_STRING;
     parm.comp_dens->key_desc = "decimal";
+    parm.comp_dens->label =
+	_("Sampling density for additional computing (range: 0.0 - 1.0 (0.5))"); /* TODO: again, what is 0.5?, TODO: range not set */
     parm.comp_dens->description =
-	_("Sampling DENSity for additional COMPutin (range: 0.0 - 1.0 (0.5))");
+	_("A decimal number ranging 0.0 - 1.0 indicating "
+	  "additional sampling cells will be considered to see whether they will be "
+	  "reached by the current spread cell. The closer to 1.0 the decimal number "
+	  "is, the longer the program will run and the higher the simulation accuracy "
+	  "will be. The default number is 0.5.");
 
     parm.init_time = G_define_option();
     parm.init_time->key = "init_time";
     parm.init_time->type = TYPE_STRING;
-    parm.init_time->key_desc = "int (>= 0)";
+    parm.init_time->key_desc = "int (>= 0)"; /* TODO: move to ->options */
+    parm.init_time->label =
+	_("Initial time for current simulation (0) (min)");
     parm.init_time->description =
-	_("INITial TIME for current simulation (0) (min)");
+	_("A non-negative number specifying the initial "
+	  "time for the current spread simulation (minutes). This is useful when multiple "
+	  "phase simulation is conducted. The default time is 0.");
 
     parm.time_lag = G_define_option();
     parm.time_lag->key = "lag";
     parm.time_lag->type = TYPE_STRING;
-    parm.time_lag->key_desc = "int (>= 0)";
+    parm.time_lag->key_desc = "int (>= 0)"; /* TODO: move to ->options */
     parm.time_lag->description =
-	_("Simulating time duration LAG (fill the region) (min)");
+	_("Simulating time duration LAG (fill the region) (min)"); /* TODO: what does this mean? */
+    parm.time_lag->description =
+	_("A non-negative integer specifying the simulating "
+	  "duration time lag (minutes). The default is infinite, but the program will "
+	  "terminate when the current geographic region/mask has been filled. It also "
+	  "controls the computational time, the shorter the time lag, the faster the "
+	  "program will run.");
 
+    /* TODO: what's this? probably display, so remove */
     parm.backdrop = G_define_option();
     parm.backdrop->key = "backdrop";
     parm.backdrop->type = TYPE_STRING;
     parm.backdrop->gisprompt = "old,cell,raster";
+    parm.backdrop->label =
+	_("Name of raster map as a display backdrop");
     parm.backdrop->description =
-	_("Name of raster map as a display backdrop");
+	_("Name of an existing raster map layer in the "
+	  "user's current mapset search path to be used as the background on which "
+	  "the \"live\" movement will be shown.");
 
     parm.out = G_define_option();
     parm.out->key = "output";
@@ -212,36 +270,51 @@
     parm.out->required = YES;
     parm.out->gisprompt = "new,cell,raster";
     parm.out->guisection = _("Output maps");
+    parm.out->label =
+	_("Raster map to contain output spread time (min)");
     parm.out->description =
-	_("Name of raster map to contain OUTPUT spread time (min)");
+	_("Name of the new raster map layer to contain "
+	  "the results of the cumulative spread time needed for a phenomenon to reach "
+	  "each cell from the starting sources (minutes).");
 
     parm.x_out = G_define_option();
     parm.x_out->key = "x_output";
     parm.x_out->type = TYPE_STRING;
     parm.x_out->gisprompt = "new,cell,raster";
     parm.x_out->guisection = _("Output maps");
+    parm.x_out->label =
+	_("Name of raster map to contain X back coordinates");
     parm.x_out->description =
-	_("Name of raster map to contain X_BACK coordinates");
+	_("Name of the new raster map layer to contain "
+	  "the results of backlink information in UTM easting coordinates for each "
+	  "cell.");
 
     parm.y_out = G_define_option();
     parm.y_out->key = "y_output";
     parm.y_out->type = TYPE_STRING;
     parm.y_out->gisprompt = "new,cell,raster";
     parm.y_out->guisection = _("Output maps");
+    parm.y_out->label =
+	_("Name of raster map to contain Y back coordinates");
     parm.y_out->description =
-	_("Name of raster map to contain Y_BACK coordinates");
+	_("Name of the new raster map layer to contain "
+	  "the results of backlink information in UTM northing coordinates for each "
+	  "cell.");
 
     flag.display = G_define_flag();
     flag.display->key = 'd';
 #if 0
-    flag.display->description = _("DISPLAY 'live' spread process on screen");
+    flag.display->label = _("DISPLAY 'live' spread process on screen");
+    flag.display->description =
+	_("Display the "live" simulation on screen. A graphics window "
+	  "must be opened and selected before using this option.");
 #else
-    flag.display->description = _("Live display - currently DISABLED");
+    flag.display->description = _("Live display - disabled and depreciated");
 #endif
 
     flag.spotting = G_define_flag();
     flag.spotting->key = 's';
-    flag.spotting->description = _("For wildfires: consider SPOTTING effect");
+    flag.spotting->description = _("Consider spotting effect (for wildfires)");
 
     /*   Parse command line */
     if (G_parser(argc, argv))

Modified: grass/trunk/raster/r.spread/r.spread.html
===================================================================
--- grass/trunk/raster/r.spread/r.spread.html	2014-02-21 22:24:48 UTC (rev 59120)
+++ grass/trunk/raster/r.spread/r.spread.html	2014-02-21 22:25:14 UTC (rev 59121)
@@ -2,11 +2,15 @@
 
 Spread phenomena usually show uneven movement over space. Such unevenness
 is due to two reasons:
-<br>1) the uneven conditions from location to location, which can be called
-SPATIAL HETEROGENEITY, and
-<br>2) the uneven conditions in different directions, which can be called
-ANISOTROPY.
-<br>The anisotropy of spread occurs when any of the determining factors
+
+<ol>
+<li>the uneven conditions from location to location, which can be called
+<em>spatial heterogeneity</em>, and
+<li>the uneven conditions in different directions, which can be called
+<em>anisotropy</em>.
+</ol>
+
+<p>The anisotropy of spread occurs when any of the determining factors
 have directional components. For example, wind and topography cause anisotropic
 spread of wildfires.
 
@@ -21,170 +25,72 @@
 given three raster map layers about ROS (base ROS, maximum ROS and direction
 of the maximum ROS) plus a raster map layer showing the starting sources.
 These ROS layers define unique ellipses for all cell locations in the current
-geographic region as if each cell center was a potential spread origin.
+computational region as if each cell center was a potential spread origin.
 For some wildfire spread, these ROS layers can be generated by another
 GRASS raster program r.ros. The actual locations reached by a spread event
 are constrained by the actual spread origins and the elapsed spread time.
 
 <p><I>r.spread </I>optionally produces raster maps to contain backlink
 UTM coordinates for each raster cell of the spread time map. The spread
-paths can be accurately traced based on the backlink information by another
-GRASS raster program r.spreadpath.
+paths can be accurately traced based on the backlink information by
+<em><a href="r.spreadpath.html">r.spreadpath</a></em> module.
 
 <p>Part of the spotting function in r.spread is based on Chase (1984)
 and Rothermel (1983). More information on <I>r.spread</I>, <I><a href="r.ros.html">r.ros</a></I>
 and <I><a href="r.spreadpath.html">r.spreadpath</a></I> can be found in
 Xu (1994).
 
-<h2>Flags:</h2>
-<dl>
+<p>Options <tt>spot_dist</tt>, <tt>w_speed</tt> and <tt>f_mois</tt> must all
+be given if the <tt>-s</tt> (spotting) flag is used.
 
-<dt>-d
-<dd> Display the "live" simulation on screen. A graphics window
-must be opened and selected before using this option.
 
-<dt>-s
-<dd> For wildfires, also consider spotting.
-</dl>
-
-<h2>Parameters</h2>
-<dl>
- 
-<dt><b>max=</b>name
-<dd>Name of an existing raster map layer in the user's current
-mapset search path containing the maximum ROS values (cm/minute).
-
-<dt><b>dir=</b>name 
-<dd>Name of an existing raster map layer in the user's
-current mapset search path containing directions of the maximum ROSes,
-clockwise from north (degree).
-
-<dt><b>base=</b>name 
-<dd>Name of an existing raster map layer in the user's
-current mapset search path containing the ROS values in the directions
-perpendicular to maximum ROSes' (cm/minute). These ROSes are also the ones
-without the effect of directional factors.
-
-<dt><b>start=</b>name 
-<dd>Name of an existing raster map layer in the
-user's current mapset search path containing starting locations of the
-spread phenomenon. Any positive integers in this map are recognized as
-starting sources.
-
-<dt><b>spot_dist=</b>name 
-<dd>Name of an existing raster map layer in
-the user's current mapset search path containing the maximum potential
-spotting distances (meters).
-
-<dt><b>w_speed=</b>name 
-<dd>Name of an existing raster map layer in the
-user's current mapset search path containing wind velocities at half of
-the average flame height (feet/minute).
-
-<dt><b>f_mois</b>=name 
-<dd>Name of an existing raster map layer in the
-user's current mapset search path containing the 1-hour (<.25") fuel
-moisture (percentage content multiplied by 100).
-
-<dt><b>least_size=</b>odd int An odd integer ranging 3 - 15 indicating
-the basic sampling window size within which all cells will be considered
-to see whether they will be reached by the current spread cell. The default
-number is 3 which means a 3x3 window.
-
-<dt><b>comp_dens=</b>decimal A decimal number ranging 0.0 - 1.0 indicating
-additional sampling cells will be considered to see whether they will be
-reached by the current spread cell. The closer to 1.0 the decimal number
-is, the longer the program will run and the higher the simulation accuracy
-will be. The default number is 0.5.
-
-<dt><b>init_time=</b>int A non-negative number specifying the initial
-time for the current spread simulation (minutes). This is useful when multiple
-phase simulation is conducted. The default time is 0.
-
-<dt><b>lag=</b>int A non-negative integer specifying the simulating
-duration time lag (minutes). The default is infinite, but the program will
-terminate when the current geographic region/mask has been filled. It also
-controls the computational time, the shorter the time lag, the faster the
-program will run.
-
-<dt><b>backdrop=</b>name 
-<dd>Name of an existing raster map layer in the
-user's current mapset search path to be used as the background on which
-the "live" movement will be shown.
-
-<dt><b>output=</b>name 
-<dd>Name of the new raster map layer to contain
-the results of the cumulative spread time needed for a phenomenon to reach
-each cell from the starting sources (minutes).
-
-<dt><b>x_output=</b>name 
-<dd>Name of the new raster map layer to contain
-the results of backlink information in UTM easting coordinates for each
-cell.
-
-<dt><b>y_output</b>=name 
-<dd>Name of the new raster map layer to contain
-the results of backlink information in UTM northing coordinates for each
-cell.
-</dl>
-
-<h2>OPTIONS</h2>
-The user can run r.spread either interactively or non- interactively. The
-program is run interactively if the user types <I>r.spread</I> without
-specifying flag settings and parameter values on the command line. In this
-case, the user will be prompted for input.
-
-<p>Alternately, the user can run r.spread non-interactively, by specifying
-the names of raster map layers and desired options on the command line,
-using the form:
-
-<p>r.spread [-vds] max=name dir=name base=name start=name [spot_dist=name]
-[w_speed=name] [f_mois=name] [least_size=odds int] [comp_dens=decimal]
-[init_time=int (>=0)] [lag=int (>= 0)] [backdrop=name] output=name [x_output=name]
-[y_output=name] The -d option can only be used after a graphics window
-is opened and selected.
-
-<p>Options spot_dist=name, w_speed=name and f_mois=name must all
-be given if the -s option is used.
-
-
 <h2>EXAMPLE</h2>
 Assume we have inputs, the following simulates a spotting- involved wildfire
-on the graphics window and generates three raster maps to contain spread
+and generates three raster maps to contain spread
 time, backlink information in UTM northing and easting coordinates:
 
-<p>r.spread -ds max=my_ros.max dir=my_ros.maxdir base=my_ros.base
-start=fire_origin spot_dist=my_ros.spotdist w_speed=wind_speed f_mois=1hour_moisture
-backdrop=image_burned output=my_spread x_output=my_spread.x y_output=my_spread.y
+<div class="code"><pre>
+r.spread -s max=my_ros.max dir=my_ros.maxdir base=my_ros.base \
+    start=fire_origin spot_dist=my_ros.spotdist w_speed=wind_speed \
+    f_mois=1hour_moisture output=my_spread \
+    x_output=my_spread.x y_output=my_spread.y
+</pre></div>
 
+
 <h2>NOTES</h2>
-1. r.spread is a specific implementation of the shortest path algorithm.
-r.cost GRASS program served as the starting point for the development of
-r.spread. One of the major differences between the two programs is that
-r.cost only simulates ISOTROPIC spread while r.spread can simulate ELLIPTICALLY
-ANISOTROPIC spread, including isotropic spread as a special case.
+1. <em>r.spread</em> is a specific implementation of the shortest path
+algorithm. <em><a href="r.cost.html">r.cost</a></em> module served
+as the starting point for the development of <em>r.spread</em>.
+One of the major differences between the two programs is that
+<em><a href="r.cost.html">r.cost</a></em> only simulates
+<em>isotropic</em> spread while <em>r.spread</em> can simulate
+<em>elliptically anisotropic</em> spread, including isotropic spread
+as a special case.
 
 <p>2. Before running r.spread, the user should prepare the ROS (base,
 max and direction) maps using appropriate models. For some wildfire spread,
-a separate GRASS program r.ros based on Rothermel's fire equation does
-such work. The combination of the two forms a simulation of wildfire spread.
+the <em><a href="r.ros.html">r.ros</a></em> module based on
+Rothermel's fire equation does such work.
+The combination of the two forms a simulation of wildfire spread.
 
 <p>3. The relationship of the start map and ROS maps should be logically
 correct, i.e. a starting source (a positive value in the start map) should
-not be located in a spread BARRIER (zero value in the ROS maps). Otherwise
-the program refuses to run.
+not be located in a spread <em>barrier</em> (zero value in the ROS maps).
+Otherwise the program refuses to run.
 
-<p>4. r.spread uses the current geographic region settings. The output
+<p>4. <em>r.spread</em> uses the current computational region settings. The output
 map layer will not go outside the boundaries set in the region, and will
 not be influenced by starting sources outside. So any change of the current
 region may influence the output. The recommendation is to use slightly
-larger region than needed. Refer to g.region to set an appropriate geographic
-region.
+larger region than needed.
+Refer to <em><a href="g.region.html">g.region</a></em> to set an appropriate
+computational region.
 
-<p>5. The inputs to r.spread should be in proper units.
+<p>5. The user should be sure that the inputs to <em>r.spread</em> are
+in proper units.
 
-<p>6. r.spread is a computationally intensive program. The user may
-need to choose appropriate size of the geographic region and resolution.
+<p>6. <em>r.spread</em> is a computationally intensive program. The user may
+need to choose appropriate size of the computational region and resolution.
 
 <p>7. A low and medium (i.e. <= 0.5) sampling density can improve
 accuracy for elliptical simulation significantly, without adding significantly
@@ -193,7 +99,6 @@
 
 <h2>SEE ALSO</h2>
 
-<em><a href="g.region.html">g.region</a></em>,
 <em><a href="r.cost.html">r.cost</a></em>,
 <!-- <em><a href="r.mask.html">r.mask</a></em>, -->
 <em><a href="r.spreadpath.html">r.spreadpath</a></em>,



More information about the grass-commit mailing list