[GRASS-user] i.atcorr returns all NULL values

Hello,
I’m using i.atcorr to perform atmospheric corrections on Landsat 5 TM data and something peculiar seems to happen arbitrarily to some of the data. For the most part everything works fine, but for some of the bands the result is a raster layer that is filled with nothing but NULL values. For example, I have images from 3 dates over the same area. All the layers are integer and scaled from 0 - 255, and the elevation layer I’m using is also integer. All bands from the first date and the last date run through i.atcorr with no problems, as do bands 3, 4, 5, & 7 from the middle date. However, bands 1 and 2 from the middle date return all NULLs. I have tried many things, including running i.atcorr on a small subset of the band (same result), changing the date by a day or two in the icnd.txt file (same result), and changing the band to TM5 band 3 in the icnd.txt file (this ran normally). I can’t figure out why bands 1 and 2 would run normally on two of my dates and why bands 3-5,7 would run on this particular date yet bands 1 and 2 result in the NULL values. Anyone else have this problem and any clues as to why i.atcorr is doing this? Any help would be greatly appreciated.

Here is the text of my icnd.txt file for band 1:
7
6 23 15.966 -84.165 44.587
2
1
14.16
-0.262
-1000
25

The command I’m running:
i.atcorr -r -o iimg=peak_B1_toa@mich ialt=elevation@mich icnd=atcorr_paramfiles/atcorr_peak_B1.txt oimg=peak_B1_atm_corr

I’m using GRASS version 6.4.0RC6

Thanks,
Brian

I am getting the same error when working with AVNIR data. Bands 1 and 4 go
through great--however when the sensor condition codes are used for bands 2
and 3 (82 and 83 respectively) the outuput is full of NULL values.
I ran a similar test as Brian-- used the sensor condition codes from bands 1
and 4, and the output in those cases were fine.

I'm using Grass 6.5 on Ubuntu 10.4 64bit

Example code:
##THIS WORKS##
i.atcorr -o iimg=ALAV2A068212970-O1B2G_U_04rectified@PERMANENT iscl=0,255
ialt=dem_patch@PERMANENT
icnd=/home/hannibal/Projects/LandM/spring_iatcor_4.txt
oimg=ALAV2A068212970-O1B2G_U_04rectified_at oscl=0,255 --overwrite

WHERE the icnd file =
11
05 06 16.900 -89.967 31.318
2
1
9.65
-0.100
-1000
84

FROM r.info on result: Range of data: min = 0 max = 255

##THIS DOESN'T WORK##
i.atcorr -o iimg=ALAV2A068212970-O1B2G_U_02rectified@PERMANENT iscl=0,255
ialt=dem_patch@PERMANENT
icnd=/home/hannibal/Projects/LandM/spring_iatcor_2.txt
oimg=ALAV2A068212970-O1B2G_U_02rectified_at oscl=0,255 --overwrite --verbose

WHERE the icnd file =
11
05 06 16.900 -89.967 31.318
2
1
9.65
-0.100
-1000
82

FROM r.info on result: Range of data: min = NULL max = NULL

Any ideas on this would be very much appreciated...I just can't figure out
where the issue is.

Thanks,

Zack

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/i-atcorr-returns-all-NULL-values-tp4975543p5422319.html
Sent from the Grass - Users mailing list archive at Nabble.com.

I have the same problem. The i.atcorr does not seam to work with the setting
for Landsat TM channels 1 and 2...it returns no data rasters, no matter
which input file.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/i-atcorr-returns-all-NULL-values-tp4975543p5725337.html
Sent from the Grass - Users mailing list archive at Nabble.com.

I have the same problem, both with band 1 and 2.
I did i.landsat.toar and then i.atcorr but all the bands worked except for
band 1 and 2, these have values min=-nan and max=-nan.
There is someone who can help us?

Thank you!
Elena

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/i-atcorr-returns-all-NULL-values-tp4975543p6360527.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Can you please share your scripts (both i.landsat.toar and i.atcorr)
please.
Also can you share the .met or _MTL.txt that came with your failing
Landsat image.
Finally, the r.info output for one of the band that is failing in
i.atcorr.

Thank you,
Yann

-----Original Message-----
From: grass-user-bounces@lists.osgeo.org
[mailto:grass-user-bounces@lists.osgeo.org] On Behalf Of Elena Mezzini
Sent: Saturday, May 14, 2011 12:14 AM
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] Re: i.atcorr returns all NULL values

I have the same problem, both with band 1 and 2.
I did i.landsat.toar and then i.atcorr but all the bands worked except
for band 1 and 2, these have values min=-nan and max=-nan.
There is someone who can help us?

Thank you!
Elena

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/i-atcorr-returns-all-NULL-values-
tp4975543p6360527.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Can you please share your scripts (both i.landsat.toar and i.atcorr)
please.
Also can you share the .met or _MTL.txt that came with your failing
Landsat image.
Finally, the r.info output for one of the band that is failing in
i.atcorr.

Thank you,
Yann

Here they are:
I used i.atcorr.fast that now is the implemented i.atcorr in GRASS 6.5.xx
(Markus gave it to me).

http://osgeo-org.1803224.n2.nabble.com/file/n6369333/i.atcorr.fast
i.atcorr.fast
http://osgeo-org.1803224.n2.nabble.com/file/n6369333/i.landsat.toar
i.landsat.toar
http://osgeo-org.1803224.n2.nabble.com/file/n6369333/L5192030_03020090723_MTL.txt
L5192030_03020090723_MTL.txt
http://osgeo-org.1803224.n2.nabble.com/file/n6369333/rinfoerrb1.txt
rinfoerrb1.txt

Now I will try with the GRASS 6.5.xx version. It seems that with that one it
works!

Thank you!
Elena

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/i-atcorr-returns-all-NULL-values-tp4975543p6369333.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Mon, May 16, 2011 at 6:26 PM, Elena Mezzini <elena.mezzini@gmail.com> wrote:
...

Here they are:
I used i.atcorr.fast that now is the implemented i.atcorr in GRASS 6.5.xx
(Markus gave it to me).

WARNING: please don't be confused, i.atcorr.fast is an slightly
older copy which I privately made for Elena. It is the binary version of
i.atcorr in GRASS 6.5 from 1-2 weeks ago.

http://osgeo-org.1803224.n2.nabble.com/file/n6369333/i.atcorr.fast

... please don't download it but use the GRASS 6.5.svn version, otherwise
we'll end up in total confusion.

Markus

Can you please share your scripts (both i.landsat.toar and i.atcorr)
please.
Also can you share the .met or _MTL.txt that came with your failing
Landsat image.
Finally, the r.info output for one of the band that is failing in
i.atcorr.

Thank you,
Yann

Here they are:
I used i.atcorr.fast that now is the implemented i.atcorr in GRASS 6.5.xx
(Markus gave it to me).

http://osgeo-org.1803224.n2.nabble.com/file/n6369333/i.atcorr.fast
i.atcorr.fast
http://osgeo-org.1803224.n2.nabble.com/file/n6369333/i.landsat.toar
i.landsat.toar
http://osgeo-org.1803224.n2.nabble.com/file/n6369333/L5192030_03020090723_MTL.txt
L5192030_03020090723_MTL.txt
http://osgeo-org.1803224.n2.nabble.com/file/n6369333/rinfoerrb1.txt
rinfoerrb1.txt
Chemin, Yann (IWMI) wrote:

Now I will try with the GRASS 6.5.xx version. It seems that with that one
it works!

Thank you!
Elena

I tried also with GRASS6.5.svn but Landsat TM5 band 1 and 2 didn't work too.
I'm sorry.

Elena

-----
Elena Mezzini
Bologna University - Faculty of Agriculture
DCA- Department of Fruit Tree and Woody Plant Sciences
Viale Fanin, 46
40127 Bologna Italy
Phone: +39 051 2096458
Fax: +39 051 2096401
Mobile: +39 333 6637890 Skype: elena.mezzini
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/i-atcorr-returns-all-NULL-values-tp4975543p6370499.html
Sent from the Grass - Users mailing list archive at Nabble.com.

p192 r030 image of July 2003 of Italy (L5TM) successfully corrected for
band 1 and 2.
The following script works well in GRASS GIS Trunk SVN.
Please try.

#!/bin/bash

echo "Part 0 (Import in GRASS GIS)"
echo "RUN from the MTL.txt directory and within the GRASS environment"
echo "-----------------------------------"
echo "It will create for *.[1-7] images from r.in.gdal"
echo "image=DN"

# DEM file name
dem=dem
r.mapcalc expression=dem=5.0
# r.in.gdal input=$dem output=$dem

for file in L5*.TIF
do
       out=$(echo $file | sed
's/\(.*\)_\(.*\)_B\(.*\)0.TIF/\1\_\2\.\3/g')
       echo $out
       r.in.gdal --overwrite input=$file output=$out
done

echo "Part 1 (After DN)"
echo "-----------------------------------"
echo "It will create for *.toar.* images from i.landsat.toar"
echo "image=top of atmosphere reflectance"

for L5_MTL_file in L5*_MTL.txt
do
       L5_prefix=$(echo $L5_MTL_file | sed 's/\(.*\)_MTL.txt/\1/')
       i.landsat.toar -t input_prefix=$L5_prefix\.
output_prefix=$L5_prefix\.toar. metfile=$L5_MTL_file sensor=tm5
done

echo "Part 2 (After TOAR)"
echo "-----------------------------------"
echo "It will create for *.surf.* images from i.atcorr"
echo "Atmospherically corrected image=surface reflectance"
#-----------------------------------------------------
# For i.atcorr scripting
#-----------------------------------------------------
vis_list=(10 10 8 9.7 15 8 7 10 10 9.7 12 9.7 7 12 12 12 3 15 12 9.7 6
15)
vis_len=${#vis_list[*]}
echo $vis_len
i=0

# Location of parameter file
root=~/
# Basic script for i.atcorr for L 5 TM
#Geometrical conditions (L5TM)
geom=7
#Sensor height (satellite is -1000)
sens_height=-1000
#Atmospheric mode
atm_mode=6 #us standard 62 (for lack of more precise model)
#Aerosol model
aerosol_mode=1 #continental
#satellite band number (L5TM [25,26,27,28,29,30])
satbandno=25 #Band 1 of L5TM is first to undergo atmospheric correction

for file in $(g.mlist type=rast pattern=*.toar.1)
do
#Here we suppose you have altitude (DEM) and Visibility (VIS) maps
ready

#-----------------------------------------------------------------------
r.mapcalc expression="visibility=${vis_list[$i]}" --overwrite
# Dummy visibility value for atcorr param file
vis=12
#Increment i
i=$(echo "$i + 1" | bc)
#Altitude dummy value (in Km should be negative in this param file)
#(overwritten by DEM raster input)
alt=-1.200
# L5 basename as stored in GRASS GIS and used by i.landsat.toar
L5basename=$(echo $file | sed 's/\(.*\)\.\(.*\)\.\(.*\)/\1/')
echo $L5basename

#---------------------------
# Please change as you need
#---------------------------

#datetime of satellite overpass (month, day, GMT decimal hour)
echo "Input: GMT (i.e. 6.30)"
read gmt
#mdh="6 03 6.30"
monthday=$(echo $L5basename | sed 's/\(.*\)_.......\(.*\)/\2/')
day=$(echo $L5basename | sed 's/\(.*\)_.........\(.*\)/\2/')
month=$(echo "($monthday - $day) / 100" | bc)
mdh="$month $day $gmt"
echo $mdh

# Central Lat/Long
north=$(g.region -p | grep north | sed 's/north:\ \(.*\)/\1/' | bc)
south=$(g.region -p | grep south | sed 's/south:\ \(.*\)/\1/' | bc)
east=$(g.region -p | grep east | sed 's/east:\ \(.*\)/\1/' | bc)
west=$(g.region -p | grep west | sed 's/west:\ \(.*\)/\1/' | bc)
Lat_nonproj=$(echo "(($north - $south)/2.0) + $south" | bc )
Long_nonproj=$(echo "(($east - $west)/2.0) + $west" | bc )
echo "$Long_nonproj $Lat_nonproj" > tempfile.txt
Long=$(m.proj -o -d input=tempfile.txt | sed
's/\(.*\)|\(.*\)|\(.*\)/\1/')
Lat=$(m.proj -o -d input=tempfile.txt | sed
's/\(.*\)|\(.*\)|\(.*\)/\2/')
echo $Long_nonproj $Lat_nonproj
echo $Long $Lat

for bandno in 1 2 3 4 5 7
do # Generate the parameterization file
echo "$geom - geometrical
conditions=Landsat 5 TM" > $root/param_L5.txt
echo "$mdh $Long $Lat - month day hh.ddd longitude latitude
(\"hh.ddd\" is in decimal hours GMT)" >> $root/param_L5.txt
echo "$atm_mode - atmospheric
mode=tropical" >> $root/param_L5.txt
echo "$aerosol_mode - aerosols
model=continental" >> $root/param_L5.txt
echo "$vis - visibility [km] (aerosol
model concentration), not used as there is raster input" >>
$root/param_L5.txt
echo "$alt - mean target elevation above sea
level [km] (here 600m asl), not used as there is raster input" >>
$root/param_L5.txt
echo "$sens_height - sensor height (here,
sensor on board a satellite)" >> $root/param_L5.txt
echo "$satbandno - 'i'th band of TM
Landsat 5" >> $root/param_L5.txt
# Process band-wise atmospheric correction with 6s
cat $root/param_L5.txt
echo "i.atcorr -r input=$L5basename.toar.$bandno elevation=$dem
visibility=visibility parameters=$root/param_L5.txt
output=$L5basename.surf.$bandno range=0,1 rescale=0,1 --overwrite"
i.atcorr -r input=$L5basename.toar.$bandno elevation=$dem
visibility=visibility parameters=$root/param_L5.txt
output=$L5basename.surf.$bandno range=0,1 rescale=0,1 --overwrite
satbandno=$((satbandno+1))
if [ $satbandno -gt 30 ]
  then satbandno=25
fi
done
done

-----Original Message-----
From: grass-user-bounces@lists.osgeo.org
[mailto:grass-user-bounces@lists.osgeo.org] On Behalf Of Elena Mezzini
Sent: Saturday, May 14, 2011 12:14 AM
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] Re: i.atcorr returns all NULL values

I have the same problem, both with band 1 and 2.
I did i.landsat.toar and then i.atcorr but all the bands worked except
for band 1 and 2, these have values min=-nan and max=-nan.
There is someone who can help us?

Thank you!
Elena

Hi Yann,

On Mon, May 23, 2011 at 5:07 AM, Chemin, Yann (IWMI) <Y.Chemin@cgiar.org> wrote:

p192 r030 image of July 2003 of Italy (L5TM) successfully corrected for
band 1 and 2.
The following script works well in GRASS GIS Trunk SVN.

(better send as attachment since a series of line breaks got broken)

...

# For i.atcorr scripting
#-----------------------------------------------------
vis_list=(10 10 8 9.7 15 8 7 10 10 9.7 12 9.7 7 12 12 12 3 15 12 9.7 6 15)
vis_len=${#vis_list[*]}
echo $vis_len

... this is not clear to me: why so many values and where
do they originate from? Since we have only 6 channels to
work with...

Markus

Resending as attachment...

-----Original Message-----
From: grass-user-bounces@lists.osgeo.org
[mailto:grass-user-bounces@lists.osgeo.org] On Behalf Of Chemin, Yann
(IWMI)
Sent: Monday, May 23, 2011 8:37 AM
To: grass-user@lists.osgeo.org
Cc: Elena Mezzini
Subject: RE: [GRASS-user] Re: i.atcorr returns all NULL values

p192 r030 image of July 2003 of Italy (L5TM) successfully corrected for
band 1 and 2.
The following script works well in GRASS GIS Trunk SVN.
Please try.

#!/bin/bash

echo "Part 0 (Import in GRASS GIS)"
echo "RUN from the MTL.txt directory and within the GRASS environment"
echo "-----------------------------------"
echo "It will create for *.[1-7] images from r.in.gdal"
echo "image=DN"

# DEM file name
dem=dem
r.mapcalc expression=dem=5.0
# r.in.gdal input=$dem output=$dem

for file in L5*.TIF
do
       out=$(echo $file | sed
's/\(.*\)_\(.*\)_B\(.*\)0.TIF/\1\_\2\.\3/g')
       echo $out
       r.in.gdal --overwrite input=$file output=$out done

echo "Part 1 (After DN)"
echo "-----------------------------------"
echo "It will create for *.toar.* images from i.landsat.toar"
echo "image=top of atmosphere reflectance"

for L5_MTL_file in L5*_MTL.txt
do
       L5_prefix=$(echo $L5_MTL_file | sed 's/\(.*\)_MTL.txt/\1/')
       i.landsat.toar -t input_prefix=$L5_prefix\.
output_prefix=$L5_prefix\.toar. metfile=$L5_MTL_file sensor=tm5 done

echo "Part 2 (After TOAR)"
echo "-----------------------------------"
echo "It will create for *.surf.* images from i.atcorr"
echo "Atmospherically corrected image=surface reflectance"
#-----------------------------------------------------
# For i.atcorr scripting
#-----------------------------------------------------
vis_list=(10 10 8 9.7 15 8 7 10 10 9.7 12 9.7 7 12 12 12 3 15 12 9.7 6
15)
vis_len=${#vis_list[*]}
echo $vis_len
i=0

# Location of parameter file
root=~/
# Basic script for i.atcorr for L 5 TM
#Geometrical conditions (L5TM)
geom=7
#Sensor height (satellite is -1000)
sens_height=-1000
#Atmospheric mode
atm_mode=6 #us standard 62 (for lack of more precise model) #Aerosol
model
aerosol_mode=1 #continental
#satellite band number (L5TM [25,26,27,28,29,30])
satbandno=25 #Band 1 of L5TM is first to undergo atmospheric correction

for file in $(g.mlist type=rast pattern=*.toar.1) do #Here we suppose
you have altitude (DEM) and Visibility (VIS) maps ready

#-----------------------------------------------------------------------
r.mapcalc expression="visibility=${vis_list[$i]}" --overwrite # Dummy
visibility value for atcorr param file
vis=12
#Increment i
i=$(echo "$i + 1" | bc)
#Altitude dummy value (in Km should be negative in this param file)
#(overwritten by DEM raster input)
alt=-1.200
# L5 basename as stored in GRASS GIS and used by i.landsat.toar
L5basename=$(echo $file | sed 's/\(.*\)\.\(.*\)\.\(.*\)/\1/') echo
$L5basename

#---------------------------
# Please change as you need
#---------------------------

#datetime of satellite overpass (month, day, GMT decimal hour) echo
"Input: GMT (i.e. 6.30)"
read gmt
#mdh="6 03 6.30"
monthday=$(echo $L5basename | sed 's/\(.*\)_.......\(.*\)/\2/')
day=$(echo $L5basename | sed 's/\(.*\)_.........\(.*\)/\2/')
month=$(echo "($monthday - $day) / 100" | bc) mdh="$month $day $gmt"
echo $mdh

# Central Lat/Long
north=$(g.region -p | grep north | sed 's/north:\ \(.*\)/\1/' | bc)
south=$(g.region -p | grep south | sed 's/south:\ \(.*\)/\1/' | bc)
east=$(g.region -p | grep east | sed 's/east:\ \(.*\)/\1/' | bc)
west=$(g.region -p | grep west | sed 's/west:\ \(.*\)/\1/' | bc)
Lat_nonproj=$(echo "(($north - $south)/2.0) + $south" | bc )
Long_nonproj=$(echo "(($east - $west)/2.0) + $west" | bc ) echo
"$Long_nonproj $Lat_nonproj" > tempfile.txt Long=$(m.proj -o -d
input=tempfile.txt | sed
's/\(.*\)|\(.*\)|\(.*\)/\1/')
Lat=$(m.proj -o -d input=tempfile.txt | sed
's/\(.*\)|\(.*\)|\(.*\)/\2/')
echo $Long_nonproj $Lat_nonproj
echo $Long $Lat

for bandno in 1 2 3 4 5 7
do # Generate the parameterization file
echo "$geom - geometrical
conditions=Landsat 5 TM" > $root/param_L5.txt
echo "$mdh $Long $Lat - month day hh.ddd longitude latitude
(\"hh.ddd\" is in decimal hours GMT)" >> $root/param_L5.txt
echo "$atm_mode - atmospheric
mode=tropical" >> $root/param_L5.txt
echo "$aerosol_mode - aerosols
model=continental" >> $root/param_L5.txt
echo "$vis - visibility [km] (aerosol
model concentration), not used as there is raster input" >>
$root/param_L5.txt
echo "$alt - mean target elevation above sea
level [km] (here 600m asl), not used as there is raster input" >>
$root/param_L5.txt
echo "$sens_height - sensor height (here,
sensor on board a satellite)" >> $root/param_L5.txt
echo "$satbandno - 'i'th band of TM
Landsat 5" >> $root/param_L5.txt
# Process band-wise atmospheric correction with 6s cat
$root/param_L5.txt echo "i.atcorr -r input=$L5basename.toar.$bandno
elevation=$dem visibility=visibility parameters=$root/param_L5.txt
output=$L5basename.surf.$bandno range=0,1 rescale=0,1 --overwrite"
i.atcorr -r input=$L5basename.toar.$bandno elevation=$dem
visibility=visibility parameters=$root/param_L5.txt
output=$L5basename.surf.$bandno range=0,1 rescale=0,1 --overwrite
satbandno=$((satbandno+1))
if [ $satbandno -gt 30 ]
  then satbandno=25
fi
done
done

-----Original Message-----
From: grass-user-bounces@lists.osgeo.org
[mailto:grass-user-bounces@lists.osgeo.org] On Behalf Of Elena Mezzini
Sent: Saturday, May 14, 2011 12:14 AM
To: grass-user@lists.osgeo.org
Subject: [GRASS-user] Re: i.atcorr returns all NULL values

I have the same problem, both with band 1 and 2.
I did i.landsat.toar and then i.atcorr but all the bands worked except
for band 1 and 2, these have values min=-nan and max=-nan.
There is someone who can help us?

Thank you!
Elena

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

(attachments)

L5TM_import_TOAR_ATCORR.sh (4.99 KB)

On Mon, May 23, 2011 at 9:36 PM, Markus Neteler <neteler@osgeo.org> wrote:

Hi Yann,

On Mon, May 23, 2011 at 5:07 AM, Chemin, Yann (IWMI) <Y.Chemin@cgiar.org> wrote:

p192 r030 image of July 2003 of Italy (L5TM) successfully corrected for
band 1 and 2.
The following script works well in GRASS GIS Trunk SVN.

(better send as attachment since a series of line breaks got broken)

...

# For i.atcorr scripting
#-----------------------------------------------------
vis_list=(10 10 8 9.7 15 8 7 10 10 9.7 12 9.7 7 12 12 12 3 15 12 9.7 6 15)
vis_len=${#vis_list[*]}
echo $vis_len

... this is not clear to me: why so many values and where
do they originate from? Since we have only 6 channels to
work with...

Moreover, how can it be possible that visibility is different for
different channels of the same scene? From the documentation it seems
that visibility is related to aerosol concentration at 550nm which can
not possibility be different for different bands of the same scene.
Each created visibility map holds only one value
r.mapcalc expression="visibility=${vis_list[$i]}" --overwrite
so why not just use this visibility value as input in the parameter
file instead of creating a map where all cells have the same value?

Markus M

Ah,
vis_list for 22 images in Iran, did not change those, the first value
was used to create a uniform map, used in the param file for that L5TM
image.
If you have n number of _MTL.txt files in the directory, you should be
able to set the array values n times over so that each image has a
visibility value to itself.

-----Original Message-----
From: Markus Metz [mailto:markus.metz.giswork@googlemail.com]
Sent: Tuesday, May 24, 2011 12:52 PM
To: Chemin, Yann (IWMI)
Cc: grass-user@lists.osgeo.org; Elena Mezzini; Markus Neteler
Subject: Re: [GRASS-user] Re: i.atcorr returns all NULL values

On Mon, May 23, 2011 at 9:36 PM, Markus Neteler <neteler@osgeo.org>
wrote:

Hi Yann,

On Mon, May 23, 2011 at 5:07 AM, Chemin, Yann (IWMI)

<Y.Chemin@cgiar.org> wrote:

p192 r030 image of July 2003 of Italy (L5TM) successfully corrected
for band 1 and 2.
The following script works well in GRASS GIS Trunk SVN.

(better send as attachment since a series of line breaks got broken)

...

# For i.atcorr scripting
#-----------------------------------------------------
vis_list=(10 10 8 9.7 15 8 7 10 10 9.7 12 9.7 7 12 12 12 3 15 12 9.7
6 15) vis_len=${#vis_list[*]} echo $vis_len

... this is not clear to me: why so many values and where do they
originate from? Since we have only 6 channels to work with...

Moreover, how can it be possible that visibility is different for
different channels of the same scene? From the documentation it seems
that visibility is related to aerosol concentration at 550nm which can
not possibility be different for different bands of the same scene.
Each created visibility map holds only one value r.mapcalc
expression="visibility=${vis_list[$i]}" --overwrite so why not just use
this visibility value as input in the parameter file instead of creating
a map where all cells have the same value?

Markus M

Each created visibility map holds only one value r.mapcalc

expression="visibility=${vis_list[$i]}" --overwrite so why not just use
this visibility value as input in the >parameter file instead of
creating a map where all cells have the same value?

Yes, this is a valid point, the script is designed to (hopefully soon)
encompass raster maps of visibility data (maybe interpolated...), so
this is a placeholder for the next steps.

-----Original Message-----
From: Markus Metz [mailto:markus.metz.giswork@googlemail.com]
Sent: Tuesday, May 24, 2011 12:52 PM
To: Chemin, Yann (IWMI)
Cc: grass-user@lists.osgeo.org; Elena Mezzini; Markus Neteler
Subject: Re: [GRASS-user] Re: i.atcorr returns all NULL values

On Mon, May 23, 2011 at 9:36 PM, Markus Neteler <neteler@osgeo.org>
wrote:

Hi Yann,

On Mon, May 23, 2011 at 5:07 AM, Chemin, Yann (IWMI)

<Y.Chemin@cgiar.org> wrote:

p192 r030 image of July 2003 of Italy (L5TM) successfully corrected
for band 1 and 2.
The following script works well in GRASS GIS Trunk SVN.

(better send as attachment since a series of line breaks got broken)

...

# For i.atcorr scripting
#-----------------------------------------------------
vis_list=(10 10 8 9.7 15 8 7 10 10 9.7 12 9.7 7 12 12 12 3 15 12 9.7
6 15) vis_len=${#vis_list[*]} echo $vis_len

... this is not clear to me: why so many values and where do they
originate from? Since we have only 6 channels to work with...

Moreover, how can it be possible that visibility is different for
different channels of the same scene? From the documentation it seems
that visibility is related to aerosol concentration at 550nm which can
not possibility be different for different bands of the same scene.
Each created visibility map holds only one value r.mapcalc
expression="visibility=${vis_list[$i]}" --overwrite so why not just use
this visibility value as input in the parameter file instead of creating
a map where all cells have the same value?

Markus M

Hi Juan,

Can you please give the download link for your images,

Could you also check the output of i.landsat.toar for them and tell if reflectance ranges are valid/logic.

Thank you,

Yann

From: Juan Benavides Duque [mailto:jbenavid@siu.edu]
Sent: Thursday, May 26, 2011 11:38 PM
To: Chemin, Yann (IWMI)
Cc: Markus Metz; Elena Mezzini
Subject: Re: [GRASS-user] Re: i.atcorr returns all NULL values

I tried Yann’s code for the i.atcorr on some Landsat TM5 images

It worked very nice for images taken after 1995 but before that still returns null values when running i.atcorr for bands 1 and 2

I used TM5 scenes from the same location for 1986, 1989, and 1996 and the first two (1986 and 1989) had the same problem with the null values…

sorry I can provide a way to fix it but I hope somebody will

juan c

On Tue, May 24, 2011 at 3:49 AM, Chemin, Yann (IWMI) <Y.Chemin@cgiar.org> wrote:

Each created visibility map holds only one value r.mapcalc
expression=“visibility=${vis_list[$i]}” --overwrite so why not just use
this visibility value as input in the >parameter file instead of
creating a map where all cells have the same value?

Yes, this is a valid point, the script is designed to (hopefully soon)
encompass raster maps of visibility data (maybe interpolated…), so
this is a placeholder for the next steps.

-----Original Message-----
From: Markus Metz [mailto:markus.metz.giswork@googlemail.com]
Sent: Tuesday, May 24, 2011 12:52 PM
To: Chemin, Yann (IWMI)
Cc: grass-user@lists.osgeo.org; Elena Mezzini; Markus Neteler

Subject: Re: [GRASS-user] Re: i.atcorr returns all NULL values

On Mon, May 23, 2011 at 9:36 PM, Markus Neteler <neteler@osgeo.org>
wrote:

Hi Yann,

On Mon, May 23, 2011 at 5:07 AM, Chemin, Yann (IWMI)
<Y.Chemin@cgiar.org> wrote:

p192 r030 image of July 2003 of Italy (L5TM) successfully corrected
for band 1 and 2.
The following script works well in GRASS GIS Trunk SVN.

(better send as attachment since a series of line breaks got broken)

For i.atcorr scripting

#-----------------------------------------------------
vis_list=(10 10 8 9.7 15 8 7 10 10 9.7 12 9.7 7 12 12 12 3 15 12 9.7
6 15) vis_len=${#vis_list[*]} echo $vis_len

… this is not clear to me: why so many values and where do they
originate from? Since we have only 6 channels to work with…

Moreover, how can it be possible that visibility is different for
different channels of the same scene? >From the documentation it seems
that visibility is related to aerosol concentration at 550nm which can
not possibility be different for different bands of the same scene.
Each created visibility map holds only one value r.mapcalc
expression=“visibility=${vis_list[$i]}” --overwrite so why not just use
this visibility value as input in the parameter file instead of creating
a map where all cells have the same value?

Markus M


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user