[GRASS-SVN] r32947 - grass-addons/gipe/i.dn2ref.l7

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 20 19:19:33 EDT 2008


Author: ychemin
Date: 2008-08-20 19:19:33 -0400 (Wed, 20 Aug 2008)
New Revision: 32947

Modified:
   grass-addons/gipe/i.dn2ref.l7/dn2rad_landsat7.c
   grass-addons/gipe/i.dn2ref.l7/l7inread.c
   grass-addons/gipe/i.dn2ref.l7/rad2ref_landsat7.c
Log:
Code cleaning + standardization

Modified: grass-addons/gipe/i.dn2ref.l7/dn2rad_landsat7.c
===================================================================
--- grass-addons/gipe/i.dn2ref.l7/dn2rad_landsat7.c	2008-08-20 23:17:41 UTC (rev 32946)
+++ grass-addons/gipe/i.dn2ref.l7/dn2rad_landsat7.c	2008-08-20 23:19:33 UTC (rev 32947)
@@ -2,9 +2,10 @@
 #include<math.h>
 #include<stdlib.h>
 
-// Conversion of DN to Radiance for Landsat 7ETM+
-// http://ltpwww.gsfc.nasa.gov/IAS/handbook/handbook_htmls/chapter11/chapter11.html#section11.3 
-// ychemin at gmail.com - Yann Chemin - LGPL, Copylefted, 2006.
+/*
+ * Conversion of DN to Radiance for Landsat 7ETM+
+ * http://ltpwww.gsfc.nasa.gov/IAS/handbook/handbook_htmls/chapter11/chapter11.html#section11.3 
+ */
 
 double dn2rad_landsat7( double Lmin, double LMax, double QCalMax, double QCalmin, int DN )
 {

Modified: grass-addons/gipe/i.dn2ref.l7/l7inread.c
===================================================================
--- grass-addons/gipe/i.dn2ref.l7/l7inread.c	2008-08-20 23:17:41 UTC (rev 32946)
+++ grass-addons/gipe/i.dn2ref.l7/l7inread.c	2008-08-20 23:19:33 UTC (rev 32947)
@@ -3,7 +3,7 @@
 #include<stdlib.h>
 #include<string.h>
 
-//#define MAXFILES 9
+/*#define MAXFILES 9*/
 
 int l7_in_read(char *met_file, double *lmin,double *lmax,double *qcalmin,double *qcalmax,double *sun_elevation, double *sun_azimuth,int *day, int *month, int *year)
 {
@@ -12,31 +12,23 @@
 	int i=0;
 	char *p;
 
-	
-
 	f=fopen(met_file,"r");
 
 	if (!f)
 	return 1;
 
-	printf("1\n");
 	while (fgets(s,1000,f)!=NULL)
 	{
-		printf("2%s\n",s);
 		ptr = strstr(s, "ACQUISITION_DATE");
 		if (ptr != NULL)
 		{
-			printf("2\t");
 			p = strtok(ptr, " =");
 			p = strtok(NULL, " =-");
 			*year = atoi(p);
-			printf("3\t");
 			p = strtok(NULL, "-");
 			*month = atoi(p);
-			printf("4\t");
 			p = strtok(NULL, "-");
 			*day = atoi(p);
-			printf("5\n");
 		}
 		ptr = strstr(s, "SUN_AZIMUTH");
 		if (ptr != NULL)
@@ -308,19 +300,18 @@
 		}
 	}
 
-//	printf("year = %i\n", year);
-//	printf("month = %i\n", month);
-//	printf("day = %i\n", day);
-
-//	printf("sun azimuth = %f\n", sun_azimuth);
-//	printf("sun elevation = %f\n", sun_elevation);
-
-//	for (i=0;i<MAXFILES;i++){
-//		printf("lmin[%i]=%f\n",i,lmin[i]);
-//		printf("lmax[%i]=%f\n",i,lmax[i]);
-//		printf("qcalmin[%i]=%f\n",i,qcalmin[i]);
-//		printf("qcalmax[%i]=%f\n",i,qcalmax[i]);
-//	}
+/*	printf("year = %i\n", year);
+	printf("month = %i\n", month);
+	printf("day = %i\n", day);
+	printf("sun azimuth = %f\n", sun_azimuth);
+	printf("sun elevation = %f\n", sun_elevation);
+	for (i=0;i<MAXFILES;i++){
+		printf("lmin[%i]=%f\n",i,lmin[i]);
+		printf("lmax[%i]=%f\n",i,lmax[i]);
+		printf("qcalmin[%i]=%f\n",i,qcalmin[i]);
+		printf("qcalmax[%i]=%f\n",i,qcalmax[i]);
+	}
+*/
 	(void)fclose(f);
 	return;
 }

Modified: grass-addons/gipe/i.dn2ref.l7/rad2ref_landsat7.c
===================================================================
--- grass-addons/gipe/i.dn2ref.l7/rad2ref_landsat7.c	2008-08-20 23:17:41 UTC (rev 32946)
+++ grass-addons/gipe/i.dn2ref.l7/rad2ref_landsat7.c	2008-08-20 23:19:33 UTC (rev 32947)
@@ -4,8 +4,7 @@
 
 #define PI 3.1415926
 
-// Conversion of Radiance to Reflectance for Landsat 7ETM+ 
-// ychemin at gmail.com - Yann Chemin - LGPL, Copylefted, 2006.
+/* Conversion of Radiance to Reflectance for Landsat 7ETM+ */
 
 double rad2ref_landsat7( double radiance, double doy,double sun_elevation, double k_exo )
 {



More information about the grass-commit mailing list