[GRASS-SVN] r47468 -
grass/branches/develbranch_6/imagery/i.topo.corr
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Aug 6 03:50:36 EDT 2011
Author: neteler
Date: 2011-08-06 00:50:36 -0700 (Sat, 06 Aug 2011)
New Revision: 47468
Modified:
grass/branches/develbranch_6/imagery/i.topo.corr/main.c
grass/branches/develbranch_6/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh
Log:
msg fixes; keyword standardization; test script tuning (percent method looks odd)
Modified: grass/branches/develbranch_6/imagery/i.topo.corr/main.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.topo.corr/main.c 2011-08-06 07:50:17 UTC (rev 47467)
+++ grass/branches/develbranch_6/imagery/i.topo.corr/main.c 2011-08-06 07:50:36 UTC (rev 47468)
@@ -17,6 +17,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
@@ -80,9 +81,9 @@
/* initialize module */
module = G_define_module();
- module->description = _("Computes topografic correction of reflectance.");
+ module->description = _("Computes topographic correction of reflectance.");
module->keywords =
- _("imagery, topographic correction, Cosine, Minnaert, C-Factor, Percent");
+ _("imagery, terrain, topographic correction");
/* It defines the different parameters */
@@ -90,7 +91,7 @@
input->required = NO;
input->multiple = YES;
input->description =
- _("Name of reflectance raster maps to correct topographically");
+ _("Name of reflectance raster maps to be corrected topographically");
output = G_define_standard_option(G_OPT_R_OUTPUT);
output->description =
@@ -98,7 +99,7 @@
base = G_define_standard_option(G_OPT_R_MAP);
base->key = "basemap";
- base->description = _("Name of input base raster map (elevation or ilumination)");
+ base->description = _("Name of input base raster map (elevation or illumination)");
zeni = G_define_option();
zeni->key = "zenith";
@@ -122,13 +123,13 @@
ilum = G_define_flag();
ilum->key = 'i';
- ilum->description = _("To output sun ilumination terrain model");
+ ilum->description = _("Output sun illumination terrain model");
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
if (ilum->answer && azim->answer == NULL)
- G_fatal_error(_("Solar azimuth is necessary to calculate ilumination terrain model"));
+ G_fatal_error(_("Solar azimuth is necessary to calculate illumination terrain model"));
if (!ilum->answer && input->answer == NULL)
G_fatal_error(_("Reflectance maps are necessary to make topographic correction"));
@@ -235,6 +236,19 @@
/* TODO: better avoid system() */
sprintf(command, "r.colors map=%s color=grey", out.name);
system(command);
+
+/* new but not functional:
+ {
+ struct FPRange range;
+ DCELL min, max;
+ struct Colors grey;
+ G_read_fp_range(out.name, G_mapset(), &range);
+ G_get_fp_range_min_max(&range, &min, &max);
+ G_make_grey_scale_colors(&grey, min, max);
+ G_write_colors(out.name, G_mapset(), &grey);
+ }
+*/
+
}
G_close_cell(dem.fd);
}
Modified: grass/branches/develbranch_6/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh
===================================================================
--- grass/branches/develbranch_6/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh 2011-08-06 07:50:17 UTC (rev 47467)
+++ grass/branches/develbranch_6/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh 2011-08-06 07:50:36 UTC (rev 47468)
@@ -60,29 +60,34 @@
#making the 'band' reflectance file
r.mapcalc "myplane_pyr_band = double((myplane_pyr_shaded - 60.)/18.)"
-d.mon stop=x0
+d.mon stop=x0 > /dev/null
d.mon x0
d.rast.leg myplane_pyr_band
+echo "Original" | d.text color=black
## test it:
# percent
METHOD=percent
i.topo.corr input=myplane_pyr_band output=myplane_pyr_topocorr_${METHOD} basemap=myplane_pyr_illumination zenith=$solarzenith method=$METHOD
-d.mon stop=x1
+d.mon stop=x1 > /dev/null
d.mon x1
d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
+echo "METHOD=percent" | d.text color=black
# minnaert
METHOD=minnaert
i.topo.corr input=myplane_pyr_band output=myplane_pyr_topocorr_${METHOD} basemap=myplane_pyr_illumination zenith=$solarzenith method=$METHOD
-d.mon stop=x2
+d.mon stop=x2 > /dev/null
d.mon x2
d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
+echo "METHOD=minnaert" | d.text color=black
# c-factor
METHOD=c-factor
i.topo.corr input=myplane_pyr_band output=myplane_pyr_topocorr_${METHOD} basemap=myplane_pyr_illumination zenith=$solarzenith method=$METHOD
-d.mon stop=x3
+d.mon stop=x3 > /dev/null
d.mon x3
d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
+echo "METHOD=c-factor" | d.text color=black
+exit 0
More information about the grass-commit
mailing list