Prechádzať zdrojové kódy

ejtizado: i.landsat.toar: backport https://trac.osgeo.org/grass/changeset/52320 from add-ons

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52323 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 rokov pred
rodič
commit
56f74fe5f2

+ 2 - 2
imagery/i.landsat.toar/i.landsat.toar.html

@@ -192,8 +192,8 @@ i.landsat.toar input_prefix=L5121060_06020060714. \
   <li>Moran M.S., R.D. Jackson, P.N. Slater and P.M. Teillet, 1992: Remote
     Sensing of Environment, vol. 41.</li>
   
-  <li>Song et al : Classification and Change Detection Using Landsat TM
-    Data, 2001: When and How to Correct Atmospheric Effects? Remote Sensing
+  <li>Song et al, 2001: Classification and Change Detection Using Landsat TM
+    Data, When and How to Correct Atmospheric Effects? Remote Sensing
     of Environment, vol. 75.</li>
 </ul>
 

+ 2 - 3
imagery/i.landsat.toar/landsat.c

@@ -49,8 +49,7 @@ double lsat_rad2temp(double rad, band_data * band)
 #define abs(x)	(((x)>0)?(x):(-x))
 
 void lsat_bandctes(lsat_data * lsat, int i, char method,
-		   double percent, int dos, double sat_zenith,
-		   double rayleigh)
+		   double percent, int dos, double rayleigh)
 {
     double pi_d2, sin_e, cos_v, rad_sun;
 
@@ -61,7 +60,7 @@ void lsat_bandctes(lsat_data * lsat, int i, char method,
 
     pi_d2 = (double)(PI * lsat->dist_es * lsat->dist_es);
     sin_e = (double)(sin(D2R * lsat->sun_elev));
-    cos_v = (double)(cos(D2R * sat_zenith));
+    cos_v = (double)(cos(D2R * (lsat->number < 4 ? 9.2 : 8.2)));
 
 	/** Global irradiance on the sensor.
 		Radiance to reflectance coefficient, only NO thermal bands.

+ 1 - 1
imagery/i.landsat.toar/landsat.h

@@ -61,6 +61,6 @@ double lsat_qcal2rad(double, band_data *);
 double lsat_rad2ref(double, band_data *);
 double lsat_rad2temp(double, band_data *);
 
-void lsat_bandctes(lsat_data *, int, char, double, int, double, double);
+void lsat_bandctes(lsat_data *, int, char, double, int, double);
 
 #endif

+ 4 - 14
imagery/i.landsat.toar/main.c

@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
     RASTER_MAP_TYPE in_data_type;
     
     struct Option *input_prefix, *output_prefix, *metfn, *sensor, *adate, *pdate, *elev,
-	*bgain, *metho, *perc, *dark, *satz, *atmo;
+	*bgain, *metho, *perc, *dark, *atmo;
     char *inputname, *met, *outputname, *sensorname;
     struct Flag *msss, *frad, *l5_mtl;
     
@@ -50,8 +50,8 @@ int main(int argc, char *argv[])
     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, sat_zenith, rayleigh;
-    
+    double qcal, rad, ref, percent, ref_mode, rayleigh;
+
     struct Colors colors;
     struct FPRange range;
     double min, max;
@@ -168,14 +168,6 @@ int main(int argc, char *argv[])
     dark->answer = "1000";
     dark->guisection = _("Settings");
 
-    satz = G_define_option();
-    satz->key = "sat_zenith";
-    satz->type = TYPE_DOUBLE;
-    satz->required = NO;
-    satz->description = _("Satellite zenith in degrees");
-    satz->answer = "8.2000";
-    satz->guisection = _("Settings");
-
     atmo = G_define_option();
     atmo->key = "rayleigh";
     atmo->type = TYPE_DOUBLE;
@@ -240,7 +232,6 @@ int main(int argc, char *argv[])
     lsat.sun_elev = elev->answer == NULL ? 0. : atof(elev->answer);
     percent = atof(perc->answer);
     pixel = atoi(dark->answer);
-    sat_zenith = atof(satz->answer);
     rayleigh = atof(atmo->answer);
 
     /* Data from MET file: only Landsat-7 ETM+ and Landsat-5 TM  */
@@ -406,8 +397,7 @@ int main(int argc, char *argv[])
 	    Rast_close(infd);
 	}
 	/* Calculate transformation constants */
-	lsat_bandctes(&lsat, i, method, percent, dn_dark[i], sat_zenith,
-		      rayleigh);
+	lsat_bandctes(&lsat, i, method, percent, dn_dark[i], rayleigh);
     }
 
     if (strlen(lsat.creation) == 0)