[GRASS-user] GRASS crashes while running i.atcorr

hi all,

So I am trying to run i.atcorr but every time I run it, the whole program goes unresponsive and crashes. Has anyone experienced this before? Is there any way I can fix it?

One thing that might be causing it is my parameters text file. I’m not totally sure I understand what all the fields are but here is an example of the parameter files I have created. This one is for the second band of a landsat 5 TM scene over central British Columbia

7
8 15 18.49 -116.027755 50.267045
2
0
0
0
-1000
26

I understand most of the parameters except the aerosol model, mean target elevation and sensor height. Are these in the metadata file? I don’t know about the aerosol module, but for the elevation, doesn’t this come from the DEM attached? Lastly, I went with -1000 for sensor height because the grass wiki page says -1000 sensor height (here, sensor on board a satellite) so I assumed this was a preset value.

Once again, I don’t know if the parameter file is the issue, or the only issue at least, so any advice running i.atcorr would be much appreciated!

Thanks,

JDC

Sorry, I forgot to mention I am using GRASS 7.0.0 on windows 7

Thanks,

JDC

···

On Fri, May 1, 2015 at 11:33 AM, Jake Chila <jake.chila@gmail.com> wrote:

hi all,

So I am trying to run i.atcorr but every time I run it, the whole program goes unresponsive and crashes. Has anyone experienced this before? Is there any way I can fix it?

One thing that might be causing it is my parameters text file. I’m not totally sure I understand what all the fields are but here is an example of the parameter files I have created. This one is for the second band of a landsat 5 TM scene over central British Columbia

7
8 15 18.49 -116.027755 50.267045
2
0
0
0
-1000
26

I understand most of the parameters except the aerosol model, mean target elevation and sensor height. Are these in the metadata file? I don’t know about the aerosol module, but for the elevation, doesn’t this come from the DEM attached? Lastly, I went with -1000 for sensor height because the grass wiki page says -1000 sensor height (here, sensor on board a satellite) so I assumed this was a preset value.

Once again, I don’t know if the parameter file is the issue, or the only issue at least, so any advice running i.atcorr would be much appreciated!

Thanks,

JDC

* Jake Chila <jake.chila@gmail.com> [2015-05-01 11:33:01 -0300]:

hi all,

So I am trying to run i.atcorr but every time I run it, the whole program
goes unresponsive and crashes. Has anyone experienced this before? Is there
any way I can fix it?

One thing that might be causing it is my parameters text file. I'm not
totally sure I understand what all the fields are but here is an example of
the parameter files I have created. This one is for the second band of a
landsat 5 TM scene over central British Columbia

7
8 15 18.49 -116.027755 50.267045
2
0
0
0
-1000
26

Hi Jake.

Please have a close look in the manual. As well, here:
<http://grasswiki.osgeo.org/wiki/Atmospheric_correction#Atmospheric_correction&gt;\.

If Landsat is your sensor to work with, here is a script around
i.atcorr: <https://github.com/NikosAlexandris/i.landsat.atcorr&gt;\. I
haven't used this in Windows though, and to upload it into grass-addons
I need to test it more.

Hope this helps a bit,
Nikos

I understand most of the parameters except the aerosol model, mean target
elevation and sensor height. Are these in the metadata file? I don't know
about the aerosol module, but for the elevation, doesn't this come from the
DEM attached? Lastly, I went with -1000 for sensor height because the grass
wiki page says -1000 sensor height (here, sensor on board a satellite) so I
assumed this was a preset value.

Once again, I don't know if the parameter file is the issue, or the only
issue at least, so any advice running i.atcorr would be much appreciated!

Thanks,

JDC

* Nikos Alexandris <nik@nikosalexandris.net> [2015-05-02 10:21:06 +0300]:

* Jake Chila <jake.chila@gmail.com> [2015-05-01 11:33:01 -0300]:

> hi all,
>
> So I am trying to run i.atcorr but every time I run it, the whole program
> goes unresponsive and crashes. Has anyone experienced this before? Is there
> any way I can fix it?
>
> One thing that might be causing it is my parameters text file. I'm not
> totally sure I understand what all the fields are but here is an example of
> the parameter files I have created. This one is for the second band of a
> landsat 5 TM scene over central British Columbia
>
> 7
> 8 15 18.49 -116.027755 50.267045
> 2
> 0
> 0
> 0
> -1000
> 26

Hi Jake.

Please have a close look in the manual. As well, here:
<http://grasswiki.osgeo.org/wiki/Atmospheric_correction#Atmospheric_correction&gt;\.

If Landsat is your sensor to work with, here is a script around
i.atcorr: <https://github.com/NikosAlexandris/i.landsat.atcorr&gt;\. I
haven't used this in Windows though, and to upload it into grass-addons
I need to test it more.

Unfortunately, something is broken currently and I have no time to check
it :-(.

Nikos

* Nikos Alexandris <nik@nikosalexandris.net> [2015-05-02 11:38:23 +0300]:

* Nikos Alexandris <nik@nikosalexandris.net> [2015-05-02 10:21:06 +0300]:

>
>
>
> * Jake Chila <jake.chila@gmail.com> [2015-05-01 11:33:01 -0300]:
>
> > hi all,
> >
> > So I am trying to run i.atcorr but every time I run it, the whole program
> > goes unresponsive and crashes. Has anyone experienced this before? Is there
> > any way I can fix it?
> >
> > One thing that might be causing it is my parameters text file. I'm not
> > totally sure I understand what all the fields are but here is an example of
> > the parameter files I have created. This one is for the second band of a
> > landsat 5 TM scene over central British Columbia
> >
> > 7
> > 8 15 18.49 -116.027755 50.267045
> > 2
> > 0
> > 0
> > 0
> > -1000
> > 26
>
> Hi Jake.
>
> Please have a close look in the manual. As well, here:
> <http://grasswiki.osgeo.org/wiki/Atmospheric_correction#Atmospheric_correction&gt;\.
>
> If Landsat is your sensor to work with, here is a script around
> i.atcorr: <https://github.com/NikosAlexandris/i.landsat.atcorr&gt;\. I
> haven't used this in Windows though, and to upload it into grass-addons
> I need to test it more.

Unfortunately, something is broken currently and I have no time to check
it :-(.

Jake, if you read Python, you could, however, make use of the Parameters python class
defined in
<https://github.com/NikosAlexandris/i.landsat.atcorr/blob/master/parameters.py&gt;\.
I will create a text file with the requested parameters suitable for i.atcorr.

An example inside python:

# import class
from parameters import Parameters

# check it out with help()
# help(Parameters)

# create object with desired six s parameters for i.atcorr
ssp = Parameters(geo=8,
mon=11, day=8, gmt='23:42',
lon=22.2, lat=33.3,
atm=2, aer=1, vis=10, aod=None,
xps=-200, xpp=-1000,
bnd=26)

# what is it like?
print ssp

Parameters for the 6S atmospheric correction model:
8 # Geometrical conditions
11 8 23.70 22.200000 33.300000 # Month Day GMT Center Longitude Latitude [DD]
2 # Atmospheric model [index]
1 # Aerosols model [index]
10.0 # Visibility [km]
-200.0 # Mean Target Altitude [negative km]
-1000 # Sensor Altitude rel. to xps [negative km] or SatelliteBorn [-1000]
26 # Satellite Band Number [index]

# export it to an ascii file
p6s.export_ascii("ssp_example.txt")

# what is inside the exported file?
cat p6s_example.txt

8 # Geometrical conditions
11 8 23.70 22.200000 33.300000 # Month Day GMT Center Longitude Latitude [DD]
2 # Atmospheric model [index]
1 # Aerosols model [index]
10.0 # Visibility [km]
-200.0 # Mean Target Altitude [negative km]
-1000 # Sensor Altitude rel. to xps [negative km] or SatelliteBorn [-1000]
26 # Satellite Band Number [index]

Nikos

Hi all,

So I think I have managed to fix my problems with help from Markus and Nikos. As it turns out my issue was predictably (and embarrassingly) quite simple. In my parameters file both the month and day variables were in float format and so had the decimals after them which I think caused some problems in the program.

I also found an old email in this list which said to convert the DEM to an integer so I also did that.

Part of my project will be to compare the results from i.atcorr to those produced by the Atmospheric Correction Module in PCI Geomatica and so if there is interest I would be happy to post my results!

Thanks again,

JDC

···

On Fri, May 1, 2015 at 11:33 AM, Jake Chila <jake.chila@gmail.com> wrote:

hi all,

So I am trying to run i.atcorr but every time I run it, the whole program goes unresponsive and crashes. Has anyone experienced this before? Is there any way I can fix it?

One thing that might be causing it is my parameters text file. I’m not totally sure I understand what all the fields are but here is an example of the parameter files I have created. This one is for the second band of a landsat 5 TM scene over central British Columbia

7
8 15 18.49 -116.027755 50.267045
2
0
0
0
-1000
26

I understand most of the parameters except the aerosol model, mean target elevation and sensor height. Are these in the metadata file? I don’t know about the aerosol module, but for the elevation, doesn’t this come from the DEM attached? Lastly, I went with -1000 for sensor height because the grass wiki page says -1000 sensor height (here, sensor on board a satellite) so I assumed this was a preset value.

Once again, I don’t know if the parameter file is the issue, or the only issue at least, so any advice running i.atcorr would be much appreciated!

Thanks,

JDC

On Mon, May 4, 2015 at 7:11 PM, Jake Chila <jake.chila@gmail.com> wrote:

Hi all,

So I think I have managed to fix my problems with help from Markus and
Nikos. As it turns out my issue was predictably (and embarrassingly) quite
simple. In my parameters file both the month and day variables were in float
format and so had the decimals after them which I think caused some problems
in the program.

I also found an old email in this list which said to convert the DEM to an
integer so I also did that.

(... this surprises me - would not expect that).

Glad you got it running.

Part of my project will be to compare the results from i.atcorr to those
produced by the Atmospheric Correction Module in PCI Geomatica and so if
there is interest I would be happy to post my results!

Definitely!

best,
Markus