[GRASS-user] CLI syntax for gain in i.landsat.toar

Markus Neteler neteler at osgeo.org
Sat Jul 25 14:45:02 EDT 2009


On Wed, Jul 22, 2009 at 10:43 PM, Michael Perdue<michael_perdue at yahoo.ca> wrote:
> Hi,
>
> I've been playing around with i.landsat.toar and am having problems
> correctly entering the gain values on the command line.
>
> The bands are labeled as:
> l7_049026_01_toaDN  l7_049026_04_toaDN  l7_049026_08_toaDN
> l7_049026_02_toaDN  l7_049026_05_toaDN  l7_049026_6h_toaDN
> l7_049026_03_toaDN  l7_049026_07_toaDN  l7_049026_6l_toaDN
>
> date=2000-06-26
>
> solar_elevation=60.44
>
> Gain values are:
> Band     LMAX/LMIN
> l7_049026_01  193.51/-6.20
> l7_049026_02  201.58/-6.00
> l7_049026_03  157.96/-4.50
> l7_049026_04  234.06/-4.50
> l7_049026_05  31.63/-1.00
> l7_049026_06l 16.97/0.00
> l7_049026_06h 10.94/-0.35
> l7_049026_07  243.02/-5.00
> l7_049026_08  12.61/3.20
>
> I've tried;
> i.landsat.toar -7 band_prefix=l7_049026_ \
>   date=2000-06-26 solar_elevation=60.44 \
>  gain=193.51,-6.20,201.58,-6.00,157.96,-4.50,234.06,-4.50,31.63,-1.00,16.97,0.00,10.94,-0.35,243.02,-5.00,12.61,3.20
>
> as well as (among others);
> i.landsat.toar -7 band_prefix=l7_049026_ \
>   date=2000-06-26 solar_elevation=60.44 \
>
>  gain='193.51/-6.20,201.58/-6.00,157.96/-4.50,234.06/-4.50,31.63/-1.00,16.97/0.00,10.94/-0.35,243.02/-5.00,12.61/3.20'
>
> But no matter what I try, I receive the message "ERROR: For Landsat-7 is
> necessary band gain with 9 (H/L) data".

In the code I see
strlen(bgain->answer) == 9

http://trac.osgeo.org/grass/browser/grass-addons/imagery/i.landsat.toar/main.c#L243

I don't understand this test. Perhaps the number of tokens should be counted
instead? On the other hand, the values seem to be coded:

http://trac.osgeo.org/grass/browser/grass-addons/imagery/i.landsat.toar/landsat_set.c#L402

> What is the correct syntax?

Maybe something like
gain=hhhhlhhhh
so that the 5th value is low, the rest high gain.

Can you try?

If that works, please send me the full command line for addition into
the manual as example.

Markus


More information about the grass-user mailing list