[GRASS-dev] Re: [GRASS-SVN] r44252 - grass/branches/releasebranch_6_4/imagery/i.atcorr

On Mon, Nov 8, 2010 at 10:28 AM, <svn_grass@osgeo.org> wrote:
...

grass/branches/releasebranch_6_4/imagery/i.atcorr/6s.cpp
grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp
Log:
i.atcorr: be less verbose, fix when elevation is not given
(merge r44250 from devbr6)

...

Just curious about this change:

Modified: grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp

--- grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp 2010-11-08 09:27:08 UTC (rev 44251)
+++ grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp 2010-11-08 09:28:04 UTC (rev 44252)

...

@@ -331,7 +330,8 @@
G_set_f_null_value(&buf[col], 1);
continue;
}
- alt[col] /= 1000.0f; /* converting to km from input which should be in meter */
+ if (ialt_fd >= 0)
+ alt[col] /= 1000.0f; /* converting to km from input which should be in meter */

        /\* check if both maps are active and if whether any value has changed \*/
        if\(\(ialt\_fd &gt;= 0\) &amp;&amp; \(ivis\_fd &gt;= 0\) &amp;&amp; \(\(prev\_vis \!= vis\[col\]\) || \(prev\_alt \!= alt\[col\]\)\)\)

If no elevation is available, perhaps better issue a warning/fatal error?
I am not very familiar with this code so I dunno but in general
performing atmospheric
correction without DEM can lead to nonsense. But perhaps my observation is
not applicable in this code chunk.

Markus

From what I can read if no file descriptor is found then do not

convert meters to km
If no file descriptor is found it should fall back to a single
altitude value found in the input parameter file, the crux is that the
value is in meters too...

A good modification would be to remove elevation (ialt) value from
parameter file and make it a separate input value to clarify the issue
value Vs raster input file. Likewise for visibility (ivis).

Yann Chemin
www.csu.edu.au

On 09/11/2010, at 4:43, Markus Neteler <neteler@osgeo.org> wrote:

On Mon, Nov 8, 2010 at 10:28 AM, <svn_grass@osgeo.org> wrote:
...

  grass/branches/releasebranch_6_4/imagery/i.atcorr/6s.cpp
  grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp
Log:
i.atcorr: be less verbose, fix when elevation is not given
(merge r44250 from devbr6)

...

Just curious about this change:

Modified: grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp

--- grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp 2010-11-08 09:27:08 UTC (rev 44251)
+++ grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp 2010-11-08 09:28:04 UTC (rev 44252)

...

@@ -331,7 +330,8 @@
               G_set_f_null_value(&buf[col], 1);
               continue;
           }
- alt[col] /= 1000.0f; /* converting to km from input which should be in meter */
+ if (ialt_fd >= 0)
+ alt[col] /= 1000.0f; /* converting to km from input which should be in meter */

            /* check if both maps are active and if whether any value has changed */
            if((ialt_fd >= 0) && (ivis_fd >= 0) && ((prev_vis != vis[col]) || (prev_alt != alt[col])))

If no elevation is available, perhaps better issue a warning/fatal error?
I am not very familiar with this code so I dunno but in general
performing atmospheric
correction without DEM can lead to nonsense. But perhaps my observation is
not applicable in this code chunk.

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

Hi,

2010/11/8 Yann Chemin <yann.chemin@gmail.com>:

>From what I can read if no file descriptor is found then do not
convert meters to km
If no file descriptor is found it should fall back to a single
altitude value found in the input parameter file, the crux is that the
value is in meters too...

A good modification would be to remove elevation (ialt) value from
parameter file and make it a separate input value to clarify the issue
value Vs raster input file. Likewise for visibility (ivis).

when playing with i.atcorr, input raster maps are very small (450x450)
in my case. Without `ialt` i.atcorr runs for few seconds, with this
parameter it runs for ten minutes and still computes - is that normal?
- sorry knowing very few about i.atcorr.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

2010/11/8 Martin Landa <landa.martin@gmail.com>:

when playing with i.atcorr, input raster maps are very small (450x450)
in my case. Without `ialt` i.atcorr runs for few seconds, with this
parameter it runs for ten minutes and still computes - is that normal?
- sorry knowing very few about i.atcorr.

concretely

$ g.region rast=Brg1 -p
projection: 1 (UTM)
zone: 33
datum: wgs84
ellipsoid: wgs84
north: 5633223.50868776
south: 5605657.62851621
west: 497279.36486102
east: 525403.19584718
nsres: 60.05638382
ewres: 59.96552449
rows: 459
cols: 469
cells: 215271

$ i.landsat.toar -tr input_prefix=Brg output_prefix=B_rad
metfile=L4191025_02519840414_MTL.txt

$ g.region -lg
...
center_long=15.16068438
center_lat=50.72648033
...

$ r.univar --q map=demrg | grep mean:
mean: 552.711

$ cat atcorr.txt
7
04 14 9.28 15.16068045 50.72664675
0
3
50
-0.552
-1000
31 # it's MSS1

$ i.atcorr iimg=B_rad1 ialt=demrg icnd=atcorr.txt oimg=B_cor1 --o

Takes with `ialt` tens of minutes to finish computing...

Is that expected?

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

2010/11/8 Martin Landa <landa.martin@gmail.com>:

[...]

Takes with `ialt` tens of minutes to finish computing...

Is that expected?

trying example from i.atcorr manual - also very very slow with `ialt`.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Hi Martin
I am going to office now
Can you send me your input files and script
Thank you
Yann

Yann Chemin
www.csu.edu.au

On 09/11/2010, at 7:23, Martin Landa <landa.martin@gmail.com> wrote:

2010/11/8 Martin Landa <landa.martin@gmail.com>:

when playing with i.atcorr, input raster maps are very small (450x450)
in my case. Without `ialt` i.atcorr runs for few seconds, with this
parameter it runs for ten minutes and still computes - is that normal?
- sorry knowing very few about i.atcorr.

concretely

$ g.region rast=Brg1 -p
projection: 1 (UTM)
zone: 33
datum: wgs84
ellipsoid: wgs84
north: 5633223.50868776
south: 5605657.62851621
west: 497279.36486102
east: 525403.19584718
nsres: 60.05638382
ewres: 59.96552449
rows: 459
cols: 469
cells: 215271

$ i.landsat.toar -tr input_prefix=Brg output_prefix=B_rad
metfile=L4191025_02519840414_MTL.txt

$ g.region -lg
...
center_long=15.16068438
center_lat=50.72648033
...

$ r.univar --q map=demrg | grep mean:
mean: 552.711

$ cat atcorr.txt
7
04 14 9.28 15.16068045 50.72664675
0
3
50
-0.552
-1000
31 # it's MSS1

$ i.atcorr iimg=B_rad1 ialt=demrg icnd=atcorr.txt oimg=B_cor1 --o

Takes with `ialt` tens of minutes to finish computing...

Is that expected?

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Hi,

2010/11/8 Yann Chemin <yann.chemin@gmail.com>:

Hi Martin
I am going to office now
Can you send me your input files and script

just try example for nc_spm from i.atcorr manual, it's same.

Thanks, Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Apologies, input altitude in param file is in Km (negative) already.
The test in the code is assessing if file descriptor for altitude
raster is positive and not null, confirming that the alt row buffer is
populated, therefore permitting processing from meter to Km
conversion.
if not available, global unique value is taken in the process of
inversion model re-definition.
So this seem justified to use.

On 09/11/2010, Yann Chemin <yann.chemin@gmail.com> wrote:

From what I can read if no file descriptor is found then do not
convert meters to km
If no file descriptor is found it should fall back to a single
altitude value found in the input parameter file, the crux is that the
value is in meters too...

A good modification would be to remove elevation (ialt) value from
parameter file and make it a separate input value to clarify the issue
value Vs raster input file. Likewise for visibility (ivis).

Yann Chemin
www.csu.edu.au

On 09/11/2010, at 4:43, Markus Neteler <neteler@osgeo.org> wrote:

On Mon, Nov 8, 2010 at 10:28 AM, <svn_grass@osgeo.org> wrote:
...

  grass/branches/releasebranch_6_4/imagery/i.atcorr/6s.cpp
  grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp
Log:
i.atcorr: be less verbose, fix when elevation is not given
(merge r44250 from devbr6)

...

Just curious about this change:

Modified: grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp

--- grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp
2010-11-08 09:27:08 UTC (rev 44251)
+++ grass/branches/releasebranch_6_4/imagery/i.atcorr/main.cpp
2010-11-08 09:28:04 UTC (rev 44252)

...

@@ -331,7 +330,8 @@
               G_set_f_null_value(&buf[col], 1);
               continue;
           }
- alt[col] /= 1000.0f; /* converting to km from input which
should be in meter */
+ if (ialt_fd >= 0)
+ alt[col] /= 1000.0f; /* converting to km from input which
should be in meter */

            /* check if both maps are active and if whether any value has
changed */
            if((ialt_fd >= 0) && (ivis_fd >= 0) && ((prev_vis !=
vis[col]) || (prev_alt != alt[col])))

If no elevation is available, perhaps better issue a warning/fatal error?
I am not very familiar with this code so I dunno but in general
performing atmospheric
correction without DEM can lead to nonsense. But perhaps my observation
is
not applicable in this code chunk.

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

--
Yann Chemin
Senior Spatial Hydrologist
www.csu.edu.au/research/icwater
M +61-4-3740 7019