[GRASS-SVN] r60958 - grass/branches/releasebranch_7_0/imagery/i.landsat.toar

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jun 25 05:00:23 PDT 2014


Author: neteler
Date: 2014-06-25 05:00:23 -0700 (Wed, 25 Jun 2014)
New Revision: 60958

Modified:
   grass/branches/releasebranch_7_0/imagery/i.landsat.toar/i.landsat.toar.html
   grass/branches/releasebranch_7_0/imagery/i.landsat.toar/main.c
Log:
i.landsat.toar: added scale parameter to make output usable for i.gensigset

Modified: grass/branches/releasebranch_7_0/imagery/i.landsat.toar/i.landsat.toar.html
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.landsat.toar/i.landsat.toar.html	2014-06-25 12:00:14 UTC (rev 60957)
+++ grass/branches/releasebranch_7_0/imagery/i.landsat.toar/i.landsat.toar.html	2014-06-25 12:00:23 UTC (rev 60958)
@@ -103,6 +103,10 @@
 
 <h2>NOTES</h2>
 
+The output raster cell values can be rescaled with the <b>scale</b>
+parameter (e.g., with 100 in case of using reflectance output
+in <em>i.gensigset</em>).
+
 <h3>On Landsat-8 metadata file </h3>
 
 NASA reports a structure of the L1G Metadata file 

Modified: grass/branches/releasebranch_7_0/imagery/i.landsat.toar/main.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.landsat.toar/main.c	2014-06-25 12:00:14 UTC (rev 60957)
+++ grass/branches/releasebranch_7_0/imagery/i.landsat.toar/main.c	2014-06-25 12:00:23 UTC (rev 60958)
@@ -45,7 +45,7 @@
     RASTER_MAP_TYPE in_data_type;
 
     struct Option *input_prefix, *output_prefix, *metfn, *sensor, *adate,
-	*pdate, *elev, *bgain, *metho, *perc, *dark, *atmo, *lsatmet;
+	*pdate, *elev, *bgain, *metho, *perc, *dark, *atmo, *lsatmet, *oscale;
     char *inputname, *met, *outputname, *sensorname;
     struct Flag *frad, *print_meta, *named;
 
@@ -53,7 +53,7 @@
     char band_in[GNAME_MAX], band_out[GNAME_MAX];
     int i, j, q, method, pixel, dn_dark[MAX_BANDS], dn_mode[MAX_BANDS], dn_sat;
     int overwrite;
-    double qcal, rad, ref, percent, ref_mode, rayleigh;
+    double qcal, rad, ref, percent, ref_mode, rayleigh, scale;
     unsigned long hist[QCALMAX], h_max;
 
     struct Colors colors;
@@ -213,6 +213,13 @@
     lsatmet->descriptions = desc;
     lsatmet->guisection = _("Settings");
 
+    oscale = G_define_option();
+    oscale->key = "scale";
+    oscale->type = TYPE_DOUBLE;
+    oscale->answer = "1.0";
+    oscale->required = NO;
+    oscale->description = _("Scale factor for output");
+
     /* define the different flags */
     frad = G_define_flag();
     frad->key = 'r';
@@ -269,6 +276,7 @@
     percent = atof(perc->answer);
     pixel = atoi(dark->answer);
     rayleigh = atof(atmo->answer);
+    scale = atof(oscale->answer);
 
     /*
      * Data from metadata file
@@ -612,7 +620,7 @@
 			    ref = lsat_rad2temp(rad, &lsat.band[i]);
 			}
 			else {
-			    ref = lsat_rad2ref(rad, &lsat.band[i]);
+			    ref = lsat_rad2ref(rad, &lsat.band[i]) * scale;
 			    if (ref < 0. && method > DOS)
 				ref = 0.;
 			}



More information about the grass-commit mailing list