[GRASS-SVN] r37961 - in grass/trunk/imagery: i.eb.evapfr i.eb.g0
i.eb.h_SEBAL01
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jun 19 10:59:46 EDT 2009
Author: martinl
Date: 2009-06-19 10:59:46 -0400 (Fri, 19 Jun 2009)
New Revision: 37961
Modified:
grass/trunk/imagery/i.eb.evapfr/
grass/trunk/imagery/i.eb.evapfr/Makefile
grass/trunk/imagery/i.eb.evapfr/evap_fr.c
grass/trunk/imagery/i.eb.evapfr/i.eb.evapfr.html
grass/trunk/imagery/i.eb.evapfr/main.c
grass/trunk/imagery/i.eb.evapfr/soilmoisture.c
grass/trunk/imagery/i.eb.g0/
grass/trunk/imagery/i.eb.g0/Makefile
grass/trunk/imagery/i.eb.g0/g0.c
grass/trunk/imagery/i.eb.g0/i.eb.g0.html
grass/trunk/imagery/i.eb.g0/main.c
grass/trunk/imagery/i.eb.h_SEBAL01/
grass/trunk/imagery/i.eb.h_SEBAL01/Makefile
grass/trunk/imagery/i.eb.h_SEBAL01/i.eb.h_SEBAL01.html
grass/trunk/imagery/i.eb.h_SEBAL01/main.c
Log:
Please follow SUBMITTING rules if you add new modules
* svn prop set
* use standard messages!
(http://grass.osgeo.org/wiki/Development_Specs)
* don't use _() macro for option->key
* better not to use default answers for input raster maps
Property changes on: grass/trunk/imagery/i.eb.evapfr
___________________________________________________________________
Name: svn:ignore
+ OBJ.*
Property changes on: grass/trunk/imagery/i.eb.evapfr/Makefile
___________________________________________________________________
Name: svn:mime-type
+ text/x-sh
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Property changes on: grass/trunk/imagery/i.eb.evapfr/evap_fr.c
___________________________________________________________________
Name: svn:mime-type
+ text/x-csrc
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Modified: grass/trunk/imagery/i.eb.evapfr/i.eb.evapfr.html
===================================================================
--- grass/trunk/imagery/i.eb.evapfr/i.eb.evapfr.html 2009-06-19 14:53:48 UTC (rev 37960)
+++ grass/trunk/imagery/i.eb.evapfr/i.eb.evapfr.html 2009-06-19 14:59:46 UTC (rev 37961)
@@ -31,4 +31,4 @@
<p>
-<i>Last changed: $Date: 2006/10/10 11:28:44 $</i>
+<i>Last changed: $Date$</i>
Property changes on: grass/trunk/imagery/i.eb.evapfr/i.eb.evapfr.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Modified: grass/trunk/imagery/i.eb.evapfr/main.c
===================================================================
--- grass/trunk/imagery/i.eb.evapfr/main.c 2009-06-19 14:53:48 UTC (rev 37960)
+++ grass/trunk/imagery/i.eb.evapfr/main.c 2009-06-19 14:59:46 UTC (rev 37961)
@@ -6,7 +6,7 @@
* PURPOSE: Calculates the evaporative fraction
* as seen in Bastiaanssen (1995)
*
- * COPYRIGHT: (C) 2002-2006 by the GRASS Development Team
+ * COPYRIGHT: (C) 2002-2009 by the GRASS Development Team
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
@@ -20,6 +20,7 @@
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
+
double evap_fr(double r_net, double g0, double h0);
double soilmoisture(double evapfr);
@@ -30,14 +31,13 @@
int makin = 0; /*Makin Flag for root zone soil moisture output */
struct GModule *module;
struct Option *input1, *input2, *input3, *output1, *output2;
- struct Flag *flag1, *flag2;
+ struct Flag *flag1;
struct History history; /*metadata */
char *result1, *result2; /*output raster name */
int infd_rnet, infd_g0, infd_h0;
int outfd1, outfd2;
char *rnet, *g0, *h0;
- char *evapfr, *theta;
void *inrast_rnet, *inrast_g0, *inrast_h0;
DCELL * outrast1, *outrast2;
@@ -46,48 +46,43 @@
G_gisinit(argv[0]);
module = G_define_module();
module->keywords =
- _("evaporative fraction, soil moisture, energy balance, SEBAL");
+ _("imagery, evaporative fraction, soil moisture, energy balance, SEBAL");
module->description =
- _("evaporative fraction (Bastiaanssen, 1995) and root zone soil moisture (Makin, Molden and Bastiaanssen, 2001)");
+ _("Computes evaporative fraction (Bastiaanssen, 1995) and "
+ "root zone soil moisture (Makin, Molden and Bastiaanssen, 2001)");
/* Define the different options */
input1 = G_define_standard_option(G_OPT_R_INPUT);
- input1->key = _("rnet");
- input1->description = _("Name of the Net Radiation map [W/m2]");
- input1->answer = _("rnet");
+ input1->key = "rnet";
+ input1->description = _("Name of Net Radiation raster map [W/m2]");
input2 = G_define_standard_option(G_OPT_R_INPUT);
- input2->key = _("g0");
- input2->description = _("Name of the soil heat flux map [W/m2]");
- input2->answer = _("g0");
+ input2->key = "g0";
+ input2->description = _("Name of soil heat flux raster map [W/m2]");
input3 = G_define_standard_option(G_OPT_R_INPUT);
- input3->key = _("h0");
- input3->description = _("Name of the sensible heat flux map [W/m2]");
- input3->answer = _("h0");
+ input3->key = "h0";
+ input3->description = _("Name of sensible heat flux raster map [W/m2]");
output1 = G_define_standard_option(G_OPT_R_OUTPUT);
- output1->key = _("evapfr");
+ output1->key = "evapfr";
output1->description =
- _("Name of the output evaporative fraction layer");
- output1->answer = _("evapfr");
+ _("Name for output evaporative fraction raster map");
output2 = G_define_standard_option(G_OPT_R_OUTPUT);
- output2->key = _("theta");
+ output2->key = "theta";
output2->required = NO;
output2->description =
- _("Name of the output root zone soil moisture layer");
- output2->answer = _("theta");
+ _("Name for output root zone soil moisture raster map");
flag1 = G_define_flag();
flag1->key = 'm';
flag1->description =
- _("root zone soil moisture output (Makin, Molden and Bastiaanssen, 2001)");
-
- /********************/
+ _("Root zone soil moisture output (Makin, Molden and Bastiaanssen, 2001)");
+
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
-
+
rnet = input1->answer;
g0 = input2->answer;
h0 = input3->answer;
@@ -118,11 +113,11 @@
outrast2 = G_allocate_d_raster_buf();
/* Create New raster files */
- if ((outfd1 = G_open_raster_new(result1,DCELL_TYPE)) < 0)
- G_fatal_error(_("Unable to open raster map <%s>"), result1);
+ if ((outfd1 = G_open_raster_new(result1, DCELL_TYPE)) < 0)
+ G_fatal_error(_("Unable to create raster map <%s>"), result1);
if (makin)
- if ((outfd2 = G_open_raster_new(result2,DCELL_TYPE)) < 0)
- G_fatal_error(_("Unable to open raster map <%s>"), result2);
+ if ((outfd2 = G_open_raster_new(result2, DCELL_TYPE)) < 0)
+ G_fatal_error(_("Unable to create raster map <%s>"), result2);
/* Process pixels */
for (row = 0; row < nrows; row++)
@@ -135,11 +130,12 @@
/* read input maps */
if (G_get_d_raster_row(infd_rnet, inrast_rnet, row)<0)
- G_fatal_error(_("Unable to read from <%s>"), rnet);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), rnet, row);
if (G_get_d_raster_row(infd_g0, inrast_g0, row) < 0)
- G_fatal_error(_("Unable to read from <%s>"), g0);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), g0, row);
if (G_get_d_raster_row(infd_h0, inrast_h0, row) < 0)
- G_fatal_error(_("Unable to read from <%s>"), h0);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), h0, row);
+
/*process the data */
for (col = 0; col < ncols; col++)
{
@@ -166,11 +162,11 @@
}
}
if (G_put_d_raster_row(outfd1, outrast1) < 0)
- G_fatal_error(_("Unable to write to output raster map"));
+ G_fatal_error(_("Failed writing raster map <%s>"), result1);
if (makin)
{
if (G_put_d_raster_row(outfd2, outrast2) < 0)
- G_fatal_error(_("Unable to write to output raster map"));
+ G_fatal_error(_("Failed writing raster map <%s>"), result2);
}
}
G_free(inrast_rnet);
@@ -193,6 +189,7 @@
G_command_history(&history);
G_write_history(result2, &history);
}
+
exit(EXIT_SUCCESS);
}
Property changes on: grass/trunk/imagery/i.eb.evapfr/main.c
___________________________________________________________________
Name: svn:mime-type
+ text/x-csrc
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Property changes on: grass/trunk/imagery/i.eb.evapfr/soilmoisture.c
___________________________________________________________________
Name: svn:mime-type
+ text/x-csrc
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Property changes on: grass/trunk/imagery/i.eb.g0
___________________________________________________________________
Name: svn:ignore
+ OBJ.*
Property changes on: grass/trunk/imagery/i.eb.g0/Makefile
___________________________________________________________________
Name: svn:mime-type
+ text/x-sh
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Modified: grass/trunk/imagery/i.eb.g0/g0.c
===================================================================
--- grass/trunk/imagery/i.eb.g0/g0.c 2009-06-19 14:53:48 UTC (rev 37960)
+++ grass/trunk/imagery/i.eb.g0/g0.c 2009-06-19 14:59:46 UTC (rev 37961)
@@ -1,11 +1,13 @@
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
- double g_0(double bbalb, double ndvi, double tempk, double rnet,
- double time, int roerink)
+
+double g_0(double bbalb, double ndvi, double tempk, double rnet,
+ double time, int roerink)
{
double a, b, result;
double r0_coef;
+
if (time <= 9.0 || time > 15.0)
r0_coef = 1.1;
else if (time > 9.0 && time <= 11.0)
@@ -22,6 +24,7 @@
/* HAPEX-Sahel (Roerink, 1995) */
if (roerink)
result = result * 1.430 - 0.0845;
+
return result;
}
Property changes on: grass/trunk/imagery/i.eb.g0/g0.c
___________________________________________________________________
Name: svn:mime-type
+ text/x-csrc
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Modified: grass/trunk/imagery/i.eb.g0/i.eb.g0.html
===================================================================
--- grass/trunk/imagery/i.eb.g0/i.eb.g0.html 2009-06-19 14:53:48 UTC (rev 37960)
+++ grass/trunk/imagery/i.eb.g0/i.eb.g0.html 2009-06-19 14:59:46 UTC (rev 37961)
@@ -34,4 +34,4 @@
<p>
-<i>Last changed: $Date: 2006/10/08 21:30:42 $</i>
+<i>Last changed: $Date$</i>
Property changes on: grass/trunk/imagery/i.eb.g0/i.eb.g0.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Modified: grass/trunk/imagery/i.eb.g0/main.c
===================================================================
--- grass/trunk/imagery/i.eb.g0/main.c 2009-06-19 14:53:48 UTC (rev 37960)
+++ grass/trunk/imagery/i.eb.g0/main.c 2009-06-19 14:59:46 UTC (rev 37961)
@@ -7,7 +7,7 @@
* as seen in Bastiaanssen (1995) using time of
* satellite overpass.
*
- * COPYRIGHT: (C) 2006-2007 by the GRASS Development Team
+ * COPYRIGHT: (C) 2006-2009 by the GRASS Development Team
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
@@ -20,8 +20,10 @@
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
+
double g_0(double bbalb, double ndvi, double tempk, double rnet,
double time, int roerink);
+
int main(int argc, char *argv[])
{
int nrows, ncols;
@@ -40,52 +42,42 @@
*inrast_time;
DCELL * outrast;
- /************************************/
G_gisinit(argv[0]);
+
module = G_define_module();
- module->keywords = _("soil heat flux, energy balance, SEBAL");
- module->description =
- _("soil heat flux approximation (Bastiaanssen, 1995)");
+ module->keywords = _("imagery, soil heat flux, energy balance, SEBAL");
+ module->description = _("Soil heat flux approximation (Bastiaanssen, 1995)");
/* Define the different options */
input1 = G_define_standard_option(G_OPT_R_INPUT);
input1->key = "albedo";
- input1->description = _("Name of the Albedo map [0.0;1.0]");
- input1->answer = "albedo";
+ input1->description = _("Name of Albedo raster map [0.0;1.0]");
input2 = G_define_standard_option(G_OPT_R_INPUT);
input2->key = "ndvi";
- input2->description = _("Name of the ndvi map [-1.0;+1.0]");
- input2->answer = "ndvi";
+ input2->description = _("Name of NDVI raster map [-1.0;+1.0]");
input3 = G_define_standard_option(G_OPT_R_INPUT);
input3->key = "tempk";
input3->description =
- _("Name of the Surface temperature map [degree Kelvin]");
- input3->answer = "tempk";
+ _("Name of Surface temperature raster map [degree Kelvin]");
input4 = G_define_standard_option(G_OPT_R_INPUT);
input4->key = "rnet";
- input4->description = _("Name of the Net Radiation map [W/m2]");
- input4->answer = "rnet";
+ input4->description = _("Name of Net Radiation raster map [W/m2]");
input5 = G_define_standard_option(G_OPT_R_INPUT);
input5->key = "time";
input5->description =
- _("Name of the time of satellite overpass map [local UTC]");
- input5->answer = "time";
+ _("Name of time of satellite overpass raster map [local UTC]");
output1 = G_define_standard_option(G_OPT_R_OUTPUT);
- output1->key = "g0";
- output1->description = _("Name of the output g0 layer");
- output1->answer = "g0";
flag1 = G_define_flag();
flag1->key = 'r';
flag1->description =
_("HAPEX-Sahel empirical correction (Roerink, 1995)");
- /********************/
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -110,11 +102,11 @@
inrast_tempk = G_allocate_d_raster_buf();
if ((infd_rnet = G_open_cell_old(rnet, "")) < 0)
- G_fatal_error(_("Unable to open raster map [%s]"), rnet);
+ G_fatal_error(_("Unable to open raster map <%s>"), rnet);
inrast_rnet = G_allocate_d_raster_buf();
if ((infd_time = G_open_cell_old(time, "")) < 0)
- G_fatal_error(_("Unable to open raster map [%s]"), time);
+ G_fatal_error(_("Unable to open raster map <%s>"), time);
inrast_time = G_allocate_d_raster_buf();
nrows = G_window_rows();
@@ -123,7 +115,8 @@
/* Create New raster files */
if ((outfd = G_open_raster_new(result,DCELL_TYPE)) < 0)
- G_fatal_error(_("Unable to open raster map<%s>"), result);
+ G_fatal_error(_("Unable to create raster map <%s>"), result);
+
/* Process pixels */
for (row = 0; row < nrows; row++)
{
@@ -136,15 +129,20 @@
G_percent(row, nrows, 2);
/* read input maps */
if (G_get_d_raster_row(infd_albedo, inrast_albedo, row) < 0)
- G_fatal_error(_("Unable to read from <%s>"), albedo);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"),
+ albedo, row);
if (G_get_d_raster_row(infd_ndvi, inrast_ndvi, row)<0)
- G_fatal_error(_("Unable to read from <%s>"), ndvi);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"),
+ ndvi, row);
if (G_get_d_raster_row(infd_tempk, inrast_tempk, row)< 0)
- G_fatal_error(_("Unable to read from <%s>"), tempk);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"),
+ tempk, row);
if (G_get_d_raster_row(infd_rnet, inrast_rnet, row)<0)
- G_fatal_error(_("Unable to read from <%s>"), rnet);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"),
+ rnet, row);
if (G_get_d_raster_row(infd_time, inrast_time, row)<0)
- G_fatal_error(_("Unable to read from <%s>"), time);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"),
+ time, row);
/*process the data */
for (col = 0; col < ncols; col++)
{
@@ -167,7 +165,7 @@
}
}
if (G_put_d_raster_row(outfd, outrast) < 0)
- G_fatal_error(_("Unable to write to output raster map"));
+ G_fatal_error(_("Failed writing raster map <%s>"), result);
}
G_free(inrast_albedo);
G_free(inrast_ndvi);
@@ -188,6 +186,7 @@
G_short_history(result, "raster", &history);
G_command_history(&history);
G_write_history(result, &history);
+
exit(EXIT_SUCCESS);
}
Property changes on: grass/trunk/imagery/i.eb.g0/main.c
___________________________________________________________________
Name: svn:mime-type
+ text/x-csrc
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Property changes on: grass/trunk/imagery/i.eb.h_SEBAL01
___________________________________________________________________
Name: svn:ignore
+ OBJ.*
Property changes on: grass/trunk/imagery/i.eb.h_SEBAL01/Makefile
___________________________________________________________________
Name: svn:mime-type
+ text/x-sh
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Modified: grass/trunk/imagery/i.eb.h_SEBAL01/i.eb.h_SEBAL01.html
===================================================================
--- grass/trunk/imagery/i.eb.h_SEBAL01/i.eb.h_SEBAL01.html 2009-06-19 14:53:48 UTC (rev 37960)
+++ grass/trunk/imagery/i.eb.h_SEBAL01/i.eb.h_SEBAL01.html 2009-06-19 14:59:46 UTC (rev 37961)
@@ -1,63 +1,63 @@
-<html>
-<body>
-<H2>NAME</H2> <B><I>i.eb.h_SEBAL01 </I></B>- computation of <i>sensible heat flux</i> [W/m2] after Bastiaanssen, 1995 in [1], used in this form in 2001 by [2]. Implemented in this code in [3].
-<H2>DESCRIPTION</H2>
-
-<p><EM>i.eb.h_SEBAL01</EM> will calculate the sensible heat flux map (h0), given both maps of Net Radiation and soil Heat flux (Rn, g0) at instantaneous time, the surface roughness (z0m), a map of the altitude corrected temperature (t0dem), a point data of the frictional velocity (u*), a value of actual vapour pressure (ea[KPa]) and the (x,y) pairs for wet and dry pixels.
-
-Full process will need those:
-<ul>
- <li>i.vi, i.albedo, i.latlong, i.emissivity
- <li>i.evapo.potrad
- <li>i.eb.netrad, i.eb.g0, i.eb.h_sebal01
- <li>i.eb.evapfr, i.eb.eta
-</ul>
-
-(for time integration: i.evapo.time_integration)
-
-<p>For more details on the algorithms see [1][2][3].
-
-<H2>OPTIONS</H2>
-
-<H2>NOTES</H2>
-- z0m can be alculated by i.eb.z0m or i.eb.z0m0 (grass-addons).
-
-- ea can be calculated with standard meteorological data.
- eoTmin=0.6108*EXP(17.27*Tmin/(Tmin+237.3))
- eoTmax=0.6108*EXP(17.27*Tmax/(Tmax+237.3))
- ea=(RH/100)/((eoTmin+eoTmax)/2)
-
-- t0dem = surface temperature + (altitude * 0.627 / 100)
-
-
-
-<H2>SEE ALSO</H2>
-<ul>
- <li><a href=i.eb.g0.html>i.eb.g0</a>,
- <a href=i.eb.h_SEBAL01.html>i.eb.h_SEBAL01</a>,
- <a href=i.eb.evapfr.html>i.eb.evapfr</a></li>
-</ul>
-
-
-<H2>REFERENCES</H2>
-
- <p>[1] Bastiaanssen, W.G.M., 1995.
- Estimation of Land surface paramters by remote sensing under clear-sky conditions. PhD thesis, Wageningen University, Wageningen, The Netherlands.
-
- <p>[2] Chemin Y., Alexandridis T.A., 2001. Improving spatial resolution of ET seasonal for irrigated rice in Zhanghe, China}''. Asian Journal of Geoinformatics. 5(1):3-11,2004.
-
- <p>[3] Alexandridis T.K., Cherif I., Chemin Y., Silleos N.G., Stavrinos E., Zalidis G.C. Integrated methodology for estimating water use in Mediterranean agricultural areas. Remote Sensing. -(-):,2009. (submitted))
-
-
-<H2>AUTHORS</H2>
- <p>
- <i>
- <br>Yann Chemin, International Rice Research Institute, Los Banos, The Philippines.
- </i>
- <p>Contact: <a href="mailto:yann.chemin at gmail.com"> Yann chemin</a>
-
-
-
-<p><i>Last changed: $Date: 2009/06/19 09:00:00 $</i>
-</body>
-</html>
+<html>
+<body>
+<H2>NAME</H2> <B><I>i.eb.h_SEBAL01 </I></B>- computation of <i>sensible heat flux</i> [W/m2] after Bastiaanssen, 1995 in [1], used in this form in 2001 by [2]. Implemented in this code in [3].
+<H2>DESCRIPTION</H2>
+
+<p><EM>i.eb.h_SEBAL01</EM> will calculate the sensible heat flux map (h0), given both maps of Net Radiation and soil Heat flux (Rn, g0) at instantaneous time, the surface roughness (z0m), a map of the altitude corrected temperature (t0dem), a point data of the frictional velocity (u*), a value of actual vapour pressure (ea[KPa]) and the (x,y) pairs for wet and dry pixels.
+
+Full process will need those:
+<ul>
+ <li>i.vi, i.albedo, i.latlong, i.emissivity
+ <li>i.evapo.potrad
+ <li>i.eb.netrad, i.eb.g0, i.eb.h_sebal01
+ <li>i.eb.evapfr, i.eb.eta
+</ul>
+
+(for time integration: i.evapo.time_integration)
+
+<p>For more details on the algorithms see [1][2][3].
+
+<H2>OPTIONS</H2>
+
+<H2>NOTES</H2>
+- z0m can be alculated by i.eb.z0m or i.eb.z0m0 (grass-addons).
+
+- ea can be calculated with standard meteorological data.
+ eoTmin=0.6108*EXP(17.27*Tmin/(Tmin+237.3))
+ eoTmax=0.6108*EXP(17.27*Tmax/(Tmax+237.3))
+ ea=(RH/100)/((eoTmin+eoTmax)/2)
+
+- t0dem = surface temperature + (altitude * 0.627 / 100)
+
+
+
+<H2>SEE ALSO</H2>
+<ul>
+ <li><a href=i.eb.g0.html>i.eb.g0</a>,
+ <a href=i.eb.h_SEBAL01.html>i.eb.h_SEBAL01</a>,
+ <a href=i.eb.evapfr.html>i.eb.evapfr</a></li>
+</ul>
+
+
+<H2>REFERENCES</H2>
+
+ <p>[1] Bastiaanssen, W.G.M., 1995.
+ Estimation of Land surface paramters by remote sensing under clear-sky conditions. PhD thesis, Wageningen University, Wageningen, The Netherlands.
+
+ <p>[2] Chemin Y., Alexandridis T.A., 2001. Improving spatial resolution of ET seasonal for irrigated rice in Zhanghe, China}''. Asian Journal of Geoinformatics. 5(1):3-11,2004.
+
+ <p>[3] Alexandridis T.K., Cherif I., Chemin Y., Silleos N.G., Stavrinos E., Zalidis G.C. Integrated methodology for estimating water use in Mediterranean agricultural areas. Remote Sensing. -(-):,2009. (submitted))
+
+
+<H2>AUTHORS</H2>
+ <p>
+ <i>
+ <br>Yann Chemin, International Rice Research Institute, Los Banos, The Philippines.
+ </i>
+ <p>Contact: <a href="mailto:yann.chemin at gmail.com"> Yann chemin</a>
+
+
+
+<p><i>Last changed: $Date$</i>
+</body>
+</html>
Property changes on: grass/trunk/imagery/i.eb.h_SEBAL01/i.eb.h_SEBAL01.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
Modified: grass/trunk/imagery/i.eb.h_SEBAL01/main.c
===================================================================
--- grass/trunk/imagery/i.eb.h_SEBAL01/main.c 2009-06-19 14:53:48 UTC (rev 37960)
+++ grass/trunk/imagery/i.eb.h_SEBAL01/main.c 2009-06-19 14:59:46 UTC (rev 37961)
@@ -26,8 +26,6 @@
#include <grass/gis.h>
#include <grass/glocale.h>
-#define PI 3.14159265358979
-
double **G_alloc_matrix(int rows, int cols)
{
double **m;
@@ -82,28 +80,29 @@
G_gisinit(argv[0]);
module = G_define_module();
- module->description = _("Sensible Heat Flux iteration SEBAL 01");
+ module->description = _("Computes sensible Heat Flux iteration SEBAL 01");
+ module->keywords = _("imagery, evaporative fraction, soil moisture, energy balance, SEBAL");
/* Define different options */
input_Rn = G_define_standard_option(G_OPT_R_INPUT);
- input_Rn->key = "Rn";
+ input_Rn->key = "rnet";
input_Rn->description =
- _("Name of instantaneous Net Radiation map [W/m2]");
+ _("Name of instantaneous Net Radiation raster map [W/m2]");
input_g0 = G_define_standard_option(G_OPT_R_INPUT);
input_g0->key = "g0";
input_g0->description =
- _("Name of instantaneous soil heat flux map [W/m2]");
+ _("Name of instantaneous soil heat flux raster map [W/m2]");
input_z0m = G_define_standard_option(G_OPT_R_INPUT);
input_z0m->key = "z0m";
input_z0m->description =
- _("Name of aerodynamic resistance to heat momentum [s/m]");
+ _("Name of aerodynamic resistance to heat momentum raster map [s/m]");
input_t0dem = G_define_standard_option(G_OPT_R_INPUT);
input_t0dem->key = "t0dem";
input_t0dem->description =
- _("Name of altitude corrected surface temperature [K]");
+ _("Name of altitude corrected surface temperature raster map [K]");
input_ustar = G_define_option();
input_ustar->key = "ustar";
@@ -118,7 +117,6 @@
input_ea->key = "ea";
input_ea->type = TYPE_DOUBLE;
input_ea->required = YES;
- input_ea->gisprompt = "old,value";
input_ea->answer = "1.511";
input_ea->description = _("Value of the actual vapour pressure [KPa]");
input_ea->guisection = _("Parameters");
@@ -127,7 +125,6 @@
input_row_wet->key = "row_wet";
input_row_wet->type = TYPE_DOUBLE;
input_row_wet->required = NO;
- input_row_wet->gisprompt = "old,value";
input_row_wet->description = _("Row value of the wet pixel");
input_row_wet->guisection = _("Parameters");
@@ -135,7 +132,6 @@
input_col_wet->key = "col_wet";
input_col_wet->type = TYPE_DOUBLE;
input_col_wet->required = NO;
- input_col_wet->gisprompt = "old,value";
input_col_wet->description = _("Column value of the wet pixel");
input_col_wet->guisection = _("Parameters");
@@ -143,7 +139,6 @@
input_row_dry->key = "row_dry";
input_row_dry->type = TYPE_DOUBLE;
input_row_dry->required = NO;
- input_row_dry->gisprompt = "old,value";
input_row_dry->description = _("Row value of the dry pixel");
input_row_dry->guisection = _("Parameters");
@@ -151,13 +146,12 @@
input_col_dry->key = "col_dry";
input_col_dry->type = TYPE_DOUBLE;
input_col_dry->required = NO;
- input_col_dry->gisprompt = "old,value";
input_col_dry->description = _("Column value of the dry pixel");
input_col_dry->guisection = _("Parameters");
output = G_define_standard_option(G_OPT_R_OUTPUT);
- output->description = _("Name of output sensible heat flux layer [W/m2]");
-
+ output->description = _("Name for output sensible heat flux raster map [W/m2]");
+
/* Define the different flags */
flag2 = G_define_flag();
flag2->key = 'a';
@@ -189,7 +183,7 @@
if ((!input_row_wet->answer || !input_col_wet->answer ||
!input_row_dry->answer || !input_col_dry->answer) &&
!flag2->answer) {
- G_fatal_error(_("FATAL ERROR: either auto-mode either wet/dry pixels coordinates should be provided!"));
+ G_fatal_error(_("Either auto-mode either wet/dry pixels coordinates should be provided!"));
}
if (flag3->answer) {
G_message(_("Manual wet/dry pixels in image coordinates"));
@@ -200,27 +194,28 @@
G_message(_("Wet Pixel=> row:%.0f col:%.0f"), m_row_wet, m_col_wet);
G_message(_("Dry Pixel=> row:%.0f col:%.0f"), m_row_dry, m_col_dry);
}
+
/* check legal output name */
if (G_legal_filename(h0) < 0)
- G_fatal_error(_("[%s] is an illegal name"), h0);
+ G_fatal_error(_("<%s> is an illegal name"), h0);
if ((infd_Rn = G_open_cell_old(Rn, "")) < 0)
- G_fatal_error(_("Cannot open cell file [%s]"), Rn);
+ G_fatal_error(_("Unable to open raster map <%s>"), Rn);
if ((infd_g0 = G_open_cell_old(g0, "")) < 0)
- G_fatal_error(_("Cannot open cell file [%s]"), g0);
+ G_fatal_error(_("Unable to open raster map <%s>"), g0);
if ((infd_z0m = G_open_cell_old(z0m, "")) < 0)
- G_fatal_error(_("Cannot open cell file [%s]"), z0m);
+ G_fatal_error(_("Unable to open raster map <%s>"), z0m);
if ((infd_t0dem = G_open_cell_old(t0dem, "")) < 0)
- G_fatal_error(_("Cannot open cell file [%s]"), t0dem);
+ G_fatal_error(_("Unable to open raster map <%s>"), t0dem);
if (G_get_cellhd(Rn, "", &cellhd) < 0)
- G_fatal_error(_("Cannot read file header of [%s]"), Rn);
+ G_fatal_error(_("Unable to read header of raster map <%s>"), Rn);
if (G_get_cellhd(g0, "", &cellhd) < 0)
- G_fatal_error(_("Cannot read file header of [%s]"), g0);
+ G_fatal_error(_("Unable to read header of raster map <%s>"), g0);
if (G_get_cellhd(z0m, "", &cellhd) < 0)
- G_fatal_error(_("Cannot read file header of [%s]"), z0m);
+ G_fatal_error(_("Unable to read header of raster map <%s>"), z0m);
if (G_get_cellhd(t0dem, "", &cellhd) < 0)
- G_fatal_error(_("Cannot read file header of [%s]"), t0dem);
+ G_fatal_error(_("Unable to read header of raster map <%s>"), t0dem);
/* Allocate input buffer */
inrast_Rn = G_allocate_d_raster_buf();
@@ -248,16 +243,16 @@
outrast = G_allocate_d_raster_buf();
if ((outfd = G_open_raster_new(h0, DCELL_TYPE)) < 0)
- G_fatal_error(_("Could not open <%s>"), h0);
+ G_fatal_error(_("Unable to create raster map <%s>"), h0);
/***************************************************/
/* Allocate memory for temporary images */
double **d_Roh, **d_Rah;
if ((d_Roh = G_alloc_matrix(nrows, ncols)) == NULL)
- G_message("cannot allocate memory for temporary d_Roh image");
+ G_message("Unable to allocate memory for temporary d_Roh image");
if ((d_Rah = G_alloc_matrix(nrows, ncols)) == NULL)
- G_message("cannot allocate memory for temporary d_Rah image");
+ G_message("Unable to allocate memory for temporary d_Rah image");
/***************************************************/
/* MANUAL T0DEM WET/DRY PIXELS */
@@ -281,11 +276,11 @@
DCELL d_t0dem;
G_percent(row, nrows, 2);
if (G_get_d_raster_row(infd_t0dem,inrast_t0dem,row)<0)
- G_fatal_error(_("Could not read from <%s>"),t0dem);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
if (G_get_d_raster_row(infd_Rn,inrast_Rn,row)<0)
- G_fatal_error(_("Could not read from <%s>"),Rn);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), Rn, row);
if (G_get_d_raster_row(infd_g0,inrast_g0,row)<0)
- G_fatal_error(_("Could not read from <%s>"),g0);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), g0, row);
/*process the data */
for (col = 0; col < ncols; col++) {
d_t0dem = ((DCELL *) inrast_t0dem)[col];
@@ -326,15 +321,15 @@
}
}
}
- G_message("row_wet=%d\tcol_wet=%d\n", row_wet, col_wet);
- G_message("row_dry=%d\tcol_dry=%d\n", row_dry, col_dry);
- G_message("g0_wet=%f\n", d_g0_wet);
- G_message("Rn_wet=%f\n", d_Rn_wet);
- G_message("LE_wet=%f\n", d_Rn_wet - d_g0_wet);
- G_message("t0dem_dry=%f\n", d_t0dem_dry);
- G_message("rnet_dry=%f\n", d_Rn_dry);
- G_message("g0_dry=%f\n", d_g0_dry);
- G_message("h0_dry=%f\n", d_Rn_dry - d_g0_dry);
+ G_message("row_wet=%d\tcol_wet=%d", row_wet, col_wet);
+ G_message("row_dry=%d\tcol_dry=%d", row_dry, col_dry);
+ G_message("g0_wet=%f", d_g0_wet);
+ G_message("Rn_wet=%f", d_Rn_wet);
+ G_message("LE_wet=%f", d_Rn_wet - d_g0_wet);
+ G_message("t0dem_dry=%f", d_t0dem_dry);
+ G_message("rnet_dry=%f", d_Rn_dry);
+ G_message("g0_dry=%f", d_g0_dry);
+ G_message("h0_dry=%f", d_Rn_dry - d_g0_dry);
}/* END OF FLAG2 */
@@ -354,11 +349,11 @@
rowDry = row;
colDry = col;
if (G_get_d_raster_row(infd_Rn, inrast_Rn, row) < 0)
- G_fatal_error(_("Could not read from <%s>"), Rn);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), Rn, row);
if (G_get_d_raster_row(infd_g0, inrast_g0, row) < 0)
- G_fatal_error(_("Could not read from <%s>"), g0);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), g0, row);
if (G_get_d_raster_row(infd_t0dem, inrast_t0dem, row) < 0)
- G_fatal_error(_("Could not read from <%s>"), t0dem);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
d_Rn_dry = ((DCELL *) inrast_Rn)[col];
d_g0_dry = ((DCELL *) inrast_g0)[col];
d_t0dem_dry = ((DCELL *) inrast_t0dem)[col];
@@ -377,7 +372,7 @@
rowWet = row;
colWet = col;
if (G_get_d_raster_row(infd_t0dem, inrast_t0dem, row) < 0)
- G_fatal_error(_("Could not read from <%s>"), t0dem);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
d_t0dem_wet = ((DCELL *) inrast_t0dem)[col];
/* END OF MANUAL WET/DRY PIXELS */
double h_dry;
@@ -399,9 +394,9 @@
G_percent(row, nrows, 2);
/* read a line input maps into buffers */
if (G_get_d_raster_row(infd_z0m, inrast_z0m, row) < 0)
- G_fatal_error(_("Could not read from <%s>"), z0m);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), z0m, row);
if (G_get_d_raster_row(infd_t0dem, inrast_t0dem,row)<0)
- G_fatal_error(_("Could not read from <%s>"), t0dem);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
/* read every cell in the line buffers */
for (col = 0; col < ncols; col++) {
d_z0m = ((DCELL *) inrast_z0m)[col];
@@ -462,9 +457,9 @@
G_percent(row, nrows, 2);
/* read a line input maps into buffers */
if (G_get_d_raster_row(infd_z0m, inrast_z0m, row) < 0)
- G_fatal_error(_("Could not read from <%s>"), z0m);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), z0m, row);
if (G_get_d_raster_row(infd_t0dem, inrast_t0dem,row)<0)
- G_fatal_error(_("Could not read from <%s>"), t0dem);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
/* read every cell in the line buffers */
for (col = 0; col < ncols; col++) {
d_z0m = ((DCELL *) inrast_z0m)[col];
@@ -483,7 +478,7 @@
}
d_L =-1004*d_roh1*pow(ustar,3)*d_t0dem/(d_h1*9.81*0.41);
d_x = pow((1-16*(5/d_L)),0.25);
- d_psim =2*log((1+d_x)/2)+log((1+pow(d_x,2))/2)-2*atan(d_x)+0.5*PI;
+ d_psim =2*log((1+d_x)/2)+log((1+pow(d_x,2))/2)-2*atan(d_x)+0.5*M_PI;
d_psih =2*log((1+pow(d_x,2))/2);
d_u5 =(ustar/0.41)*log(5/d_z0m);
d_rah2 = (1/(d_u5*pow(0.41,2)))*log((5/d_z0m)-d_psim)
@@ -531,9 +526,9 @@
G_percent(row, nrows, 2);
/* read a line input maps into buffers */
if (G_get_d_raster_row(infd_z0m,inrast_z0m,row)<0)
- G_fatal_error(_("Could not read from <%s>"), z0m);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), z0m, row);
if (G_get_d_raster_row(infd_t0dem,inrast_t0dem,row)<0)
- G_fatal_error(_("Could not read from <%s>"), t0dem);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
/* read every cell in the line buffers */
for (col = 0; col < ncols; col++) {
d_z0m = ((DCELL *) inrast_z0m)[col];
@@ -553,7 +548,7 @@
d_L =-1004*d_roh1*pow(ustar,3)*d_t0dem/(d_h2*9.81*0.41);
d_x = pow((1 - 16 * (5 / d_L)), 0.25);
d_psim =2*log((1+d_x)/2)+log((1+pow(d_x,2))/2)-
- 2*atan(d_x)+0.5*PI;
+ 2*atan(d_x)+0.5*M_PI;
d_psih =2*log((1+pow(d_x,2))/2);
d_u5 =(ustar/0.41)*log(5/d_z0m);
d_rah3=(1/(d_u5*pow(0.41,2)))*log((5/d_z0m)-d_psim)*
@@ -601,9 +596,9 @@
G_percent(row, nrows, 2);
/* read a line input maps into buffers */
if (G_get_d_raster_row(infd_z0m, inrast_z0m, row) < 0)
- G_fatal_error(_("Could not read from <%s>"), z0m);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), z0m, row);
if (G_get_d_raster_row(infd_t0dem,inrast_t0dem,row)<0)
- G_fatal_error(_("Could not read from <%s>"), t0dem);
+ G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
/* read every cell in the line buffers */
for (col = 0; col < ncols; col++) {
d_z0m = ((DCELL *) inrast_z0m)[col];
@@ -630,7 +625,7 @@
}
}
if (G_put_d_raster_row(outfd, outrast) < 0)
- G_fatal_error("Cannot write to output file <%s>", h0);
+ G_fatal_error("Failed writing raster map <%s>", h0);
}
Property changes on: grass/trunk/imagery/i.eb.h_SEBAL01/main.c
___________________________________________________________________
Name: svn:mime-type
+ text/x-csrc
Name: svn:keywords
+ Author Date Id
Name: svn:eol-style
+ native
More information about the grass-commit
mailing list