[GRASS-SVN] r35863 -
grass/branches/releasebranch_6_4/imagery/i.atcorr
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 12 17:32:46 EST 2009
Author: neteler
Date: 2009-02-12 17:32:46 -0500 (Thu, 12 Feb 2009)
New Revision: 35863
Modified:
grass/branches/releasebranch_6_4/imagery/i.atcorr/6s.cpp
grass/branches/releasebranch_6_4/imagery/i.atcorr/description.html
grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp
Log:
cosmetics
Modified: grass/branches/releasebranch_6_4/imagery/i.atcorr/6s.cpp
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.atcorr/6s.cpp 2009-02-12 22:31:16 UTC (rev 35862)
+++ grass/branches/releasebranch_6_4/imagery/i.atcorr/6s.cpp 2009-02-12 22:32:46 UTC (rev 35863)
@@ -48,8 +48,7 @@
ifstream inText;
inText.open(icnd_name);
if(!inText.is_open()) {
- G_warning(_("Unable to open file <%s>"), icnd_name);
- return -1;
+ G_fatal_error(_("Unable to open file <%s>"), icnd_name);
}
/* redirect cin to the input text file */
Modified: grass/branches/releasebranch_6_4/imagery/i.atcorr/description.html
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.atcorr/description.html 2009-02-12 22:31:16 UTC (rev 35862)
+++ grass/branches/releasebranch_6_4/imagery/i.atcorr/description.html 2009-02-12 22:32:46 UTC (rev 35863)
@@ -3,7 +3,7 @@
<b>i.atcorr</b> performs atmospheric correction on the input raster using the
6S algorithm (Second Simulation of Satellite Signal in the Solar Spectrum). A
detailed algorithm description is available at the
-<a href=http://modis-sr.ltdri.org/index.html>Land Surface Reflectance Science
+<a href="http://modis-sr.ltdri.org/index.html">Land Surface Reflectance Science
Computing Facility website</a> and Mauro A. Homem Antunes <a
href="http://www.ltid.inpe.br/dsr/mauro/6s/download_6s.html">website about his
6s version</a>.
@@ -32,7 +32,7 @@
<p>
<div class="code"><pre>
8 - geometrical conditions=Landsat ETM+
-2 19 13.00 -47.410 -20.234 - month day hh.ddd longitude lattitude ("hh.ddd" is a decimal hour GMT)
+2 19 13.00 -47.410 -20.234 - month day hh.ddd longitude latitude ("hh.ddd" is a decimal hour GMT)
1 - atmospheric mode=tropical
1 - aerosols model=continental
15 - visibility [km] (aerosol model concentration)
@@ -41,7 +41,6 @@
64 - 4th band of ETM+ Landsat 7
</pre></div>
-
<h2><font color="red">REMAINING DOCUMENTATION ISSUES</font></h2>
1. Using the target elevation and visibility parameters in the <em>icnd</em>
file overrides <em>ialt</em> and <em>ivis</em> input rasters. It is not clear
@@ -49,10 +48,10 @@
<p>
2. The "example 6s parameters file" explains that "-.600" in line 6 means
"target at 600 m ASL". However, in the section E of "6S CODE PARAMETER CHOICES"
-it reads: "xps <=0. means the target is at the sea level". This is contrary.
+it reads: "xps <=0. means the target is at the sea level". This is contrary.
<p>
-3. In section E, I'm not sure if the "-100< xpp <0" shouldn't actually be
-"-1000< xpp <0". ?
+3. In section E, I'm not sure if the "-100 < xpp < 0" shouldn't actually be
+"-1000 < xpp < 0". ?
<p>
4. It is not explained what is the "iaer" parameter that section D refers to.
<p>
@@ -65,14 +64,13 @@
speeding them up.
<p>
7. "This should not affect the user's current region settings" sounds ambigious.
-
<p>
<H2>6S CODE PARAMETER CHOICES</H2>
<h3>A. Geometrical conditions:</h3>
-<table BORDERWIDTH="AUTO" CELLPADDING="3">
+<table CELLPADDING="3" border="1">
<tr>
<td>Code</td>
@@ -130,39 +128,39 @@
<tr>
<td>6</td>
-
<td><b>hrv</b> (spot)</td>
-
<td>enter month,day,hh.ddd,long.,lat. *</td>
</tr>
<tr>
<td>7</td>
-
<td><b>tm</b> (landsat)</td>
-
<td>enter month,day,hh.ddd,long.,lat. *</td>
</tr>
<tr>
<td>8</td>
-
<td><b>etm+</b> (landsat7)</td>
+<td>enter month,day,hh.ddd,long.,lat. *</td>
+</tr>
+<tr>
+<td>9</td>
+<td><b>liss</b> (IRS 1C)</td>
<td>enter month,day,hh.ddd,long.,lat. *</td>
</tr>
</table>
<blockquote>
-* NOTE: for hrv, tm and etm+ experiments, longitude and lattitude
-are the coordinates of the scene center. Lattitude must be >0 for northern
-hemisphere and <0 for southern. Longitude must be >0 for eastern hemisphere
+* NOTE: for hrv, tm, etm+ and liss experiments, longitude and latitude
+are the coordinates of the scene center. Latitude must be >0 for northern
+hemisphere and <0 for southern. Longitude must be >0 for eastern hemisphere
and <0 for western.
</blockquote>
<br><h3>B. Atmospheric model</h3>
-<table BORDERWIDTH="AUTO" CELLPADDING="3">
+<table CELLPADDING="3" border="1">
<tr>
<td>Code</td>
@@ -234,7 +232,7 @@
<br><h3>C. Aerosols model</h3>
-<table BORDERWIDTH="AUTO" CELLPADDING="3">
+<table CELLPADDING="3" border="1">
<tr>
<td>Code</td>
@@ -347,7 +345,7 @@
<br><h3>E. Target altitude (xps), sensor platform (xpp)</h3>
<blockquote>xps <=0 means the target is at the sea level.
-<br>xps >0 means you know the altitude of the target expressed
+<br>xps >0 means you know the altitude of the target expressed
in km, and you put that value as xps.
<br>
@@ -377,7 +375,7 @@
<p>Define your own spectral conditions:
<p>
-<table BORDERWIDTH="AUTO" CELLPADDING="3">
+<table CELLPADDING="3" border="1">
<tr>
<td>Code</td>
@@ -411,7 +409,7 @@
<p>Pre-defined satellite bands:
<p>
-<table BORDERWIDTH="AUTO" CELLPADDING="3">
+<table CELLPADDING="3" border="1">
<tr><td>Code</td><td>Meaning</td></tr>
@@ -501,6 +499,30 @@
</table>
+<h2>EXAMPLES</h2>
+
+North Carolina sample dataset: Atmospheric correction of LANDSAT-7 channels:
+
+<div class="code"><pre>
+g.region rast=lsat7_2002_40 -p
+r.info lsat7_2002_40
+
+# create control file for channel 1 (blue)
+echo "8 - geometrical conditions=Landsat ETM+
+5 24 14.30 -78.691 35.749 - month day hh.ddd longitude latitude ("hh.ddd" is a decimal hour GMT)
+2 - atmospheric mode=midlatitude summer
+1 - aerosols model=continental
+50 - visibility [km] (aerosol model concentration)
+-.600 - target at 600m above sea level
+-1000 - sensor on board a satellite
+61 - 1th band of ETM+ Landsat 7" > icnd.txt
+
+# run atmospheric correction
+i.atcorr lsat7_2002_40 ialt=elevation icnd=icnd.txt oimg=lsat7_2002_40_atcorr
+</pre></div>
+
+Note that the process is computationally intensive.
+
<H2>AUTHORS</H2>
<p><em>Original version of the program for GRASS 5:</em>
@@ -515,7 +537,7 @@
Second simulation of the satellite signal in the solar spectrum, 6S: An
overview., IEEE Trans. Geosc. and Remote Sens. 35(3):675-686.
-<p><a href="http://modis-sr.ltdri.org/6S_code/6S_code2_thinner_stuff/6S_ltdri_org_manual.html">6s manual</a> at the <a href="http://modis-sr.ltdri.org/6S_code/index.html">6s homepage</a> of the Land Surface Reflectance Science Computing Facility
+<p><a href="http://modis-sr.ltdri.org/6S_code/6S_code2_thinner_stuff/6S_ltdri_org_manual.html">6s manual</a> at the <a href="http://modis-sr.ltdri.org/6S_code/index.html">6s homepage</a> of the Land Surface Reflectance Science Computing Facility (also <a href="www.rsgis.ait.ac.th/~honda/textbooks/advrs/6smanv2.0_P1.pdf">PDF1</a>, <a href="www.rsgis.ait.ac.th/~honda/textbooks/advrs/6smanv2.0_P2.pdf">PDF2</a>, and <a href="www.rsgis.ait.ac.th/~honda/textbooks/advrs/6smanv2.0_P3.pdf">PDF3</a>)
<p>Mauro A. Homem Antunes <a href="http://www.ltid.inpe.br/dsr/mauro/6s/download_6s.html">website about his 6s version</a>
Modified: grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp 2009-02-12 22:31:16 UTC (rev 35862)
+++ grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp 2009-02-12 22:32:46 UTC (rev 35863)
@@ -22,6 +22,13 @@
supplying an elevation map has not been run to completion, because it
takes to long and no sensible data for the test data was at hand.
Testing would be welcomed. :)
+**********
+
+* Code clean-up and port to GRASS 6.3, 15.12.2006:
+ Yann Chemin, ychemin(at)gmail.com
+
+* Addition of IRS-1C LISS, Feb 2009: Markus Neteler
+
***************************************************************************/
#include <cstdlib>
@@ -265,7 +272,7 @@
FCELL* vis = NULL; /* buffer for the visibility values */
FCELL prev_alt = -1.f;
FCELL prev_vis = -1.f;
- int row, col;
+ int row, col, nrows, ncols;
/* do initial computation with global elevation and visibility values */
TransformInput ti;
@@ -279,10 +286,12 @@
if(ivis_fd >= 0) vis = (FCELL*)G_allocate_raster_buf(FCELL_TYPE);
G_verbose_message(_("Percent complete..."));
+ nrows = G_window_rows();
+ ncols = G_window_cols();
- for(row = 0; row < G_window_rows(); row++)
+ for(row = 0; row < nrows; row++)
{
- G_percent(row, G_window_rows(), 1); /* keep the user informed of our progress */
+ G_percent(row, nrows, 1); /* keep the user informed of our progress */
/* read the next row */
if(G_get_raster_row(ifd, buf, row, FCELL_TYPE) < 0)
@@ -302,7 +311,7 @@
row);
/* loop over all the values in the row */
- for(col = 0; col < G_window_cols(); col++)
+ for(col = 0; col < ncols; col++)
{
if(vis && G_is_f_null_value(&vis[col]) ||
alt && G_is_f_null_value(&alt[col]) ||
@@ -372,7 +381,7 @@
}
}
}
-
+ G_debug(3, "Computed r%d, c%d", row, col);
/* transform from iscale.[min,max] to [0,1] */
buf[col] = (buf[col] - iscale.min) / ((float)iscale.max - (float)iscale.min);
buf[col] = transform(ti, imask, buf[col]);
More information about the grass-commit
mailing list