فهرست منبع

(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. (merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38184 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 16 سال پیش
والد
کامیت
b1cd3ab5f8
1فایلهای تغییر یافته به همراه6 افزوده شده و 3 حذف شده
  1. 6 3
      raster/r.sun2/main.c

+ 6 - 3
raster/r.sun2/main.c

@@ -1922,9 +1922,13 @@ void calculate(double singleSlope, double singleAspect, double singleAlbedo,
 		    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,
@@ -1946,7 +1950,6 @@ void calculate(double singleSlope, double singleAspect, double singleAlbedo,
 	    shadowoffset += arrayNumInt;
 	}
 	arrayOffset++;
-
     }
 
     /* re-use &hist, but try all to initiate it for any case */