[GRASS-SVN] r52327 - grass/branches/develbranch_6/imagery/i.landsat.toar

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 6 07:16:13 PDT 2012


Author: martinl
Date: 2012-07-06 07:16:13 -0700 (Fri, 06 Jul 2012)
New Revision: 52327

Modified:
   grass/branches/develbranch_6/imagery/i.landsat.toar/description.html
   grass/branches/develbranch_6/imagery/i.landsat.toar/earth_sun.c
   grass/branches/develbranch_6/imagery/i.landsat.toar/main.c
Log:
i.landsat.toar: sync'ed with add-ons


Modified: grass/branches/develbranch_6/imagery/i.landsat.toar/description.html
===================================================================
--- grass/branches/develbranch_6/imagery/i.landsat.toar/description.html	2012-07-06 14:15:15 UTC (rev 52326)
+++ grass/branches/develbranch_6/imagery/i.landsat.toar/description.html	2012-07-06 14:16:13 UTC (rev 52327)
@@ -179,24 +179,24 @@
 <ul>
   <li>Chander G., B.L. Markham and D.L. Helder, 2009: Remote Sensing of
     Environment, vol. 113</li>
-  
+
   <li>Chander G.H. and B. Markham, 2003.: IEEE Transactions On Geoscience And
     Remote Sensing, vol. 41, no. 11.</li>
-  
+
   <li>Chavez P.S., jr. 1996. Image-based atmospheric corrections -
     Revisited and Improved. Photogrammetric Engineering and Remote
     Sensing 62(9): 1025-1036.</li>
-  
+
   <li>Huang et al: At-Satellite Reflectance, 2002: A First Order Normalization
     Of Landsat 7 ETM+ Images.</li>
-  
+
   <li>R. Irish: <a href="http://landsathandbook.gsfc.nasa.gov/orbit_coverage/">Landsat
       7. Science Data Users Handbook</a>. February 17, 2007; 15 May 2011.</li>
-  
+
   <li>Markham B.L. and J.L. Barker, 1986: Landsat MSS and TM Post-Calibration
     Dynamic Ranges, Exoatmospheric Reflectances and At-Satellite
     Temperatures. EOSAT Landsat Technical Notes, No. 1.</li>
-  
+
   <li>Moran M.S., R.D. Jackson, P.N. Slater and P.M. Teillet, 1992: Remote
     Sensing of Environment, vol. 41.</li>
 

Modified: grass/branches/develbranch_6/imagery/i.landsat.toar/earth_sun.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.landsat.toar/earth_sun.c	2012-07-06 14:15:15 UTC (rev 52326)
+++ grass/branches/develbranch_6/imagery/i.landsat.toar/earth_sun.c	2012-07-06 14:16:13 UTC (rev 52327)
@@ -13,7 +13,7 @@
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
  *  Some functions in this file use the VSOP87 solution by
  *  Messrs. Bretagnon and Francou.

Modified: grass/branches/develbranch_6/imagery/i.landsat.toar/main.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.landsat.toar/main.c	2012-07-06 14:15:15 UTC (rev 52326)
+++ grass/branches/develbranch_6/imagery/i.landsat.toar/main.c	2012-07-06 14:16:13 UTC (rev 52327)
@@ -29,7 +29,7 @@
 {
     struct History history;
     struct GModule *module;
-    
+
     struct Cell_head cellhd;
     char *mapset;
 
@@ -37,25 +37,24 @@
     int infd, outfd;
     void *ptr;
     int nrows, ncols, row, col;
-    
+
     RASTER_MAP_TYPE in_data_type;
 
     struct Option *input_prefix, *output_prefix, *metfn, *sensor, *adate, *pdate, *elev,
 	*bgain, *metho, *perc, *dark, *atmo;
     char *inputname, *met, *outputname, *sensorname;
     struct Flag *msss, *frad, *l5_mtl;
-    
+
     lsat_data lsat;
     char band_in[GNAME_MAX], band_out[GNAME_MAX];
     int i, j, q, method, pixel, dn_dark[MAX_BANDS], dn_mode[MAX_BANDS];
-    int overwrite;
     double qcal, rad, ref, percent, ref_mode, rayleigh;
 
     struct Colors colors;
     struct FPRange range;
     double min, max;
     unsigned long hist[256], h_max;
-    
+
     /* initialize GIS environment */
     G_gisinit(argv[0]);
 
@@ -64,8 +63,7 @@
     module->description =
 	_("Calculates top-of-atmosphere radiance or reflectance and temperature for Landsat MSS/TM/ETM+.");
     module->keywords = _("imagery, landsat, top-of-atmosphere reflectance, dos-type simple atmospheric correction");
-    module->overwrite = TRUE;
-    
+
     /* It defines the different parameters */
     input_prefix = G_define_option();
     input_prefix->key = "input_prefix";
@@ -112,7 +110,7 @@
     metho->description = _("Required only if 'metfile' not given");
     metho->answer = "uncorrected";
     metho->guisection = _("Metadata");
-    
+
     adate = G_define_option();
     adate->key = "date";
     adate->type = TYPE_STRING;
@@ -121,7 +119,7 @@
     adate->label = _("Image acquisition date (yyyy-mm-dd)");
     adate->description = _("Required only if 'metfile' not given");
     adate->guisection = _("Metadata");
-    
+
     elev = G_define_option();
     elev->key = "solar_elevation";
     elev->type = TYPE_DOUBLE;
@@ -176,7 +174,7 @@
     frad = G_define_flag();
     frad->key = 'r';
     frad->description = _("Output at-sensor radiance for all bands");
-    
+
     msss = G_define_flag();
     msss->key = 's';
     msss->description = _("Set sensor of Landsat TM4/5 to MSS");
@@ -200,11 +198,9 @@
     inputname = input_prefix->answer;
     outputname = output_prefix->answer;
     sensorname = sensor -> answer ? sensor->answer: "";
-    
-    overwrite = G_check_overwrite(argc, argv);
-    
+
     G_zero(&lsat, sizeof(lsat));
-    
+
     if (adate->answer != NULL) {
 	strncpy(lsat.date, adate->answer, 11);
 	lsat.date[10] = '\0';
@@ -472,21 +468,12 @@
 	    continue;
 	}
 
-	if (G_find_cell2(band_out, "")) {
-	    if (overwrite) {
-		G_warning(_("Raster map <%s> already exists and will be overwritten"), band_out);
-	    }
-	    else {
-		G_warning(_("Raster map <%s> exists. Skipping."), band_out);
-		continue;
-	    }
-	}
 	if ((infd = G_open_cell_old(band_in, mapset)) < 0)
 	    G_fatal_error(_("Unable to open raster map <%s>"), band_in);
 	in_data_type = G_raster_map_type(band_in, mapset);
 	if (G_get_cellhd(band_in, mapset, &cellhd) < 0)
 	    G_fatal_error(_("Unable to read header of raster map <%s>"), band_in);
-	
+
 	/* set same size as original band raster */
 	G_set_window(&cellhd);
 
@@ -553,7 +540,7 @@
 	    G_put_raster_row(outfd, outrast, DCELL_TYPE);
 	}
 	G_percent(1, 1, 1);
-	
+
 	ref_mode = 0.;
 	if (method > DOS && !lsat.band[i].thermal) {
 	    ref_mode = lsat_qcal2rad(dn_mode[i], &lsat.band[i]);
@@ -630,7 +617,7 @@
 	sprintf(history.edhist[history.edlinecnt],
 		"-----------------------------------------------------------------");
 	history.edlinecnt++;
-	
+
 	G_command_history(&history);
 	G_write_history(band_out, &history);
 



More information about the grass-commit mailing list