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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 8 12:55:13 PDT 2012


Author: neteler
Date: 2012-10-08 12:55:12 -0700 (Mon, 08 Oct 2012)
New Revision: 53337

Modified:
   grass-addons/grass6/imagery/i.landsat.toar/landsat_met.c
   grass-addons/grass6/imagery/i.landsat.toar/main.c
Log:
fix comment style; reorder method parameter; strcasecmp() -> G_strcasecmp()

Modified: grass-addons/grass6/imagery/i.landsat.toar/landsat_met.c
===================================================================
--- grass-addons/grass6/imagery/i.landsat.toar/landsat_met.c	2012-10-08 13:46:43 UTC (rev 53336)
+++ grass-addons/grass6/imagery/i.landsat.toar/landsat_met.c	2012-10-08 19:55:12 UTC (rev 53337)
@@ -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-08 13:46:43 UTC (rev 53336)
+++ grass-addons/grass6/imagery/i.landsat.toar/main.c	2012-10-08 19:55:12 UTC (rev 53337)
@@ -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) 2002-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;
@@ -113,6 +103,16 @@
     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';
@@ -282,17 +281,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;



More information about the grass-commit mailing list