[GRASS-SVN] r44044 - grass-addons/imagery/i.landsat.toar
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Oct 25 18:50:32 EDT 2010
Author: martinl
Date: 2010-10-25 15:50:32 -0700 (Mon, 25 Oct 2010)
New Revision: 44044
Modified:
grass-addons/imagery/i.landsat.toar/main.c
Log:
i.landsat.toar sync'ed with trunk
Modified: grass-addons/imagery/i.landsat.toar/main.c
===================================================================
--- grass-addons/imagery/i.landsat.toar/main.c 2010-10-25 22:36:15 UTC (rev 44043)
+++ grass-addons/imagery/i.landsat.toar/main.c 2010-10-25 22:50:32 UTC (rev 44044)
@@ -39,10 +39,10 @@
int nrows, ncols, row, col;
RASTER_MAP_TYPE in_data_type;
-
- struct Option *band_prefix, *output_suffix, *metfn, *sensor, *adate, *pdate, *elev,
+
+ struct Option *input_prefix, *output_prefix, *metfn, *sensor, *adate, *pdate, *elev,
*bgain, *metho, *perc, *dark, *satz, *atmo;
- char *basename, *met, *suffixname, *sensorname;
+ char *inputname, *met, *outputname, *sensorname;
struct Flag *msss, *frad, *l5_mtl;
lsat_data lsat;
@@ -65,19 +65,19 @@
module->keywords = _("imagery, landsat, top-of-atmosphere reflectance, dos-type simple atmospheric correction");
/* It defines the different parameters */
- band_prefix = G_define_option();
- band_prefix->key = "band_prefix";
- band_prefix->label = _("Base name of input raster bands");
- band_prefix->description = _("Example: 'B.' for B.1, B.2, ...");
- band_prefix->type = TYPE_STRING;
- band_prefix->required = YES;
+ input_prefix = G_define_option();
+ input_prefix->key = "input_prefix";
+ input_prefix->label = _("Base name of input raster bands");
+ input_prefix->description = _("Example: 'B.' for B.1, B.2, ...");
+ input_prefix->type = TYPE_STRING;
+ input_prefix->required = YES;
- output_suffix = G_define_option();
- output_suffix->key = "output_suffix";
- output_suffix->label = _("Suffix for output raster maps");
- output_suffix->description = _("Example: '_toar' generates B.1_toar, B.2_toar, ...");
- output_suffix->type = TYPE_STRING;
- output_suffix->required = YES;
+ output_prefix = G_define_option();
+ output_prefix->key = "output_prefix";
+ output_prefix->label = _("Prefix for output raster maps");
+ output_prefix->description = _("Example: 'B.toar.' generates B.toar.1, B.toar.2, ...");
+ output_prefix->type = TYPE_STRING;
+ output_prefix->required = YES;
metfn = G_define_standard_option(G_OPT_F_INPUT);
metfn->key = "metfile";
@@ -203,8 +203,8 @@
* Stores options and flag to variables
*****************************************/
met = metfn->answer;
- basename = band_prefix->answer;
- suffixname = output_suffix->answer;
+ inputname = input_prefix->answer;
+ outputname = output_prefix->answer;
sensorname = sensor -> answer ? sensor->answer: "";
G_zero(&lsat, sizeof(lsat));
@@ -337,7 +337,7 @@
for (j = 0; j < 256; j++)
hist[j] = 0L;
- sprintf(band_in, "%s%d", basename, lsat.band[i].code);
+ sprintf(band_in, "%s%d", inputname, lsat.band[i].code);
mapset = G_find_cell2(band_in, "");
if (mapset == NULL) {
G_warning(_("Raster map <%s> not found"), band_in);
@@ -469,8 +469,8 @@
G_message(_("Calculating..."));
for (i = 0; i < lsat.bands; i++) {
- sprintf(band_in, "%s%d", basename, lsat.band[i].code);
- sprintf(band_out, "%s%d%s", basename, lsat.band[i].code, suffixname);
+ sprintf(band_in, "%s%d", inputname, lsat.band[i].code);
+ sprintf(band_out, "%s%d", outputname, lsat.band[i].code);
mapset = G_find_cell2(band_in, "");
if (mapset == NULL) {
More information about the grass-commit
mailing list