[GRASS-SVN] r52878 - grass-addons/grass6/raster/r.sun.angle

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 24 12:17:05 PDT 2012


Author: mmetz
Date: 2012-08-24 12:17:05 -0700 (Fri, 24 Aug 2012)
New Revision: 52878

Modified:
   grass-addons/grass6/raster/r.sun.angle/main.c
Log:
r.sun.angle: eternal darkness to eternal sunshine

Modified: grass-addons/grass6/raster/r.sun.angle/main.c
===================================================================
--- grass-addons/grass6/raster/r.sun.angle/main.c	2012-08-24 18:13:55 UTC (rev 52877)
+++ grass-addons/grass6/raster/r.sun.angle/main.c	2012-08-24 19:17:05 UTC (rev 52878)
@@ -435,8 +435,13 @@
 		azimuthbuf[col] = s_azimuth;
 	    }
 	    
-	    if (sunhour_name)
+	    if (sunhour_name) {
 		sunhourbuf[col] = (pd.ssetr - pd.sretr) / 60.;
+		if (sunhourbuf[col] > 24.)
+		    sunhourbuf[col] = 24.;
+		if (sunhourbuf[col] < 0.)
+		    sunhourbuf[col] = 0.;
+	    }
 
 	}
 	if (elev_name)



More information about the grass-commit mailing list