[GRASS-SVN] r65113 - in grass/branches/releasebranch_7_0/raster: r.ros r.spread

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 20 19:57:57 PDT 2015


Author: wenzeslaus
Date: 2015-04-20 19:57:57 -0700 (Mon, 20 Apr 2015)
New Revision: 65113

Modified:
   grass/branches/releasebranch_7_0/raster/r.ros/spot_dist.c
   grass/branches/releasebranch_7_0/raster/r.spread/pick_dist.c
Log:
r.ros and r.spread: document spotting functions accoding to the source code (backport r64636)

Modified: grass/branches/releasebranch_7_0/raster/r.ros/spot_dist.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.ros/spot_dist.c	2015-04-20 15:57:30 UTC (rev 65112)
+++ grass/branches/releasebranch_7_0/raster/r.ros/spot_dist.c	2015-04-21 02:57:57 UTC (rev 65113)
@@ -60,6 +60,21 @@
     0.83, 0, -1.51, -0.89, -0.81, -0.78, -0.79
 };
 
+/**
+ * @brief Compute maximum spotting distance
+ *
+ * @param fuel fuel type used in Byram's equation from Rothermel (1991)
+ *        and in Chase (1984) equation for source z
+ * @param maxros maximal ROS used in Byram's equation
+ * @param speed wind speed used to compute mean windspeed at 6 meter
+ *        accoring to Chase (1984) influencing the target z
+ * @param angle direction of maximal ROS, i.e. the direction of spotting
+ *        (if you think that only direction of wind influences the spotting
+ *        then this should be the wind direction)
+ * @param row0 source cell row
+ * @param col0 source cell column
+ * @return maximum spotting distance
+ */
 int spot_dist(int fuel, float maxros, int speed, float angle, int row0,
 	      int col0)
 {
@@ -122,6 +137,7 @@
 	    + (col - col0) * (col - col0) * sqr_ew;
 	z = z0 - sqrd / (1.69 * U * U);
 
+	/* actual target elevation is higher then the potential one */
 	if (DATA(map_elev, row, col) > z) {
 #ifdef DEBUG
 	    printf
@@ -132,7 +148,7 @@
 #endif
 	    return (S);
 	}
-	/* advance a step */
+	/* advance a step, increase the spotting distance */
 	S = sqrt((double)sqrd);
 #ifdef DEBUG
 	printf

Modified: grass/branches/releasebranch_7_0/raster/r.spread/pick_dist.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.spread/pick_dist.c	2015-04-20 15:57:30 UTC (rev 65112)
+++ grass/branches/releasebranch_7_0/raster/r.spread/pick_dist.c	2015-04-21 02:57:57 UTC (rev 65113)
@@ -21,6 +21,11 @@
 #include <grass/gis.h>
 #include "local_proto.h"
 
+/**
+ * @brief Picks one possible distance value from range 0, u
+ * @param u maximum pontential distance
+ * @return value in range 0, u
+ */
 int pick_dist(int u)
 {
     int v;



More information about the grass-commit mailing list