Преглед изворни кода

r.ros and r.spread: document spotting functions accoding to the source code

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64636 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras пре 10 година
родитељ
комит
47867e15c2
2 измењених фајлова са 22 додато и 1 уклоњено
  1. 17 1
      raster/r.ros/spot_dist.c
  2. 5 0
      raster/r.spread/pick_dist.c

+ 17 - 1
raster/r.ros/spot_dist.c

@@ -60,6 +60,21 @@ double B[14] = { 0, -1.21, -1.32, -1.19, -1.05, -0.92, -0.94,
     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 @@ int spot_dist(int fuel, float maxros, int speed, float angle, int row0,
 	    + (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 @@ int spot_dist(int fuel, float maxros, int speed, float angle, int row0,
 #endif
 	    return (S);
 	}
-	/* advance a step */
+	/* advance a step, increase the spotting distance */
 	S = sqrt((double)sqrd);
 #ifdef DEBUG
 	printf

+ 5 - 0
raster/r.spread/pick_dist.c

@@ -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;