[GRASS-SVN] r31168 - in grass-addons/gipe: i.albedo i.biomass
i.evapo.potrad
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Apr 28 22:36:08 EDT 2008
Author: ychemin
Date: 2008-04-28 22:36:08 -0400 (Mon, 28 Apr 2008)
New Revision: 31168
Modified:
grass-addons/gipe/i.albedo/main.c
grass-addons/gipe/i.biomass/main.c
grass-addons/gipe/i.biomass/solar_day.c
grass-addons/gipe/i.evapo.potrad/solar_day.c
Log:
new coding standards in i.albedo and i.biomass
Modified: grass-addons/gipe/i.albedo/main.c
===================================================================
--- grass-addons/gipe/i.albedo/main.c 2008-04-29 00:56:00 UTC (rev 31167)
+++ grass-addons/gipe/i.albedo/main.c 2008-04-29 02:36:08 UTC (rev 31168)
@@ -390,6 +390,9 @@
if (G_put_raster_row (outfd, outrast, out_data_type) < 0)
G_fatal_error (_("Cannot write to <%s>"),result);
}
+ /* Color table for albedo */
+ G_init_colors(&colors);
+ G_add_color_rule(0,0,0,0,1,255,255,255,&colors);
for (i=1;i<=nfiles;i++)
{
G_free (inrast[i]);
Modified: grass-addons/gipe/i.biomass/main.c
===================================================================
--- grass-addons/gipe/i.biomass/main.c 2008-04-29 00:56:00 UTC (rev 31167)
+++ grass-addons/gipe/i.biomass/main.c 2008-04-29 02:36:08 UTC (rev 31168)
@@ -29,7 +29,6 @@
int nrows, ncols;
int row,col;
- int verbose=1;
struct GModule *module;
struct Option *input1, *input2, *input3, *input4, *input5, *input6;
struct Option *output1;
@@ -65,66 +64,42 @@
module->description = _("biomass growth calculation, precursor of yield calculation when processing crop ");
/* Define the different options */
- input1 = G_define_option() ;
+ input1 = G_define_standard_option(G_OPT_R_INPUT) ;
input1->key = _("fpar");
- input1->type = TYPE_STRING;
- input1->required = YES;
- input1->gisprompt =_("old,cell,raster") ;
input1->description=_("Name of the fPAR map");
input1->answer =_("fpar");
- input2 = G_define_option() ;
+ input2 = G_define_standard_option(G_OPT_R_INPUT) ;
input2->key =_("lightuseff");
- input2->type = TYPE_STRING;
- input2->required = YES;
- input2->gisprompt =_("old,cell,raster");
input2->description=_("Name of the light use efficiency map (UZB:cotton=1.9)");
input2->answer =_("lightuseff");
- input3 = G_define_option() ;
+ input3 = G_define_standard_option(G_OPT_R_INPUT) ;
input3->key =_("lat");
- input3->type = TYPE_STRING;
- input3->required = YES;
- input3->gisprompt =_("old,cell,raster");
input3->description=_("Name of the degree latitude map [dd.ddd]");
input3->answer =_("lat");
- input4 = G_define_option() ;
+ input4 = G_define_standard_option(G_OPT_R_INPUT) ;
input4->key =_("doy");
- input4->type = TYPE_STRING;
- input4->required = YES;
- input4->gisprompt =_("old,cell,raster");
input4->description=_("Name of the Day of Year map [0.0-366.0]");
input4->answer =_("doy");
- input5 = G_define_option() ;
+ input5 = G_define_standard_option(G_OPT_R_INPUT) ;
input5->key =_("tsw");
- input5->type = TYPE_STRING;
- input5->required = YES;
- input5->gisprompt =_("old,cell,raster");
input5->description=_("Name of the single-way transmissivity map [0.0-1.0]");
input5->answer =_("tsw");
- input6 = G_define_option() ;
+ input6 = G_define_standard_option(G_OPT_R_INPUT) ;
input6->key =_("wat_avail");
- input6->type = TYPE_STRING;
- input6->required = YES;
- input6->gisprompt =_("old,cell,raster");
input6->description=_("Value of the water availability map (1-water stress, can use evaporative fraction directly) [0.0;1.0]");
input6->answer =_("wat_avail");
- output1 = G_define_option() ;
+ output1 = G_define_standard_option(G_OPT_R_INPUT) ;
output1->key =_("output");
- output1->type = TYPE_STRING;
- output1->required = YES;
- output1->gisprompt =_("new,cell,raster");
output1->description=_("Name of the output daily biomass growth layer");
output1->answer =_("biomass");
- flag1 = G_define_flag();
- flag1->key = 'q';
- flag1->description = _("Quiet");
/********************/
if (G_parser(argc, argv))
exit (EXIT_FAILURE);
@@ -137,7 +112,6 @@
wat_avail = input6->answer;
result1 = output1->answer;
- verbose = (!flag1->answer);
/***************************************************/
mapset = G_find_cell2(fpar, "");
if (mapset == NULL) {
@@ -223,8 +197,7 @@
DCELL d_tsw;
DCELL d_solar;
DCELL d_wat_avail;
- if(verbose)
- G_percent(row,nrows,2);
+ G_percent(row,nrows,2);
/* read input maps */
if(G_get_raster_row(infd_fpar,inrast_fpar,row,data_type_fpar)<0)
G_fatal_error(_("Could not read from <%s>"),fpar);
@@ -268,6 +241,9 @@
if (G_put_raster_row (outfd1, outrast1, data_type_output) < 0)
G_fatal_error(_("Cannot write to output raster file"));
}
+ /* Color table for biomass */
+ G_init_colors(&colors);
+ G_add_color_rule(0,0,0,0,1,255,255,255,&colors);
G_free (inrast_fpar);
G_free (inrast_lightuseff);
Modified: grass-addons/gipe/i.biomass/solar_day.c
===================================================================
--- grass-addons/gipe/i.biomass/solar_day.c 2008-04-29 00:56:00 UTC (rev 31167)
+++ grass-addons/gipe/i.biomass/solar_day.c 2008-04-29 02:36:08 UTC (rev 31168)
@@ -3,7 +3,6 @@
#include<stdlib.h>
// Average Solar Diurnal Radiation after Bastiaanssen (1995)
-// ychemin at gmail.com - Yann Chemin - LGPL, Copylefted, 2004.
#define PI 3.1415927
Modified: grass-addons/gipe/i.evapo.potrad/solar_day.c
===================================================================
--- grass-addons/gipe/i.evapo.potrad/solar_day.c 2008-04-29 00:56:00 UTC (rev 31167)
+++ grass-addons/gipe/i.evapo.potrad/solar_day.c 2008-04-29 02:36:08 UTC (rev 31168)
@@ -3,7 +3,6 @@
#include<stdlib.h>
// Average Solar Diurnal Radiation after Bastiaanssen (1995)
-// ychemin at gmail.com - Yann Chemin - LGPL, Copylefted, 2004.
#define PI 3.1415927
More information about the grass-commit
mailing list