[GRASS-SVN] r31920 - in grass-addons/gipe: . i.eb.evapfr i.water

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jul 1 06:39:19 EDT 2008


Author: ychemin
Date: 2008-07-01 06:39:17 -0400 (Tue, 01 Jul 2008)
New Revision: 31920

Modified:
   grass-addons/gipe/gmmenu.tcl
   grass-addons/gipe/i.eb.evapfr/main.c
   grass-addons/gipe/i.water/description.html
   grass-addons/gipe/menudata.py
Log:
i.eb.evapfr: added G_set_d_null_value()

Modified: grass-addons/gipe/gmmenu.tcl
===================================================================
--- grass-addons/gipe/gmmenu.tcl	2008-07-01 10:13:16 UTC (rev 31919)
+++ grass-addons/gipe/gmmenu.tcl	2008-07-01 10:39:17 UTC (rev 31920)
@@ -574,6 +574,7 @@
 				{command {[G_msg "Vegetation Indices (13 types) cluster"]} {} "i.vi.mpi" {} -command {execute i.vi.mpi }}
 				{separator}
 				{command {[G_msg "Albedo"]} {} "i.albedo" {} -command {execute i.albedo }}
+				{command {[G_msg "Water"]} {} "i.water" {} -command {execute i.water }}
 				{command {[G_msg "Emissivity (generic from NDVI)"]} {} "i.emissivity" {} -command {execute i.emissivity }}
 				{separator}
 				{command {[G_msg "Latitude map"]} {} "i.latitude" {} -command {execute i.latitude }}

Modified: grass-addons/gipe/i.eb.evapfr/main.c
===================================================================
--- grass-addons/gipe/i.eb.evapfr/main.c	2008-07-01 10:13:16 UTC (rev 31919)
+++ grass-addons/gipe/i.eb.evapfr/main.c	2008-07-01 10:39:17 UTC (rev 31920)
@@ -50,7 +50,7 @@
 	int i=0,j=0;
 	
 	void *inrast_rnet, *inrast_g0, *inrast_h0;
-	unsigned char *outrast1, *outrast2;
+	DCELL *outrast1, *outrast2;
 	RASTER_MAP_TYPE data_type_output=DCELL_TYPE;
 	RASTER_MAP_TYPE data_type_rnet;
 	RASTER_MAP_TYPE data_type_g0;
@@ -204,31 +204,23 @@
 					d_h0 = ((DCELL *) inrast_h0)[col];
 					break;
 			}
-			if(G_is_d_null_value(&d_rnet)){
-				((DCELL *) outrast1)[col] = -999.99;
+			if(G_is_d_null_value(&d_rnet)||
+			G_is_d_null_value(&d_g0)||
+			G_is_d_null_value(&d_h0)){
+				G_set_d_null_value(&outrast1[col],1);
 				if(makin){
-					((DCELL *) outrast2)[col] = -999.99;
+					G_set_d_null_value(&outrast2[col],1);
 				}
-			}else if(G_is_d_null_value(&d_g0)){
-				((DCELL *) outrast1)[col] = -999.99;
-				if(makin){
-					((DCELL *) outrast1)[col] = -999.99;
-				}
-			}else if(G_is_d_null_value(&d_h0)){
-				((DCELL *) outrast1)[col] = -999.99;
-				if(makin){
-					((DCELL *) outrast1)[col] = -999.99;
-				}
 			}else {
 				/****************************************/
 				/* calculate evaporative fraction	*/
 				d = evap_fr(d_rnet,d_g0,d_h0);
-				((DCELL *) outrast1)[col] = d;
+				outrast1[col] = d;
 				/****************************************/
 				/* calculate soil moisture		*/
 				if(makin){
 					d = soilmoisture(d);
-					((DCELL *) outrast2)[col] = d;
+					outrast2[col] = d;
 				}
 			}
 		}

Modified: grass-addons/gipe/i.water/description.html
===================================================================
--- grass-addons/gipe/i.water/description.html	2008-07-01 10:13:16 UTC (rev 31919)
+++ grass-addons/gipe/i.water/description.html	2008-07-01 10:39:17 UTC (rev 31920)
@@ -1,12 +1,12 @@
 <H2>DESCRIPTION</H2>
 
 <EM>i.water</EM> calculates a water layer after Xiao et al (2005) and Roy et al (2005).
-It takes input of Diurnal Net Radiation (see r.sun), evaporative fraction (see r.eb.evapfr) and surface skin temprature. 
 
 <H2>REFERENCES</H2>
 
 Xiao X., Boles S., Liu J., Zhuang D., Frokling S., Li C., Salas W., Moore III B. (2005). Mapping paddy rice agriculture in southern China using multi-temporal MODIS images. Remote Sensing of Environment 95:480-492.
 
+
 Roy D.P., Jin Y., Lewis P.E., Justice C.O. (2005). Prototyping a global algorithm for systematic fire-affected area mapping using MODIS time series data. Remote Sensing of Environment 97:137-162.
 
 <H2>NOTES</H2>

Modified: grass-addons/gipe/menudata.py
===================================================================
--- grass-addons/gipe/menudata.py	2008-07-01 10:13:16 UTC (rev 31919)
+++ grass-addons/gipe/menudata.py	2008-07-01 10:39:17 UTC (rev 31920)
@@ -1429,6 +1429,10 @@
                           _("Albedo"),
                           "self.RunMenuCmd",
                           "i.albedo"),
+                         (_("Water"),
+                          _("Water detection"),
+                          "self.RunMenuCmd",
+                          "i.water"),
                          (_("Emissivity (generic from NDVI)"),
                           _("Emissivity (generic from NDVI)"),
                           "self.RunMenuCmd",



More information about the grass-commit mailing list