[GRASS-dev] i.atcorr returns nan for Landsat 5 TM bands 1 and 2

Dear Grass Developers

I have been having a problem using module i.atcorr to process Landsat 5 TM bands 1 and 2. The resulting rasters are empty for these two bands. For other bands the result seems to be correct. There are many posts talking about this topic, but I did not find an answer. So I tried using Grass 6.4 and Grass 7.0. Unfortunately the same error occurred. Next I tried changing some parameters of the input file. What I found is that changing the time of acquisition of the image the algorithm was able to perform the calculations and return acceptable results. Bellow I show the content of input file A, with which the module did not work, and input file B, with which the module worked. Notice that the only difference is an increase of one hour in the time of acquisition of the image. By the way, it also worked if I decreased the acquisition time by one hour. The same occurred to other images from other dates. From this result I infer that the problem may rely on the calculations of sun position.

I also tried contacting Mauro Antunes, the author of the original code in Fortran. He was my teacher, so I have a close relation with him. I asked him if he was interested in taking a look at the C++ code implemented in GRASS, but he is not willing to do it. He has been working on the Fortran code during the last years and provided me with a copy. Using his Fortran code and the same input file that I used for i.atcorr gave the expected results.

I hope this is of any help for fixing this old issue in the i.atcorr module. Unfortunately I know neither C++ nor Fortran to help finding the error.

The content of input file A is:


7 # geometrical conditions = Landsat 5 TM
12 26 16.34 -54.125 -28.87 # month day hh.ddd long lat (hh.ddd is in decimal hours GMT)
1 # atmospheric mode = Tropical
1 # aerosols model = Continental Model
20 # visibility [km] (aerosol model concentration)
-0.3 # mean target elevation above sea level [km]
-1000 # sensor on board a satellite
25 # band 1 (0.430-0.560)

The content of input file B is:


7 # geometrical conditions = Landsat 5 TM
12 26 17.34 -54.125 -28.87 # month day hh.ddd long lat (hh.ddd is in decimal hours GMT)
1 # atmospheric mode = Tropical
1 # aerosols model = Continental Model
20 # visibility [km] (aerosol model concentration)
-0.3 # mean target elevation above sea level [km]
-1000 # sensor on board a satellite
25 # band 1 (0.430-0.560)

Kind regards,

| –

Alessandro Samuel-Rosa

PhD Candidate Graduate School in Agronomy - Soil Science
Federal Rural University of Rio de Janeiro
Seropédica, Rio de Janeiro, Brazil

Guest Researcher ISRIC - World Soil Information
Wageningen, the Netherlands alessandro.rosa@wur.nl | Phone 0031 06 4435 9563

Homepage: soil-scientist.net Skype: alessandrosamuel


|
| - |

On Thu, Feb 27, 2014 at 8:40 PM, Alessandro Samuel Rosa
<alessandrosamuel@yahoo.com.br> wrote:
...

I also tried contacting Mauro Antunes, the author of the original code in Fortran. He was my teacher, so I have a close relation with him. I asked him if he was interested in taking a look at the C++ code implemented in GRASS, but he is not willing to do it. He has been working on the Fortran code during the last years and provided me with a copy. Using his Fortran code and the same input file that I used for i.atcorr gave the expected results.

Would the Fortran code author make his latest version available? Then
we might be able to compare the implementations.

Markus

Dear Grass developers,

In a previous message I mentioned that the i.atcorr module returns nan values for Landsat 5 TM bands 1 and 2. Today I was processing some RapidEye images and found out that i.atcorr fails to process bands 4 and 5. Notice that when I processed this bands as if they were band 1, i.atcorr returned the expected result. This means that there is nothing wrong with the image files.

I hope that the Fortran source code that I shared with you has the answers to solve this issue.

Regards,

Alessandro

On wo, 2014-03-05 at 11:32 +0100, Markus Neteler wrote:

On Thu, Feb 27, 2014 at 8:40 PM, Alessandro Samuel Rosa
<[alessandrosamuel@yahoo.com.br](mailto:alessandrosamuel@yahoo.com.br)> wrote:
...
> I also tried contacting Mauro Antunes, the author of the original code in Fortran. He was my teacher, so I have a close relation with him. I asked him if he was interested in taking a look at the C++ code implemented in GRASS, but he is not willing to do it. He has been working on the Fortran code during the last years and provided me with a copy. Using his Fortran code and the same input file that I used for i.atcorr gave the expected results.

Would the Fortran code author make his latest version available? Then
we might be able to compare the implementations.

Markus