[GRASS-SVN] r64636 - in grass/trunk/raster: r.ros r.spread

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 14 19:56:24 PST 2015


Author: wenzeslaus
Date: 2015-02-14 19:56:24 -0800 (Sat, 14 Feb 2015)
New Revision: 64636

Modified:
   grass/trunk/raster/r.ros/spot_dist.c
   grass/trunk/raster/r.spread/pick_dist.c
Log:
r.ros and r.spread: document spotting functions accoding to the source code

Modified: grass/trunk/raster/r.ros/spot_dist.c
===================================================================
--- grass/trunk/raster/r.ros/spot_dist.c	2015-02-14 22:44:42 UTC (rev 64635)
+++ grass/trunk/raster/r.ros/spot_dist.c	2015-02-15 03:56:24 UTC (rev 64636)
@@ -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/trunk/raster/r.spread/pick_dist.c
===================================================================
--- grass/trunk/raster/r.spread/pick_dist.c	2015-02-14 22:44:42 UTC (rev 64635)
+++ grass/trunk/raster/r.spread/pick_dist.c	2015-02-15 03:56:24 UTC (rev 64636)
@@ -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