[GRASS-SVN] r53588 - grass-addons/grass6/imagery/i.landsat.toar

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 28 03:11:40 PDT 2012


Author: neteler
Date: 2012-10-28 03:11:39 -0700 (Sun, 28 Oct 2012)
New Revision: 53588

Modified:
   grass-addons/grass6/imagery/i.landsat.toar/earth_sun.c
   grass-addons/grass6/imagery/i.landsat.toar/landsat.h
   grass-addons/grass6/imagery/i.landsat.toar/landsat_met.c
   grass-addons/grass6/imagery/i.landsat.toar/main.c
Log:
typo fixes; C style comments; G_strcasecmp()

Modified: grass-addons/grass6/imagery/i.landsat.toar/earth_sun.c
===================================================================
--- grass-addons/grass6/imagery/i.landsat.toar/earth_sun.c	2012-10-28 09:52:17 UTC (rev 53587)
+++ grass-addons/grass6/imagery/i.landsat.toar/earth_sun.c	2012-10-28 10:11:39 UTC (rev 53588)
@@ -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *
  *  Some functions in this file use the VSOP87 solution by
  *  Messrs. Bretagnon and Francou.

Modified: grass-addons/grass6/imagery/i.landsat.toar/landsat.h
===================================================================
--- grass-addons/grass6/imagery/i.landsat.toar/landsat.h	2012-10-28 09:52:17 UTC (rev 53587)
+++ grass-addons/grass6/imagery/i.landsat.toar/landsat.h	2012-10-28 10:11:39 UTC (rev 53588)
@@ -7,7 +7,7 @@
 #define DOS      		10
 #define DOS1			12
 #define DOS2			14
-#define DOS2b		15
+#define DOS2b			15
 #define DOS3			16
 #define DOS4			18
 

Modified: grass-addons/grass6/imagery/i.landsat.toar/landsat_met.c
===================================================================
--- grass-addons/grass6/imagery/i.landsat.toar/landsat_met.c	2012-10-28 09:52:17 UTC (rev 53587)
+++ grass-addons/grass6/imagery/i.landsat.toar/landsat_met.c	2012-10-28 10:11:39 UTC (rev 53588)
@@ -96,7 +96,7 @@
         lsat->sun_elev = atof(value);
     }
 
-    // Fill data with the sensor_XXX functions
+    /* Fill data with the sensor_XXX functions */
     switch(lsat->number)
     {
         case 1:
@@ -184,7 +184,7 @@
     get_mtldata(mtldata, "SUN_ELEVATION", value);
     lsat->sun_elev = atof(value);
 
-    // Fill data with the sensor_XXX functions
+    /* Fill data with the sensor_XXX functions */
     switch(lsat->number)
     {
         case 1:
@@ -226,7 +226,7 @@
             break;
     }
 
-    // Update the information from metadata file
+    /* Update the information from metadata file */
     for (i = 0; i < lsat->bands; i++) {
         snprintf(name, MAX_STR, "LMAX_BAND%d", lsat->band[i].code);
         get_mtldata(mtldata, name, value);
@@ -247,5 +247,3 @@
     return;
 }
 
-
-

Modified: grass-addons/grass6/imagery/i.landsat.toar/main.c
===================================================================
--- grass-addons/grass6/imagery/i.landsat.toar/main.c	2012-10-28 09:52:17 UTC (rev 53587)
+++ grass-addons/grass6/imagery/i.landsat.toar/main.c	2012-10-28 10:11:39 UTC (rev 53588)
@@ -10,7 +10,7 @@
  * PURPOSE:      Calculate TOA Radiance or Reflectance and Kinetic Temperature
  *               for Landsat 1/2/3/4/5 MS, 4/5 TM or 7 ETM+
  *
- * COPYRIGHT:    (C) 2012 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2006-2012 by the GRASS Development Team
  *
  *               This program is free software under the GNU General
  *               Public License (>=v2). Read the file COPYING that
@@ -85,16 +85,6 @@
     metfn->description = _("Name of Landsat metadata file (.met or MTL.txt)");
     metfn->guisection = _("Metadata");
 
-    metho = G_define_option();
-    metho->key = "method";
-    metho->type = TYPE_STRING;
-    metho->required = NO;
-    metho->options = "uncorrected,corrected,dos1,dos2,dos2b,dos3,dos4";
-    metho->label = _("Atmospheric correction method");
-    metho->description = _("Atmospheric correction method");
-    metho->answer = "uncorrected";
-    metho->guisection = _("Metadata");
-
     sensor = G_define_option();
     sensor->key = "sensor";
     sensor->type = TYPE_STRING;
@@ -104,15 +94,25 @@
     sensor->descriptions =
 	_("mss1;Landsat-1 MSS;"
 	  "mss2;Landsat-2 MSS;"
-      "mss3;Landsat-3 MSS;"
-      "mss4;Landsat-4 MSS;"
-      "mss5;Landsat-5 MSS;"
-      "tm4;Landsat-4 TM;"
-      "tm5;Landsat-5 TM;"
+	  "mss3;Landsat-3 MSS;"
+	  "mss4;Landsat-4 MSS;"
+	  "mss5;Landsat-5 MSS;"
+	  "tm4;Landsat-4 TM;"
+	  "tm5;Landsat-5 TM;"
 	  "tm7;Landsat-7 ETM+");
     sensor->required = NO;
     sensor->guisection = _("Metadata");
 
+    metho = G_define_option();
+    metho->key = "method";
+    metho->type = TYPE_STRING;
+    metho->required = NO;
+    metho->options = "uncorrected,corrected,dos1,dos2,dos2b,dos3,dos4";
+    metho->label = _("Atmospheric correction method");
+    metho->description = _("Atmospheric correction method");
+    metho->answer = "uncorrected";
+    metho->guisection = _("Metadata");
+
     adate = G_define_option();
     adate->key = "date";
     adate->type = TYPE_STRING;
@@ -172,7 +172,6 @@
     atmo->answer = "0.0";
     atmo->guisection = _("Settings");
 
-
     /* define the different flags */
     frad = G_define_flag();
     frad->key = 'r';
@@ -290,17 +289,17 @@
 	/*****************************************
 	* ------------ PREPARATION --------------
 	*****************************************/
-    if (strcasecmp(metho->answer, "corrected") == 0)
+    if (G_strcasecmp(metho->answer, "corrected") == 0)
 	method = CORRECTED;
-    else if (strcasecmp(metho->answer, "dos1") == 0)
+    else if (G_strcasecmp(metho->answer, "dos1") == 0)
 	method = DOS1;
-    else if (strcasecmp(metho->answer, "dos2") == 0)
+    else if (G_strcasecmp(metho->answer, "dos2") == 0)
 	method = DOS2;
-    else if (strcasecmp(metho->answer, "dos2b") == 0)
+    else if (G_strcasecmp(metho->answer, "dos2b") == 0)
 	method = DOS2b;
-    else if (strcasecmp(metho->answer, "dos3") == 0)
+    else if (G_strcasecmp(metho->answer, "dos3") == 0)
 	method = DOS3;
-    else if (strcasecmp(metho->answer, "dos4") == 0)
+    else if (G_strcasecmp(metho->answer, "dos4") == 0)
 	method = DOS4;
     else
 	method = UNCORRECTED;
@@ -396,7 +395,7 @@
 	G_fatal_error(_("Unknown production date (defined by '%s')"), pdate->key);
 
     if (G_verbose() > G_verbose_std()) {
-	fprintf(stderr, " LANSAT: %d SENSOR: %s\n", lsat.number, lsat.sensor);
+	fprintf(stderr, " LANDSAT: %d SENSOR: %s\n", lsat.number, lsat.sensor);
 	fprintf(stderr, " ACQUISITION DATE %s [production date %s]\n",
 		lsat.date, lsat.creation);
 	fprintf(stderr, "   earth-sun distance    = %.8lf\n", lsat.dist_es);



More information about the grass-commit mailing list