[GRASS-SVN] r38182 - grass/branches/releasebranch_6_4/raster/r.sun2

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 3 04:25:53 EDT 2009


Author: hamish
Date: 2009-07-03 04:25:53 -0400 (Fri, 03 Jul 2009)
New Revision: 38182

Modified:
   grass/branches/releasebranch_6_4/raster/r.sun2/main.c
Log:
(Thomas Huld) Fixed problem with incidence angle being 0 when the sun isn't there. Now the value is null. Note that this is also the case if the pixel is in shadow.

Modified: grass/branches/releasebranch_6_4/raster/r.sun2/main.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.sun2/main.c	2009-07-03 08:18:57 UTC (rev 38181)
+++ grass/branches/releasebranch_6_4/raster/r.sun2/main.c	2009-07-03 08:25:53 UTC (rev 38182)
@@ -1921,9 +1921,13 @@
 		    lum =
 			lumcline2(&sunGeom, &sunVarGeom, &sunSlopeGeom,
 				  &gridGeom, horizonarray + shadowoffset);
-		    lum = rad2deg * asin(lum);
-		    lumcl[j][i] = (float)lum;
+		    if (lum > 0.) {
+			lum = rad2deg * asin(lum);
+			lumcl[j][i] = (float)lum;
+		    }
+		    else lumcl[j][i] = UNDEFZ;
 		}
+
 		if (someRadiation) {
 		    joules2(&sunGeom, &sunVarGeom, &sunSlopeGeom, &sunRadVar,
 			    &gridGeom, horizonarray + shadowoffset, latitude,
@@ -1945,7 +1949,6 @@
 	    shadowoffset += arrayNumInt;
 	}
 	arrayOffset++;
-
     }
 
     /* re-use &hist, but try all to initiate it for any case */



More information about the grass-commit mailing list