Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-25 Thread Markus Metz
On Thu, Jan 25, 2018 at 3:22 PM, Markus Metz 
wrote:
>
>
>
> On Thu, Jan 25, 2018 at 3:11 PM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:
> >
> > From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
> >
> > > Looks good to me, please submit to trunk.
> >
> > > Markus M
> >
> > Someone of you would have to do it, cause I can`t…
>
> I can do it.

Done in trunk r72127

> In the meantime, you could ask for write access ;-)
>
> Markus M
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-25 Thread Stefan Blumentrath
From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
Sent: torsdag 25. januar 2018 14.12
To: Stefan Blumentrath <stefan.blumentr...@nina.no>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

> Looks good to me, please submit to trunk.
> Markus M

Someone of you would have to do it, cause I can`t…


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

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-25 Thread Stefan Blumentrath
Just updated the patch attached to the ticket. Let`s hope it is the last one I 
have to upload ;-).

I double checked that I use the right create_iwave.py and that values are the 
ones MarkusM got.
Then I updated iwave.cpp and i.atcorr.html with results from the new run of 
create_iwave.py.

Cheers
Stefan


From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Stefan Blumentrath
Sent: torsdag 25. januar 2018 11.30
To: Markus Metz <markus.metz.gisw...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

Thanks for double checking!

Indeed, I used for some reason the old version of create_iwave.py. I ran svn up 
and chose “their side of the conflict” for the script. However, I really should 
have double checked.

Will update the patch immediately…

Cheers
Stefan



From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
Sent: torsdag 25. januar 2018 11.16
To: Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>
Cc: GRASS user list 
<grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2



On Thu, Jan 25, 2018 at 10:51 AM, Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
>
> Hi again,
>
> Now, there is a new patch attached to the ticket (#3482 that also covers the 
> update of S2A curves).
Your patch has e.g.

/* SR_AV_B1 of sentinel_2B_msi */
static const float sr1[17] = {
.0076, .0059, .0053, .0025, .0026, .0034, .0035, .0506,
.5946, .8712, .9090, .9460, .9615, 1., .9591, .8855,
.4542
};

while I get

/* SR_AV_B1 of sentinel_2B_msi */
static const float sr1[21] = {
., ., .0076, .0059, .0053, .0025, .0026, .0034,
.0035, .0506, .5946, .8712, .9090, .9460, .9615, 1.,
.9591, .8855, .4542, .0305, .
};

i.e. I get a few more values at the beginning and end. Same for other bands, 
where your patch is missing some relatively high values.

Did you use the latest create_iwave.py in trunk?

>
> If those changes are applicable to 7.4(.1?) too, I can provide a diff for the 
> release branch as well…

For 7.4, the response values in iwave.cpp could be updated.

>
> In addition I opened a new ticket for updating the other sensors 
> (https://trac.osgeo.org/grass/ticket/3483).
>
> I expect that I will update the curves for the sensors one by one (starting 
> with worldview2/3), cause I don`t think I manage to do all at once …

One by one makes sense.

Markus M
>
>
>
> And thanks again for all the support we received!
>
>
>
> Cheers
>
> Stefan
>
>
>
>
>
> From: Stefan Blumentrath
> Sent: onsdag 24. januar 2018 14.55
> To: Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>; Žofie 
> Cimburová <zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>>
> Cc: GRASS user list 
> <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
> Subject: RE: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> So, now there are two updated patches attached to: 
> https://trac.osgeo.org/grass/ticket/3482
>
> One for changes in create_iwave.py and one to add S2B curves.
>
>
>
> Big thanks to all (and esp. Markus M) who put effort into checking, fixing, 
> guiding  and helping us with S-2 in i.atcorr!
>
> Very much appreciated!
>
>
>
> Hope the latest changes are OK, so I can update S2A too.
>
>
>
> Cheers
>
> Stefan
>
>
>
> From: grass-user 
> [mailto:grass-user-boun...@lists.osgeo.org<mailto:grass-user-boun...@lists.osgeo.org>]
>  On Behalf Of Stefan Blumentrath
> Sent: onsdag 24. januar 2018 09.55
> To: Žofie Cimburová <zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>>
> Cc: GRASS user list 
> <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> Hi Zofie,
>
>
>
> Markus M found some issues in my version of create_iwave.py.
>
> I am fixing them right now!
>
>
>
> Cheers
>
> Stefan
>
>
>
> From: Žofie Cimburová 
> [mailto:zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>]
> Sent: onsdag 24. januar 2018 09.32
> To: Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>
> Cc: Markus Metz 
> <markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com>>; GRASS 
> user list <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> On Wed, Jan 24, 2018 at 12:35 AM, S

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-25 Thread Stefan Blumentrath
> Let's get out 7.4.0 and then add the new S2A/B to 7.4.1. Otherwise we'll 
> never get it out...

Fully understand!

Stefan
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-25 Thread Stefan Blumentrath
Thanks for double checking!

Indeed, I used for some reason the old version of create_iwave.py. I ran svn up 
and chose “their side of the conflict” for the script. However, I really should 
have double checked.

Will update the patch immediately…

Cheers
Stefan



From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
Sent: torsdag 25. januar 2018 11.16
To: Stefan Blumentrath <stefan.blumentr...@nina.no>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2



On Thu, Jan 25, 2018 at 10:51 AM, Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
>
> Hi again,
>
> Now, there is a new patch attached to the ticket (#3482 that also covers the 
> update of S2A curves).
Your patch has e.g.

/* SR_AV_B1 of sentinel_2B_msi */
static const float sr1[17] = {
.0076, .0059, .0053, .0025, .0026, .0034, .0035, .0506,
.5946, .8712, .9090, .9460, .9615, 1., .9591, .8855,
.4542
};

while I get

/* SR_AV_B1 of sentinel_2B_msi */
static const float sr1[21] = {
., ., .0076, .0059, .0053, .0025, .0026, .0034,
.0035, .0506, .5946, .8712, .9090, .9460, .9615, 1.,
.9591, .8855, .4542, .0305, .
};

i.e. I get a few more values at the beginning and end. Same for other bands, 
where your patch is missing some relatively high values.

Did you use the latest create_iwave.py in trunk?

>
> If those changes are applicable to 7.4(.1?) too, I can provide a diff for the 
> release branch as well…

For 7.4, the response values in iwave.cpp could be updated.

>
> In addition I opened a new ticket for updating the other sensors 
> (https://trac.osgeo.org/grass/ticket/3483).
>
> I expect that I will update the curves for the sensors one by one (starting 
> with worldview2/3), cause I don`t think I manage to do all at once …

One by one makes sense.

Markus M
>
>
>
> And thanks again for all the support we received!
>
>
>
> Cheers
>
> Stefan
>
>
>
>
>
> From: Stefan Blumentrath
> Sent: onsdag 24. januar 2018 14.55
> To: Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>; Žofie 
> Cimburová <zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>>
> Cc: GRASS user list 
> <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
> Subject: RE: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> So, now there are two updated patches attached to: 
> https://trac.osgeo.org/grass/ticket/3482
>
> One for changes in create_iwave.py and one to add S2B curves.
>
>
>
> Big thanks to all (and esp. Markus M) who put effort into checking, fixing, 
> guiding  and helping us with S-2 in i.atcorr!
>
> Very much appreciated!
>
>
>
> Hope the latest changes are OK, so I can update S2A too.
>
>
>
> Cheers
>
> Stefan
>
>
>
> From: grass-user 
> [mailto:grass-user-boun...@lists.osgeo.org<mailto:grass-user-boun...@lists.osgeo.org>]
>  On Behalf Of Stefan Blumentrath
> Sent: onsdag 24. januar 2018 09.55
> To: Žofie Cimburová <zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>>
> Cc: GRASS user list 
> <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> Hi Zofie,
>
>
>
> Markus M found some issues in my version of create_iwave.py.
>
> I am fixing them right now!
>
>
>
> Cheers
>
> Stefan
>
>
>
> From: Žofie Cimburová 
> [mailto:zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>]
> Sent: onsdag 24. januar 2018 09.32
> To: Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>
> Cc: Markus Metz 
> <markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com>>; GRASS 
> user list <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> On Wed, Jan 24, 2018 at 12:35 AM, Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
>
> Hi again,
>
>
>
> So, I did not prioritize tests for the time being and added a first attempt 
> for a diff to https://trac.osgeo.org/grass/ticket/3482
>
> I would be happy if someone could review…
>
> i.atcorr compiles fine with the changes, works for S2B and gives non-NULL 
> results.
>
>
>
> Zofie can you test with proper S2B data?
>
>
>
> Hi, I tested with one scene of S2B data and all bands, and the results look 
> good. (Not sure how to test if they're 100 % correct, but they at least seem 
> to 

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-25 Thread Markus Metz
On Thu, Jan 25, 2018 at 10:51 AM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:
>
> Hi again,
>
> Now, there is a new patch attached to the ticket (#3482 that also covers
the update of S2A curves).

Your patch has e.g.

/* SR_AV_B1 of sentinel_2B_msi */
static const float sr1[17] = {
.0076, .0059, .0053, .0025, .0026, .0034, .0035, .0506,
.5946, .8712, .9090, .9460, .9615, 1., .9591, .8855,
.4542
};

while I get

/* SR_AV_B1 of sentinel_2B_msi */
static const float sr1[21] = {
., ., .0076, .0059, .0053, .0025, .0026, .0034,
.0035, .0506, .5946, .8712, .9090, .9460, .9615, 1.,
.9591, .8855, .4542, .0305, .
};

i.e. I get a few more values at the beginning and end. Same for other
bands, where your patch is missing some relatively high values.

Did you use the latest create_iwave.py in trunk?

>
> If those changes are applicable to 7.4(.1?) too, I can provide a diff for
the release branch as well…

For 7.4, the response values in iwave.cpp could be updated.

>
> In addition I opened a new ticket for updating the other sensors (
https://trac.osgeo.org/grass/ticket/3483).
>
> I expect that I will update the curves for the sensors one by one
(starting with worldview2/3), cause I don`t think I manage to do all at
once …

One by one makes sense.

Markus M
>
>
>
> And thanks again for all the support we received!
>
>
>
> Cheers
>
> Stefan
>
>
>
>
>
> From: Stefan Blumentrath
> Sent: onsdag 24. januar 2018 14.55
> To: Stefan Blumentrath <stefan.blumentr...@nina.no>; Žofie Cimburová <
zoficimbur...@gmail.com>
> Cc: GRASS user list <grass-user@lists.osgeo.org>
> Subject: RE: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> So, now there are two updated patches attached to:
https://trac.osgeo.org/grass/ticket/3482
>
> One for changes in create_iwave.py and one to add S2B curves.
>
>
>
> Big thanks to all (and esp. Markus M) who put effort into checking,
fixing, guiding  and helping us with S-2 in i.atcorr!
>
> Very much appreciated!
>
>
>
> Hope the latest changes are OK, so I can update S2A too.
>
>
>
> Cheers
>
> Stefan
>
>
>
> From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of
Stefan Blumentrath
> Sent: onsdag 24. januar 2018 09.55
> To: Žofie Cimburová <zoficimbur...@gmail.com>
> Cc: GRASS user list <grass-user@lists.osgeo.org>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> Hi Zofie,
>
>
>
> Markus M found some issues in my version of create_iwave.py.
>
> I am fixing them right now!
>
>
>
> Cheers
>
> Stefan
>
>
>
> From: Žofie Cimburová [mailto:zoficimbur...@gmail.com]
> Sent: onsdag 24. januar 2018 09.32
> To: Stefan Blumentrath <stefan.blumentr...@nina.no>
> Cc: Markus Metz <markus.metz.gisw...@gmail.com>; GRASS user list <
grass-user@lists.osgeo.org>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> On Wed, Jan 24, 2018 at 12:35 AM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:
>
> Hi again,
>
>
>
> So, I did not prioritize tests for the time being and added a first
attempt for a diff to https://trac.osgeo.org/grass/ticket/3482
>
> I would be happy if someone could review…
>
> i.atcorr compiles fine with the changes, works for S2B and gives non-NULL
results.
>
>
>
> Zofie can you test with proper S2B data?
>
>
>
> Hi, I tested with one scene of S2B data and all bands, and the results
look good. (Not sure how to test if they're 100 % correct, but they at
least seem to make sense.)
>
> Best,
>
> Zofie
>
>
>
> Cheers
>
> Stefan
>
>
>
> From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
> Sent: tirsdag 23. januar 2018 15.31
> To: Stefan Blumentrath <stefan.blumentr...@nina.no>
> Cc: Markus Neteler <nete...@osgeo.org>; GRASS user list <
grass-user@lists.osgeo.org>
>
>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
>
>
> On Tue, Jan 23, 2018 at 3:24 PM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:
> >
> > OK, sounds doable for me ;-).
> > Will look at it tonight. Most of the other changes for Sentinel-2B are
already in place (I hope).
>
> Great!
>
> > Not sure if I manage to add python tests as well, looks like current
tests are more manual?
>
> Apparently results differ between operating systems, therefore tests
won't work well, unless you test if the output is all NULL, in which case a
fatal error should be produced anyway.
>
> Markus M
>
> >
> > Cheers
> > Stefan
> > _

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-24 Thread Nikos Alexandris

* Markus Metz <markus.metz.gisw...@gmail.com> [2018-01-23 13:02:27 +0100]:


On Tue, Jan 23, 2018 at 12:25 PM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:


No problem. Any chance I can contribute to maintenance of create_iwave.py?

What needs to be done? Take your latest changes into account?


nodata handling should be changed. In read_input(), missing values should
be set to zero. Then for each band, leading and trailing zeros would be set
to -1. This helps interpolate_band() to get the correct subrange.

For each band, create_iwave.py should print out the band name and the
wavelength as min - max. Care must be taken when finding reasonable min and
max wavelengths: find the max response, then go back while response >
threshold to find the min wavelength. Go forward while response > threshold
to find the max wavelength. As threshold I suggest 0.1 to eliminate noise
in the response values.

Markus M



Thanks Markus for this one (too).  Back in Bonn 2016, I tried to clear
up some of it.  Not exactly the way it had/has to be done as I
understand now.

Nikos





If you think it makes sense I will try to create a patch for adding S2B

to i.atcorr (would be a nice exercise and does not seem too complex)? Will
open a ticket and start working on it unless you tell me different.




Cheers

Stefan







From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of

Markus Metz

Sent: tirsdag 23. januar 2018 12.03
To: Markus Neteler <nete...@osgeo.org>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2





On Tue, Jan 23, 2018 at 11:51 AM, Markus Neteler <
nete...@osgeo.org> wrote:

>
> On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová
> <
zoficimbur...@gmail.com> wrote:

> > Forgot to cc the list.
> >
> > The CSV and the cpp template:
> >
https://www.dropbox.com/sh/9cnhsl59kvmx4o1/AABwnEVHdxfW_PqrB5Xcpczda?dl=0

>
> Great! Would you mind to also convert the S2A table? AFAIK it got
> updated due to recalibration compared to what we currently have.

please wait a bit with creating the cpp template, create_iwave.py needs

some maintenance


Markus M



>
> markusN
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user



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



--
Nikos Alexandris | Remote Sensing & Geomatics
GPG Key Fingerprint 6F9D4506F3CA28380974D31A9053534B693C4FB3 


signature.asc
Description: PGP signature
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-24 Thread Stefan Blumentrath
Hi Zofie,

Markus M found some issues in my version of create_iwave.py.
I am fixing them right now!

Cheers
Stefan

From: Žofie Cimburová [mailto:zoficimbur...@gmail.com]
Sent: onsdag 24. januar 2018 09.32
To: Stefan Blumentrath <stefan.blumentr...@nina.no>
Cc: Markus Metz <markus.metz.gisw...@gmail.com>; GRASS user list 
<grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On Wed, Jan 24, 2018 at 12:35 AM, Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
Hi again,

So, I did not prioritize tests for the time being and added a first attempt for 
a diff to https://trac.osgeo.org/grass/ticket/3482
I would be happy if someone could review…
i.atcorr compiles fine with the changes, works for S2B and gives non-NULL 
results.

Zofie can you test with proper S2B data?

Hi, I tested with one scene of S2B data and all bands, and the results look 
good. (Not sure how to test if they're 100 % correct, but they at least seem to 
make sense.)
Best,
Zofie

Cheers
Stefan

From: Markus Metz 
[mailto:markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com>]
Sent: tirsdag 23. januar 2018 15.31
To: Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>
Cc: Markus Neteler <nete...@osgeo.org<mailto:nete...@osgeo.org>>; GRASS user 
list <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>

Subject: Re: [GRASS-user] i.atcorr with Sentinel2



On Tue, Jan 23, 2018 at 3:24 PM, Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
>
> OK, sounds doable for me ;-).
> Will look at it tonight. Most of the other changes for Sentinel-2B are 
> already in place (I hope).

Great!

> Not sure if I manage to add python tests as well, looks like current tests 
> are more manual?
Apparently results differ between operating systems, therefore tests won't work 
well, unless you test if the output is all NULL, in which case a fatal error 
should be produced anyway.
Markus M
>
> Cheers
> Stefan
> 
> Von: Markus Metz 
> [markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com>]
> Gesendet: Dienstag, 23. Januar 2018 14:50
> An: Stefan Blumentrath
> Cc: Markus Neteler; GRASS user list
> Betreff: Re: [GRASS-user] i.atcorr with Sentinel2
>
> On Tue, Jan 23, 2018 at 2:19 PM, Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no><mailto:stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>>
>  wrote:
> >
> > OK, will give it a try.
> >
> The first part is more important because it 1) fixes the interpolation to 2.5 
> nm steps, and 2) helps iwave.cpp to load the response values.
> >
> > For the second part I am not sure if I properly understood where min - max 
> > wavelength for each band should be printed to.
> >
> > Do you mean to replace
> >
> > # convert limits from nanometers to micrometers
> >
> > lowerlimit = wavelengths[0]/1000
> >
> > upperlimit = wavelengths[-1]/1000
> >
> >
> >
> > Or just as a screen output?
>
> Just a screen output to help update the manual
> >
> > You did not mean band value limits, right?
>
> No, e.g. in the manual is
>
> Sentinel2A Coastal blue band B1 (430nm - 457nm)
>
> and this range could be printed out to screen based on the actual response. 
> This range can then be copied to the manual, making life a bit easier for the 
> person updating the manual.
> >
> > Not sure I am of help/useful for fixing create_iwave.py, but I`ll do my 
> > best.
>
> Your help is welcome!
>
> Markus M
>
> >
> > Cheers
> >
> > Stefan
> >
> >
> >
> >
> >
> > From: Markus Metz 
> > [mailto:markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com><mailto:markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com>>]
> > Sent: tirsdag 23. januar 2018 13.02
> > To: Stefan Blumentrath 
> > <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no><mailto:stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>>
> > Cc: Markus Neteler 
> > <nete...@osgeo.org<mailto:nete...@osgeo.org><mailto:nete...@osgeo.org<mailto:nete...@osgeo.org>>>;
> >  GRASS user list 
> > <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org><mailto:grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>>
> >
> >
> > Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> >
> >
> >
> >
&g

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Stefan Blumentrath
Hi again,

So, I did not prioritize tests for the time being and added a first attempt for 
a diff to https://trac.osgeo.org/grass/ticket/3482
I would be happy if someone could review…
i.atcorr compiles fine with the changes, works for S2B and gives non-NULL 
results.

Zofie can you test with proper S2B data?

Cheers
Stefan

From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
Sent: tirsdag 23. januar 2018 15.31
To: Stefan Blumentrath <stefan.blumentr...@nina.no>
Cc: Markus Neteler <nete...@osgeo.org>; GRASS user list 
<grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2



On Tue, Jan 23, 2018 at 3:24 PM, Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
>
> OK, sounds doable for me ;-).
> Will look at it tonight. Most of the other changes for Sentinel-2B are 
> already in place (I hope).

Great!

> Not sure if I manage to add python tests as well, looks like current tests 
> are more manual?
Apparently results differ between operating systems, therefore tests won't work 
well, unless you test if the output is all NULL, in which case a fatal error 
should be produced anyway.
Markus M
>
> Cheers
> Stefan
> 
> Von: Markus Metz 
> [markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com>]
> Gesendet: Dienstag, 23. Januar 2018 14:50
> An: Stefan Blumentrath
> Cc: Markus Neteler; GRASS user list
> Betreff: Re: [GRASS-user] i.atcorr with Sentinel2
>
> On Tue, Jan 23, 2018 at 2:19 PM, Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no><mailto:stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>>
>  wrote:
> >
> > OK, will give it a try.
> >
> The first part is more important because it 1) fixes the interpolation to 2.5 
> nm steps, and 2) helps iwave.cpp to load the response values.
> >
> > For the second part I am not sure if I properly understood where min - max 
> > wavelength for each band should be printed to.
> >
> > Do you mean to replace
> >
> > # convert limits from nanometers to micrometers
> >
> > lowerlimit = wavelengths[0]/1000
> >
> > upperlimit = wavelengths[-1]/1000
> >
> >
> >
> > Or just as a screen output?
>
> Just a screen output to help update the manual
> >
> > You did not mean band value limits, right?
>
> No, e.g. in the manual is
>
> Sentinel2A Coastal blue band B1 (430nm - 457nm)
>
> and this range could be printed out to screen based on the actual response. 
> This range can then be copied to the manual, making life a bit easier for the 
> person updating the manual.
> >
> > Not sure I am of help/useful for fixing create_iwave.py, but I`ll do my 
> > best.
>
> Your help is welcome!
>
> Markus M
>
> >
> > Cheers
> >
> > Stefan
> >
> >
> >
> >
> >
> > From: Markus Metz 
> > [mailto:markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com><mailto:markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com>>]
> > Sent: tirsdag 23. januar 2018 13.02
> > To: Stefan Blumentrath 
> > <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no><mailto:stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>>
> > Cc: Markus Neteler 
> > <nete...@osgeo.org<mailto:nete...@osgeo.org><mailto:nete...@osgeo.org<mailto:nete...@osgeo.org>>>;
> >  GRASS user list 
> > <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org><mailto:grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>>
> >
> >
> > Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> >
> >
> >
> >
> >
> > On Tue, Jan 23, 2018 at 12:25 PM, Stefan Blumentrath 
> > <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no><mailto:stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>>
> >  wrote:
> > >
> > > No problem. Any chance I can contribute to maintenance of create_iwave.py?
> > >
> > > What needs to be done? Take your latest changes into account?
> >
> > nodata handling should be changed. In read_input(), missing values should 
> > be set to zero. Then for each band, leading and trailing zeros would be set 
> > to -1. This helps interpolate_band() to get the correct subrange.
> >
> > For each band, create_iwave.py should print out the band name and the 
> > wavelength as min - max. Care must be taken when finding reasonable min and 
> &g

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Markus Metz
On Tue, Jan 23, 2018 at 3:24 PM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:
>
> OK, sounds doable for me ;-).
> Will look at it tonight. Most of the other changes for Sentinel-2B are
already in place (I hope).

Great!

> Not sure if I manage to add python tests as well, looks like current
tests are more manual?

Apparently results differ between operating systems, therefore tests won't
work well, unless you test if the output is all NULL, in which case a fatal
error should be produced anyway.

Markus M

>
> Cheers
> Stefan
> 
> Von: Markus Metz [markus.metz.gisw...@gmail.com]
> Gesendet: Dienstag, 23. Januar 2018 14:50
> An: Stefan Blumentrath
> Cc: Markus Neteler; GRASS user list
> Betreff: Re: [GRASS-user] i.atcorr with Sentinel2
>
> On Tue, Jan 23, 2018 at 2:19 PM, Stefan Blumentrath <
stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
> >
> > OK, will give it a try.
> >
> The first part is more important because it 1) fixes the interpolation to
2.5 nm steps, and 2) helps iwave.cpp to load the response values.
> >
> > For the second part I am not sure if I properly understood where min -
max wavelength for each band should be printed to.
> >
> > Do you mean to replace
> >
> > # convert limits from nanometers to micrometers
> >
> > lowerlimit = wavelengths[0]/1000
> >
> > upperlimit = wavelengths[-1]/1000
> >
> >
> >
> > Or just as a screen output?
>
> Just a screen output to help update the manual
> >
> > You did not mean band value limits, right?
>
> No, e.g. in the manual is
>
> Sentinel2A Coastal blue band B1 (430nm - 457nm)
>
> and this range could be printed out to screen based on the actual
response. This range can then be copied to the manual, making life a bit
easier for the person updating the manual.
> >
> > Not sure I am of help/useful for fixing create_iwave.py, but I`ll do my
best.
>
> Your help is welcome!
>
> Markus M
>
> >
> > Cheers
> >
> > Stefan
> >
> >
> >
> >
> >
> > From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
> > Sent: tirsdag 23. januar 2018 13.02
> > To: Stefan Blumentrath <stefan.blumentr...@nina.no>
> > Cc: Markus Neteler <nete...@osgeo.org<mailto:nete...@osgeo.org>>; GRASS
user list <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
> >
> >
> > Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> >
> >
> >
> >
> >
> > On Tue, Jan 23, 2018 at 12:25 PM, Stefan Blumentrath <
stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
> > >
> > > No problem. Any chance I can contribute to maintenance of
create_iwave.py?
> > >
> > > What needs to be done? Take your latest changes into account?
> >
> > nodata handling should be changed. In read_input(), missing values
should be set to zero. Then for each band, leading and trailing zeros would
be set to -1. This helps interpolate_band() to get the correct subrange.
> >
> > For each band, create_iwave.py should print out the band name and the
wavelength as min - max. Care must be taken when finding reasonable min and
max wavelengths: find the max response, then go back while response >
threshold to find the min wavelength. Go forward while response > threshold
to find the max wavelength. As threshold I suggest 0.1 to eliminate noise
in the response values.
> >
> > Markus M
> >
> > >
> > >
> > >
> > > If you think it makes sense I will try to create a patch for adding
S2B to i.atcorr (would be a nice exercise and does not seem too complex)?
Will open a ticket and start working on it unless you tell me different.
> > >
> > >
> > >
> > > Cheers
> > >
> > > Stefan
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of Markus Metz
> > > Sent: tirsdag 23. januar 2018 12.03
> > > To: Markus Neteler <nete...@osgeo.org<mailto:nete...@osgeo.org>>
> > > Cc: GRASS user list <grass-user@lists.osgeo.org>
> > > Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> > >
> > >
> > >
> > >
> > >
> > > On Tue, Jan 23, 2018 at 11:51 AM, Markus Neteler <
> > > nete...@osgeo.org<mailto:nete...@osgeo.org>> wrote:
> > >
> > > >
> > > > On Tue, Jan 23, 2018 at 11:09 AM, Žofi

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Stefan Blumentrath
Thanks Daniel, I might come back to your offer!
Cheers
Stefan


From: Daniel Victoria [mailto:daniel.victo...@gmail.com]
Sent: tirsdag 23. januar 2018 15.04
To: Markus Metz <markus.metz.gisw...@gmail.com>
Cc: Stefan Blumentrath <stefan.blumentr...@nina.no>; GRASS user list 
<grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

It's been a while since I wrote that script. Glad to see it's still of use :)
Anyway, I'm a bit overwhelmed so I won't be able to look at the changes asked. 
But I'm glad Stefan can take a look. And I can help out in any questions that 
might come up.
Cheers
Daniel

On Tue, Jan 23, 2018 at 11:50 AM Markus Metz 
<markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com>> wrote:


On Tue, Jan 23, 2018 at 2:19 PM, Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
>
> OK, will give it a try.
>
The first part is more important because it 1) fixes the interpolation to 2.5 
nm steps, and 2) helps iwave.cpp to load the response values.
>
> For the second part I am not sure if I properly understood where min – max 
> wavelength for each band should be printed to.
>
> Do you mean to replace
>
> # convert limits from nanometers to micrometers
>
> lowerlimit = wavelengths[0]/1000
>
> upperlimit = wavelengths[-1]/1000
>
>
>
> Or just as a screen output?
Just a screen output to help update the manual

>
> You did not mean band value limits, right?

No, e.g. in the manual is

Sentinel2A Coastal blue band B1 (430nm - 457nm)

and this range could be printed out to screen based on the actual response. 
This range can then be copied to the manual, making life a bit easier for the 
person updating the manual.
>
> Not sure I am of help/useful for fixing create_iwave.py, but I`ll do my best…

Your help is welcome!

Markus M

>
> Cheers
>
> Stefan
>
>
>
>
>
> From: Markus Metz 
> [mailto:markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com>]
> Sent: tirsdag 23. januar 2018 13.02
> To: Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>
> Cc: Markus Neteler <nete...@osgeo.org<mailto:nete...@osgeo.org>>; GRASS user 
> list <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
>
>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
>
>
> On Tue, Jan 23, 2018 at 12:25 PM, Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
> >
> > No problem. Any chance I can contribute to maintenance of create_iwave.py?
> >
> > What needs to be done? Take your latest changes into account?
>
> nodata handling should be changed. In read_input(), missing values should be 
> set to zero. Then for each band, leading and trailing zeros would be set to 
> -1. This helps interpolate_band() to get the correct subrange.
>
> For each band, create_iwave.py should print out the band name and the 
> wavelength as min - max. Care must be taken when finding reasonable min and 
> max wavelengths: find the max response, then go back while response > 
> threshold to find the min wavelength. Go forward while response > threshold 
> to find the max wavelength. As threshold I suggest 0.1 to eliminate noise in 
> the response values.
>
> Markus M
>
> >
> >
> >
> > If you think it makes sense I will try to create a patch for adding S2B to 
> > i.atcorr (would be a nice exercise and does not seem too complex)? Will 
> > open a ticket and start working on it unless you tell me different.
> >
> >
> >
> > Cheers
> >
> > Stefan
> >
> >
> >
> >
> >
> >
> >
> > From: grass-user 
> > [mailto:grass-user-boun...@lists.osgeo.org<mailto:grass-user-boun...@lists.osgeo.org>]
> >  On Behalf Of Markus Metz
> > Sent: tirsdag 23. januar 2018 12.03
> > To: Markus Neteler <nete...@osgeo.org<mailto:nete...@osgeo.org>>
> > Cc: GRASS user list 
> > <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
> > Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> >
> >
> >
> >
> >
> > On Tue, Jan 23, 2018 at 11:51 AM, Markus Neteler <
> > nete...@osgeo.org<mailto:nete...@osgeo.org>> wrote:
> >
> > >
> > > On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová
> > > <
> > zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>> wrote:
> >
> > > > Forgot to cc the list.
> > > >
> > > > The CSV and the cpp template:
> > > >
> > h

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Stefan Blumentrath
OK, sounds doable for me ;-).
Will look at it tonight. Most of the other changes for Sentinel-2B are already 
in place (I hope).
Not sure if I manage to add python tests as well, looks like current tests are 
more manual?

Cheers
Stefan

Von: Markus Metz [markus.metz.gisw...@gmail.com]
Gesendet: Dienstag, 23. Januar 2018 14:50
An: Stefan Blumentrath
Cc: Markus Neteler; GRASS user list
Betreff: Re: [GRASS-user] i.atcorr with Sentinel2

On Tue, Jan 23, 2018 at 2:19 PM, Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
>
> OK, will give it a try.
>
The first part is more important because it 1) fixes the interpolation to 2.5 
nm steps, and 2) helps iwave.cpp to load the response values.
>
> For the second part I am not sure if I properly understood where min - max 
> wavelength for each band should be printed to.
>
> Do you mean to replace
>
> # convert limits from nanometers to micrometers
>
> lowerlimit = wavelengths[0]/1000
>
> upperlimit = wavelengths[-1]/1000
>
>
>
> Or just as a screen output?

Just a screen output to help update the manual
>
> You did not mean band value limits, right?

No, e.g. in the manual is

Sentinel2A Coastal blue band B1 (430nm - 457nm)

and this range could be printed out to screen based on the actual response. 
This range can then be copied to the manual, making life a bit easier for the 
person updating the manual.
>
> Not sure I am of help/useful for fixing create_iwave.py, but I`ll do my best.

Your help is welcome!

Markus M

>
> Cheers
>
> Stefan
>
>
>
>
>
> From: Markus Metz 
> [mailto:markus.metz.gisw...@gmail.com<mailto:markus.metz.gisw...@gmail.com>]
> Sent: tirsdag 23. januar 2018 13.02
> To: Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>
> Cc: Markus Neteler <nete...@osgeo.org<mailto:nete...@osgeo.org>>; GRASS user 
> list <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
>
>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
>
>
> On Tue, Jan 23, 2018 at 12:25 PM, Stefan Blumentrath 
> <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
> >
> > No problem. Any chance I can contribute to maintenance of create_iwave.py?
> >
> > What needs to be done? Take your latest changes into account?
>
> nodata handling should be changed. In read_input(), missing values should be 
> set to zero. Then for each band, leading and trailing zeros would be set to 
> -1. This helps interpolate_band() to get the correct subrange.
>
> For each band, create_iwave.py should print out the band name and the 
> wavelength as min - max. Care must be taken when finding reasonable min and 
> max wavelengths: find the max response, then go back while response > 
> threshold to find the min wavelength. Go forward while response > threshold 
> to find the max wavelength. As threshold I suggest 0.1 to eliminate noise in 
> the response values.
>
> Markus M
>
> >
> >
> >
> > If you think it makes sense I will try to create a patch for adding S2B to 
> > i.atcorr (would be a nice exercise and does not seem too complex)? Will 
> > open a ticket and start working on it unless you tell me different.
> >
> >
> >
> > Cheers
> >
> > Stefan
> >
> >
> >
> >
> >
> >
> >
> > From: grass-user 
> > [mailto:grass-user-boun...@lists.osgeo.org<mailto:grass-user-boun...@lists.osgeo.org>]
> >  On Behalf Of Markus Metz
> > Sent: tirsdag 23. januar 2018 12.03
> > To: Markus Neteler <nete...@osgeo.org<mailto:nete...@osgeo.org>>
> > Cc: GRASS user list 
> > <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
> > Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> >
> >
> >
> >
> >
> > On Tue, Jan 23, 2018 at 11:51 AM, Markus Neteler <
> > nete...@osgeo.org<mailto:nete...@osgeo.org>> wrote:
> >
> > >
> > > On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová
> > > <
> > zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>> wrote:
> >
> > > > Forgot to cc the list.
> > > >
> > > > The CSV and the cpp template:
> > > >
> > https://www.dropbox.com/sh/9cnhsl59kvmx4o1/AABwnEVHdxfW_PqrB5Xcpczda?dl=0
> >
> > >
> > > Great! Would you mind to also convert the S2A table? AFAIK it got
> > > updated due to recalibration compared to what we currently have.
> >
> > please wait a bit with creating the cpp template, create_iwave.py needs 
> > some maintenance
> >
> > Markus M
> >
> >
> >
> > >
> > > markusN
> > > ___
> > > grass-user mailing list
> > > grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
> > > https://lists.osgeo.org/mailman/listinfo/grass-user

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

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Daniel Victoria
It's been a while since I wrote that script. Glad to see it's still of use
:)

Anyway, I'm a bit overwhelmed so I won't be able to look at the changes
asked. But I'm glad Stefan can take a look. And I can help out in any
questions that might come up.

Cheers
Daniel

On Tue, Jan 23, 2018 at 11:50 AM Markus Metz <markus.metz.gisw...@gmail.com>
wrote:

>
>
> On Tue, Jan 23, 2018 at 2:19 PM, Stefan Blumentrath <
> stefan.blumentr...@nina.no> wrote:
> >
> > OK, will give it a try.
> >
> The first part is more important because it 1) fixes the interpolation to
> 2.5 nm steps, and 2) helps iwave.cpp to load the response values.
> >
> > For the second part I am not sure if I properly understood where min –
> max wavelength for each band should be printed to.
> >
> > Do you mean to replace
> >
> > # convert limits from nanometers to micrometers
> >
> > lowerlimit = wavelengths[0]/1000
> >
> > upperlimit = wavelengths[-1]/1000
> >
> >
> >
> > Or just as a screen output?
>
> Just a screen output to help update the manual
>
> >
> > You did not mean band value limits, right?
>
> No, e.g. in the manual is
>
> Sentinel2A Coastal blue band B1 (430nm - 457nm)
>
> and this range could be printed out to screen based on the actual
> response. This range can then be copied to the manual, making life a bit
> easier for the person updating the manual.
> >
> > Not sure I am of help/useful for fixing create_iwave.py, but I`ll do my
> best…
>
> Your help is welcome!
>
> Markus M
>
> >
> > Cheers
> >
> > Stefan
> >
> >
> >
> >
> >
> > From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
> > Sent: tirsdag 23. januar 2018 13.02
> > To: Stefan Blumentrath <stefan.blumentr...@nina.no>
> > Cc: Markus Neteler <nete...@osgeo.org>; GRASS user list <
> grass-user@lists.osgeo.org>
> >
> >
> > Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> >
> >
> >
> >
> >
> > On Tue, Jan 23, 2018 at 12:25 PM, Stefan Blumentrath <
> stefan.blumentr...@nina.no> wrote:
> > >
> > > No problem. Any chance I can contribute to maintenance of
> create_iwave.py?
> > >
> > > What needs to be done? Take your latest changes into account?
> >
> > nodata handling should be changed. In read_input(), missing values
> should be set to zero. Then for each band, leading and trailing zeros would
> be set to -1. This helps interpolate_band() to get the correct subrange.
> >
> > For each band, create_iwave.py should print out the band name and the
> wavelength as min - max. Care must be taken when finding reasonable min and
> max wavelengths: find the max response, then go back while response >
> threshold to find the min wavelength. Go forward while response > threshold
> to find the max wavelength. As threshold I suggest 0.1 to eliminate noise
> in the response values.
> >
> > Markus M
> >
> > >
> > >
> > >
> > > If you think it makes sense I will try to create a patch for adding
> S2B to i.atcorr (would be a nice exercise and does not seem too complex)?
> Will open a ticket and start working on it unless you tell me different.
> > >
> > >
> > >
> > > Cheers
> > >
> > > Stefan
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On
> Behalf Of Markus Metz
> > > Sent: tirsdag 23. januar 2018 12.03
> > > To: Markus Neteler <nete...@osgeo.org>
> > > Cc: GRASS user list <grass-user@lists.osgeo.org>
> > > Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> > >
> > >
> > >
> > >
> > >
> > > On Tue, Jan 23, 2018 at 11:51 AM, Markus Neteler <
> > > nete...@osgeo.org> wrote:
> > >
> > > >
> > > > On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová
> > > > <
> > > zoficimbur...@gmail.com> wrote:
> > >
> > > > > Forgot to cc the list.
> > > > >
> > > > > The CSV and the cpp template:
> > > > >
> > >
> https://www.dropbox.com/sh/9cnhsl59kvmx4o1/AABwnEVHdxfW_PqrB5Xcpczda?dl=0
> > >
> > > >
> > > > Great! Would you mind to also convert the S2A table? AFAIK it got
> > > > updated due to recalibration compared to what we currently have.
> > >
> > > please wait a bit with creating the cpp template, create_iwave.py
> needs some maintenance
> > >
> > > Markus M
> > >
> > >
> > >
> > > >
> > > > markusN
> > > > ___
> > > > grass-user mailing list
> > > > grass-user@lists.osgeo.org
> > > > https://lists.osgeo.org/mailman/listinfo/grass-user
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Markus Metz
On Tue, Jan 23, 2018 at 2:19 PM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:
>
> OK, will give it a try.
>
The first part is more important because it 1) fixes the interpolation to
2.5 nm steps, and 2) helps iwave.cpp to load the response values.
>
> For the second part I am not sure if I properly understood where min –
max wavelength for each band should be printed to.
>
> Do you mean to replace
>
> # convert limits from nanometers to micrometers
>
> lowerlimit = wavelengths[0]/1000
>
> upperlimit = wavelengths[-1]/1000
>
>
>
> Or just as a screen output?

Just a screen output to help update the manual
>
> You did not mean band value limits, right?

No, e.g. in the manual is

Sentinel2A Coastal blue band B1 (430nm - 457nm)

and this range could be printed out to screen based on the actual response.
This range can then be copied to the manual, making life a bit easier for
the person updating the manual.
>
> Not sure I am of help/useful for fixing create_iwave.py, but I`ll do my
best…

Your help is welcome!

Markus M

>
> Cheers
>
> Stefan
>
>
>
>
>
> From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
> Sent: tirsdag 23. januar 2018 13.02
> To: Stefan Blumentrath <stefan.blumentr...@nina.no>
> Cc: Markus Neteler <nete...@osgeo.org>; GRASS user list <
grass-user@lists.osgeo.org>
>
>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
>
>
> On Tue, Jan 23, 2018 at 12:25 PM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:
> >
> > No problem. Any chance I can contribute to maintenance of
create_iwave.py?
> >
> > What needs to be done? Take your latest changes into account?
>
> nodata handling should be changed. In read_input(), missing values should
be set to zero. Then for each band, leading and trailing zeros would be set
to -1. This helps interpolate_band() to get the correct subrange.
>
> For each band, create_iwave.py should print out the band name and the
wavelength as min - max. Care must be taken when finding reasonable min and
max wavelengths: find the max response, then go back while response >
threshold to find the min wavelength. Go forward while response > threshold
to find the max wavelength. As threshold I suggest 0.1 to eliminate noise
in the response values.
>
> Markus M
>
> >
> >
> >
> > If you think it makes sense I will try to create a patch for adding S2B
to i.atcorr (would be a nice exercise and does not seem too complex)? Will
open a ticket and start working on it unless you tell me different.
> >
> >
> >
> > Cheers
> >
> > Stefan
> >
> >
> >
> >
> >
> >
> >
> > From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf
Of Markus Metz
> > Sent: tirsdag 23. januar 2018 12.03
> > To: Markus Neteler <nete...@osgeo.org>
> > Cc: GRASS user list <grass-user@lists.osgeo.org>
> > Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> >
> >
> >
> >
> >
> > On Tue, Jan 23, 2018 at 11:51 AM, Markus Neteler <
> > nete...@osgeo.org> wrote:
> >
> > >
> > > On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová
> > > <
> > zoficimbur...@gmail.com> wrote:
> >
> > > > Forgot to cc the list.
> > > >
> > > > The CSV and the cpp template:
> > > >
> >
https://www.dropbox.com/sh/9cnhsl59kvmx4o1/AABwnEVHdxfW_PqrB5Xcpczda?dl=0
> >
> > >
> > > Great! Would you mind to also convert the S2A table? AFAIK it got
> > > updated due to recalibration compared to what we currently have.
> >
> > please wait a bit with creating the cpp template, create_iwave.py needs
some maintenance
> >
> > Markus M
> >
> >
> >
> > >
> > > markusN
> > > ___
> > > grass-user mailing list
> > > grass-user@lists.osgeo.org
> > > https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Stefan Blumentrath
OK, will give it a try.

For the second part I am not sure if I properly understood where min – max 
wavelength for each band should be printed to.
Do you mean to replace
# convert limits from nanometers to micrometers
lowerlimit = wavelengths[0]/1000
upperlimit = wavelengths[-1]/1000

Or just as a screen output?

You did not mean band value limits, right?

Not sure I am of help/useful for fixing create_iwave.py, but I`ll do my best…

Cheers
Stefan


From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
Sent: tirsdag 23. januar 2018 13.02
To: Stefan Blumentrath <stefan.blumentr...@nina.no>
Cc: Markus Neteler <nete...@osgeo.org>; GRASS user list 
<grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2



On Tue, Jan 23, 2018 at 12:25 PM, Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>> wrote:
>
> No problem. Any chance I can contribute to maintenance of create_iwave.py?
>
> What needs to be done? Take your latest changes into account?
nodata handling should be changed. In read_input(), missing values should be 
set to zero. Then for each band, leading and trailing zeros would be set to -1. 
This helps interpolate_band() to get the correct subrange.
For each band, create_iwave.py should print out the band name and the 
wavelength as min - max. Care must be taken when finding reasonable min and max 
wavelengths: find the max response, then go back while response > threshold to 
find the min wavelength. Go forward while response > threshold to find the max 
wavelength. As threshold I suggest 0.1 to eliminate noise in the response 
values.
Markus M
>
>
>
> If you think it makes sense I will try to create a patch for adding S2B to 
> i.atcorr (would be a nice exercise and does not seem too complex)? Will open 
> a ticket and start working on it unless you tell me different.
>
>
>
> Cheers
>
> Stefan
>
>
>
>
>
>
>
> From: grass-user 
> [mailto:grass-user-boun...@lists.osgeo.org<mailto:grass-user-boun...@lists.osgeo.org>]
>  On Behalf Of Markus Metz
> Sent: tirsdag 23. januar 2018 12.03
> To: Markus Neteler <nete...@osgeo.org<mailto:nete...@osgeo.org>>
> Cc: GRASS user list 
> <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
>
>
> On Tue, Jan 23, 2018 at 11:51 AM, Markus Neteler <
> nete...@osgeo.org<mailto:nete...@osgeo.org>> wrote:
>
> >
> > On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová
> > <
> zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>> wrote:
>
> > > Forgot to cc the list.
> > >
> > > The CSV and the cpp template:
> > >
> https://www.dropbox.com/sh/9cnhsl59kvmx4o1/AABwnEVHdxfW_PqrB5Xcpczda?dl=0
>
> >
> > Great! Would you mind to also convert the S2A table? AFAIK it got
> > updated due to recalibration compared to what we currently have.
>
> please wait a bit with creating the cpp template, create_iwave.py needs some 
> maintenance
>
> Markus M
>
>
>
> >
> > markusN
> > ___
> > grass-user mailing list
> > grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
> > https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Markus Metz
On Tue, Jan 23, 2018 at 12:25 PM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:
>
> No problem. Any chance I can contribute to maintenance of create_iwave.py?
>
> What needs to be done? Take your latest changes into account?

nodata handling should be changed. In read_input(), missing values should
be set to zero. Then for each band, leading and trailing zeros would be set
to -1. This helps interpolate_band() to get the correct subrange.

For each band, create_iwave.py should print out the band name and the
wavelength as min - max. Care must be taken when finding reasonable min and
max wavelengths: find the max response, then go back while response >
threshold to find the min wavelength. Go forward while response > threshold
to find the max wavelength. As threshold I suggest 0.1 to eliminate noise
in the response values.

Markus M
>
>
>
> If you think it makes sense I will try to create a patch for adding S2B
to i.atcorr (would be a nice exercise and does not seem too complex)? Will
open a ticket and start working on it unless you tell me different.
>
>
>
> Cheers
>
> Stefan
>
>
>
>
>
>
>
> From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of
Markus Metz
> Sent: tirsdag 23. januar 2018 12.03
> To: Markus Neteler <nete...@osgeo.org>
> Cc: GRASS user list <grass-user@lists.osgeo.org>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
>
>
> On Tue, Jan 23, 2018 at 11:51 AM, Markus Neteler <
> nete...@osgeo.org> wrote:
>
> >
> > On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová
> > <
> zoficimbur...@gmail.com> wrote:
>
> > > Forgot to cc the list.
> > >
> > > The CSV and the cpp template:
> > >
> https://www.dropbox.com/sh/9cnhsl59kvmx4o1/AABwnEVHdxfW_PqrB5Xcpczda?dl=0
>
> >
> > Great! Would you mind to also convert the S2A table? AFAIK it got
> > updated due to recalibration compared to what we currently have.
>
> please wait a bit with creating the cpp template, create_iwave.py needs
some maintenance
>
> Markus M
>
>
>
> >
> > markusN
> > ___
> > grass-user mailing list
> > grass-user@lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Stefan Blumentrath
No problem. Any chance I can contribute to maintenance of create_iwave.py?

What needs to be done? Take your latest changes into account?



If you think it makes sense I will try to create a patch for adding S2B to 
i.atcorr (would be a nice exercise and does not seem too complex)? Will open a 
ticket and start working on it unless you tell me different.



Cheers

Stefan





From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Markus Metz
Sent: tirsdag 23. januar 2018 12.03
To: Markus Neteler <nete...@osgeo.org>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2



On Tue, Jan 23, 2018 at 11:51 AM, Markus Neteler 
<nete...@osgeo.org<mailto:nete...@osgeo.org>> wrote:
>
> On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová
> <zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>> wrote:
> > Forgot to cc the list.
> >
> > The CSV and the cpp template:
> > https://www.dropbox.com/sh/9cnhsl59kvmx4o1/AABwnEVHdxfW_PqrB5Xcpczda?dl=0
>
> Great! Would you mind to also convert the S2A table? AFAIK it got
> updated due to recalibration compared to what we currently have.
please wait a bit with creating the cpp template, create_iwave.py needs some 
maintenance
Markus M

>
> markusN
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Stefan Blumentrath
OK. Will do so once maintenance for create_iwave.py is done!

-Original Message-
From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Markus Neteler
Sent: tirsdag 23. januar 2018 11.51
To: Žofie Cimburová <zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová <zoficimbur...@gmail.com> 
wrote:
> Forgot to cc the list.
>
> The CSV and the cpp template:
> https://www.dropbox.com/sh/9cnhsl59kvmx4o1/AABwnEVHdxfW_PqrB5Xcpczda?d
> l=0

Great! Would you mind to also convert the S2A table? AFAIK it got updated due 
to recalibration compared to what we currently have.

markusN
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Markus Metz
On Tue, Jan 23, 2018 at 11:51 AM, Markus Neteler  wrote:
>
> On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová
>  wrote:
> > Forgot to cc the list.
> >
> > The CSV and the cpp template:
> >
https://www.dropbox.com/sh/9cnhsl59kvmx4o1/AABwnEVHdxfW_PqrB5Xcpczda?dl=0
>
> Great! Would you mind to also convert the S2A table? AFAIK it got
> updated due to recalibration compared to what we currently have.

please wait a bit with creating the cpp template, create_iwave.py needs
some maintenance

Markus M

>
> markusN
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Markus Neteler
On Tue, Jan 23, 2018 at 11:09 AM, Žofie Cimburová
 wrote:
> Forgot to cc the list.
>
> The CSV and the cpp template:
> https://www.dropbox.com/sh/9cnhsl59kvmx4o1/AABwnEVHdxfW_PqrB5Xcpczda?dl=0

Great! Would you mind to also convert the S2A table? AFAIK it got
updated due to recalibration compared to what we currently have.

markusN
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Stefan Blumentrath
Great! Thanks, we will have a look at it!

Cheers
Stefan

From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Markus Metz
Sent: tirsdag 23. januar 2018 09.41
To: Markus Neteler <nete...@osgeo.org>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2



On Tue, Jan 23, 2018 at 9:27 AM, Markus Neteler 
<nete...@osgeo.org<mailto:nete...@osgeo.org>> wrote:
>
> On Tue, Jan 23, 2018 at 8:31 AM, Žofie Cimburová
> <zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>> wrote:
> ...
> > There is one more thing I am not sure about - can the geometrical conditions
> > parameter and sensor bands parameter used for Sentinel2-A (i.e. 25 and
> > 166-178) be used for Sentinel2-B as well?
>
> No, we have to implement the Sentinel-2B curves as well. They are
> available from the ESA site.
Latest response curves for 2A and 2B:
https://sentinels.copernicus.eu/documents/247904/685211/S2-SRF_COPE-GSEG-EOPG-TN-15-0007_3.0.xlsx

Markus M

> Maybe a user could already convert them
> to CSV? Then adding them is relatively simple through the
> imagery/i.atcorr/create_iwave.py script which generates the C++ code
> snippets.
>
> markusN
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-23 Thread Markus Neteler
On Tue, Jan 23, 2018 at 8:31 AM, Žofie Cimburová
 wrote:
...
> There is one more thing I am not sure about - can the geometrical conditions
> parameter and sensor bands parameter used for Sentinel2-A (i.e. 25 and
> 166-178) be used for Sentinel2-B as well?

No, we have to implement the Sentinel-2B curves as well. They are
available from the ESA site. Maybe a user could already convert them
to CSV? Then adding them is relatively simple through the
imagery/i.atcorr/create_iwave.py script which generates the C++ code
snippets.

markusN
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-22 Thread Žofie Cimburová
On Mon, Jan 22, 2018 at 3:17 PM, Markus Metz <markus.metz.gisw...@gmail.com>
wrote:

>
>
> On Mon, Jan 22, 2018 at 1:01 PM, Žofie Cimburová <zoficimbur...@gmail.com>
> wrote:
> >
> > Dear list,
> > I came across another strange behaviour in i.atcorr used for Sentinel 2A
> data - for most of the scenes I process, the output of i.atcorr (for each
> band) is correct (i.e. contains values), but for several scenes, the output
> (for each band) contains just -nans. I thought this is caused by the input
> scenes, but apparently, it is rather caused by the date (line 2, first two
> numbers) in the 6s file. Some days in the 6s file lead to a correct result,
> other days in the 6s file lead to -nans.
> >
> > Example:
> > date in 6s file = 08 16
> > i.atcorr input=S2A_20160816.B02 range=0,1 elevation=dem_10m
> parameters=param_6s_20160816.txt output=S2A_20160816.B02_atcorr1
> > -> only -nans in output map
>
> I get values in the output with Debian testing and G7.4 with latest
> i.atcorr r72101. Please update your GRASS version.
>

Yes, in the latest version the problem doesn't occur. Thanks for testing
Markus M!

There is one more thing I am not sure about - can the geometrical
conditions parameter and sensor bands parameter used for Sentinel2-A (i.e.
25 and 166-178) be used for Sentinel2-B as well?

Thanks,
Zofie


>
BTW, the 6s file has 166 as band number which is band 1, but the example
> seems to be band 2 -> should be 167 in the 6s file.
>
> Markus M
>
>
> >
> > date in 6s file = 09 05
> > i.atcorr input=S2A_20160816.B02 range=0,1 elevation=dem_10m
> parameters=param_6s_20160905.txt output=S2A_20160816.B02_atcorr2
> > -> values in output map
> >
> > date in 6s file = 08 16
> > i.atcorr input=S2A_20160905.B02 range=0,1 elevation=dem_10m
> parameters=param_6s_20160816.txt output=S2A_20160905.B02_atcorr3
> > -> only -nans in output map
> >
> > date in 6s file = 09 05
> > i.atcorr input=S2A_20160905.B02 range=0,1 elevation=dem_10m
> parameters=param_6s_20160905.txt output=S2A_20160905.B02_atcorr4
> > -> values in output map
> >
> > Version:
> > g.version -g
> > version=7.4.0svn
> > date=2017
> > revision=r71960M
> > build_date=2017-12-22
> > build_platform=x86_64-pc-linux-gnu
> > build_off_t_size=8
> >
> > I checked the verbose module output, and the only difference is
> (obviously) in solar zenith angle, solar azimuth angle, view zenith angle
> etc., but these values look correct in all cases.
> >
> > Could this be caused by numerical instability as in the previous
> problem? The data (two scenes, DEM and two 6s files) can be downloaded from
> here, it would be great if someone could check whether the issue occurs as
> well.
> > https://www.dropbox.com/sh/ntg46stpjhxyqov/AADVBHVHHI_
> ap1W32kqesaHna?dl=0
> >
> >
> > Thanks a lot.
> > Zofie
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Jan 8, 2018 at 9:01 AM, Stefan Blumentrath <
> stefan.blumentr...@nina.no> wrote:
> >>
> >> Hi,
> >>
> >>
> >>
> >> This is how you can patch i.atcorr and compile into home dir.:
> >>
> >>
> >>
> >> svn checkout https://svn.osgeo.org/grass/grass/branches/releasebranch_
> 7_4 grass_74
> >>
> >> cd grass_74
> >>
> >> wget https://trac.osgeo.org/grass/raw-attachment/ticket/3469/i_
> atcorr_double.patch
> >>
> >> patch -p0 -i i_atcorr_double.patch
> >>
> >> CFLAGS=”-g -Wall -Wextra -Wpedantic -Wshadow -Wno-sign-compare
> -fno-common -fexceptions -Werror=implicit-function-declaration
> -Wp,-D_FORTIFY_SOURCE=2 -O3 -fno-fast-math” CXXFLAGS=”-g -Wall -Wextra
> -Wpedantic -Wshadow -Wno-sign-compare -fno-common -fexceptions
> -Werror=implicit-function-declaration -Wp,-D_FORTIFY_SOURCE=2 -O3
> -fno-fast-math” ./configure --with-cxx --with-sqlite --with-postgres
> --with-postgres-includes=/usr/include/postgresql --with-odbc --with-cairo
> --with-proj-share=/usr/local/share/proj 
> --with-tcltk-includes=/usr/include/tcl8.4/
> --with-freetype --with-freetype-includes=/usr/include/freetype2
> --with-fftw --with-nls --with-python --with-tiff --with-geos
> --enable-largefile --with-readline --with-blas --with-glw --with-motif
> --with-openmp --with-wxwidgets --with-liblas --with-netcdf --with-lapack
> --with-mysql-includes=/usr/include/mysql --with-mysql --with-opencl
> --with-pdal --with-bzlib –prefix=~/
> >>
> >> make –j 20
> >>
> >> make install
> >>
> >&

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-22 Thread Markus Metz
On Mon, Jan 22, 2018 at 1:01 PM, Žofie Cimburová <zoficimbur...@gmail.com>
wrote:
>
> Dear list,
> I came across another strange behaviour in i.atcorr used for Sentinel 2A
data - for most of the scenes I process, the output of i.atcorr (for each
band) is correct (i.e. contains values), but for several scenes, the output
(for each band) contains just -nans. I thought this is caused by the input
scenes, but apparently, it is rather caused by the date (line 2, first two
numbers) in the 6s file. Some days in the 6s file lead to a correct result,
other days in the 6s file lead to -nans.
>
> Example:
> date in 6s file = 08 16
> i.atcorr input=S2A_20160816.B02 range=0,1 elevation=dem_10m
parameters=param_6s_20160816.txt output=S2A_20160816.B02_atcorr1
> -> only -nans in output map

I get values in the output with Debian testing and G7.4 with latest
i.atcorr r72101. Please update your GRASS version.

BTW, the 6s file has 166 as band number which is band 1, but the example
seems to be band 2 -> should be 167 in the 6s file.

Markus M

>
> date in 6s file = 09 05
> i.atcorr input=S2A_20160816.B02 range=0,1 elevation=dem_10m
parameters=param_6s_20160905.txt output=S2A_20160816.B02_atcorr2
> -> values in output map
>
> date in 6s file = 08 16
> i.atcorr input=S2A_20160905.B02 range=0,1 elevation=dem_10m
parameters=param_6s_20160816.txt output=S2A_20160905.B02_atcorr3
> -> only -nans in output map
>
> date in 6s file = 09 05
> i.atcorr input=S2A_20160905.B02 range=0,1 elevation=dem_10m
parameters=param_6s_20160905.txt output=S2A_20160905.B02_atcorr4
> -> values in output map
>
> Version:
> g.version -g
> version=7.4.0svn
> date=2017
> revision=r71960M
> build_date=2017-12-22
> build_platform=x86_64-pc-linux-gnu
> build_off_t_size=8
>
> I checked the verbose module output, and the only difference is
(obviously) in solar zenith angle, solar azimuth angle, view zenith angle
etc., but these values look correct in all cases.
>
> Could this be caused by numerical instability as in the previous problem?
The data (two scenes, DEM and two 6s files) can be downloaded from here, it
would be great if someone could check whether the issue occurs as well.
> https://www.dropbox.com/sh/ntg46stpjhxyqov/AADVBHVHHI_ap1W32kqesaHna?dl=0
>
>
> Thanks a lot.
> Zofie
>
>
>
>
>
>
>
>
>
>
> On Mon, Jan 8, 2018 at 9:01 AM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:
>>
>> Hi,
>>
>>
>>
>> This is how you can patch i.atcorr and compile into home dir.:
>>
>>
>>
>> svn checkout https://svn.osgeo.org/grass/grass/branches/releasebranch_7_4
grass_74
>>
>> cd grass_74
>>
>> wget
https://trac.osgeo.org/grass/raw-attachment/ticket/3469/i_atcorr_double.patch
>>
>> patch -p0 -i i_atcorr_double.patch
>>
>> CFLAGS=”-g -Wall -Wextra -Wpedantic -Wshadow -Wno-sign-compare
-fno-common -fexceptions -Werror=implicit-function-declaration
-Wp,-D_FORTIFY_SOURCE=2 -O3 -fno-fast-math” CXXFLAGS=”-g -Wall -Wextra
-Wpedantic -Wshadow -Wno-sign-compare -fno-common -fexceptions
-Werror=implicit-function-declaration -Wp,-D_FORTIFY_SOURCE=2 -O3
-fno-fast-math” ./configure --with-cxx --with-sqlite --with-postgres
--with-postgres-includes=/usr/include/postgresql --with-odbc --with-cairo
--with-proj-share=/usr/local/share/proj
--with-tcltk-includes=/usr/include/tcl8.4/ --with-freetype
--with-freetype-includes=/usr/include/freetype2 --with-fftw --with-nls
--with-python --with-tiff --with-geos --enable-largefile --with-readline
--with-blas --with-glw --with-motif --with-openmp --with-wxwidgets
--with-liblas --with-netcdf --with-lapack
--with-mysql-includes=/usr/include/mysql --with-mysql --with-opencl
--with-pdal --with-bzlib –prefix=~/
>>
>> make –j 20
>>
>> make install
>>
>>
>>
>> Cheers
>>
>> Stefan
>>
>>
>>
>> From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf
Of Žofie Cimburová
>> Sent: mandag 18. desember 2017 16.14
>> To: Moritz Lennert <mlenn...@club.worldonline.be>
>> Cc: GRASS user list <grass-user@lists.osgeo.org>
>> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>>
>>
>>
>> Dear Moritz,
>>
>>
>>
>> According to
https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types
, the L1C product I am using already is in top of atmosphere reflectance,
so this should not be the problem (?).
>>
>> I tried running i.atcorr both with and without the -r flag.
>>
>>
>>
>> Zofie
>>
>>
>>
>> On Mon, Dec 18, 2017 at 3:35 PM, Moritz Lennert <
mlenn...@club.worldonline.be> wrote:
>>
>> On 18/12/17 13:1

Re: [GRASS-user] i.atcorr with Sentinel2

2018-01-22 Thread Žofie Cimburová
Dear list,
I came across another strange behaviour in i.atcorr used for Sentinel 2A
data - for most of the scenes I process, the output of i.atcorr (for each
band) is correct (i.e. contains values), but for several scenes, the output
(for each band) contains just -nans. I thought this is caused by the input
scenes, but apparently, it is rather caused by the date (line 2, first two
numbers) in the 6s file. Some days in the 6s file lead to a correct result,
other days in the 6s file lead to -nans.

Example:
date in 6s file = 08 16
i.atcorr input=S2A_20160816.B02 range=0,1 elevation=dem_10m
parameters=param_6s_20160816.txt output=S2A_20160816.B02_atcorr1
-> only -nans in output map

date in 6s file = 09 05
i.atcorr input=S2A_20160816.B02 range=0,1 elevation=dem_10m
parameters=param_6s_20160905.txt output=S2A_20160816.B02_atcorr2
-> values in output map

date in 6s file = 08 16
i.atcorr input=S2A_20160905.B02 range=0,1 elevation=dem_10m
parameters=param_6s_20160816.txt output=S2A_20160905.B02_atcorr3
-> only -nans in output map

date in 6s file = 09 05
i.atcorr input=S2A_20160905.B02 range=0,1 elevation=dem_10m
parameters=param_6s_20160905.txt output=S2A_20160905.B02_atcorr4
-> values in output map

Version:
g.version -g
version=7.4.0svn
date=2017
revision=r71960M
build_date=2017-12-22
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8

I checked the verbose module output, and the only difference is (obviously)
in solar zenith angle, solar azimuth angle, view zenith angle etc., but
these values look correct in all cases.

Could this be caused by numerical instability as in the previous problem?
The data (two scenes, DEM and two 6s files) can be downloaded from here, it
would be great if someone could check whether the issue occurs as well.
https://www.dropbox.com/sh/ntg46stpjhxyqov/AADVBHVHHI_ap1W32kqesaHna?dl=0


Thanks a lot.
Zofie










On Mon, Jan 8, 2018 at 9:01 AM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:

> Hi,
>
>
>
> This is how you can patch i.atcorr and compile into home dir.:
>
>
>
> svn checkout https://svn.osgeo.org/grass/grass/branches/releasebranch_7_4
> grass_74
>
> cd grass_74
>
> wget https://trac.osgeo.org/grass/raw-attachment/ticket/3469/i_
> atcorr_double.patch
>
> patch -p0 -i i_atcorr_double.patch
>
> CFLAGS=”-g -Wall -Wextra -Wpedantic -Wshadow -Wno-sign-compare -fno-common
> -fexceptions -Werror=implicit-function-declaration
> -Wp,-D_FORTIFY_SOURCE=2 -O3 -fno-fast-math” CXXFLAGS=”-g -Wall -Wextra
> -Wpedantic -Wshadow -Wno-sign-compare -fno-common -fexceptions
> -Werror=implicit-function-declaration -Wp,-D_FORTIFY_SOURCE=2 -O3
> -fno-fast-math” ./configure --with-cxx --with-sqlite --with-postgres
> --with-postgres-includes=/usr/include/postgresql --with-odbc --with-cairo
> --with-proj-share=/usr/local/share/proj 
> --with-tcltk-includes=/usr/include/tcl8.4/
> --with-freetype --with-freetype-includes=/usr/include/freetype2
> --with-fftw --with-nls --with-python --with-tiff --with-geos
> --enable-largefile --with-readline --with-blas --with-glw --with-motif
> --with-openmp --with-wxwidgets --with-liblas --with-netcdf --with-lapack
> --with-mysql-includes=/usr/include/mysql --with-mysql --with-opencl
> --with-pdal --with-bzlib –prefix=~/
>
> make –j 20
>
> make install
>
>
>
> Cheers
>
> Stefan
>
>
>
> *From:* grass-user [mailto:grass-user-boun...@lists.osgeo.org] *On Behalf
> Of *Žofie Cimburová
> *Sent:* mandag 18. desember 2017 16.14
> *To:* Moritz Lennert <mlenn...@club.worldonline.be>
> *Cc:* GRASS user list <grass-user@lists.osgeo.org>
> *Subject:* Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> Dear Moritz,
>
>
>
> According to https://earth.esa.int/web/sentinel/user-guides/sentinel-
> 2-msi/product-types , the L1C product I am using already is in top of
> atmosphere reflectance, so this should not be the problem (?).
>
> I tried running i.atcorr both with and without the -r flag.
>
>
>
> Zofie
>
>
>
> On Mon, Dec 18, 2017 at 3:35 PM, Moritz Lennert <
> mlenn...@club.worldonline.be> wrote:
>
> On 18/12/17 13:14, Žofie Cimburová wrote:
>
> Hi all,
> Now the 6S parameters are complete, but the output map contains only
> NULLs, no matter what combinations of input parameters and flags I use.
> Have anyone encountered the same issue? (Info below.)
>
>
> In the i.atcorr man page it says:
>
> "If flag -r is used, the input raster data are treated as reflectance.
> Otherwise, the input raster data are treated as radiance values"
>
> IIUC, your data is still in DN. You might want to try to transform this
> into radiance values before sending it into i.atcorr.
>
> Moritz
>
>
> Thanks again.
> Zofie
>
> ---

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-21 Thread Sajid Pareeth
>
>
>
> On Thu, Dec 21, 2017 at 8:18 AM, Stefan Blumentrath <
> stefan.blumentr...@nina.no> wrote:
> >
> > Thanks Markus,
> >
> > As a next try I updated my gcc and g++ to 5.4.1 (on Ubuntu 14.04) and I
> applied your compiler flags, Markus.
> > Unfortunately, I still get only NULL cells in i.atcorr output…
> >
> > Will try to test more recent OS (Ubuntu 16) and maybe get a Fedora live
> system…
>
> i.atcorr should produce identical results on all supported systems. These
> differences are a mystery to me. For a start, compiler warnings could be
> solved and the valgrind warnings need to be checked.
>


To confirm, I am getting identical results in Ubuntu (both grass74 and 75)
as obtained in Fedora, with the same command Markus used.


*i.atcorr in=s2a_b8 range=1,28001 elevation=dem parameters=p6s.txt
out=s2a_b8_corr_g75*
*r.info  -r s2a_b8_corr_g75*
*min=0.003232*
*max=255*

*r.info  -r s2a_b8_corr_g74*
*min=0.003232*
*max=255*

Sajid
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-21 Thread Markus Metz
On Thu, Dec 21, 2017 at 8:18 AM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:
>
> Thanks Markus,
>
> As a next try I updated my gcc and g++ to 5.4.1 (on Ubuntu 14.04) and I
applied your compiler flags, Markus.
> Unfortunately, I still get only NULL cells in i.atcorr output…
>
> Will try to test more recent OS (Ubuntu 16) and maybe get a Fedora live
system…

i.atcorr should produce identical results on all supported systems. These
differences are a mystery to me. For a start, compiler warnings could be
solved and the valgrind warnings need to be checked.

Markus M

>
> Cheers
> Stefan
>
> From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
> Sent: onsdag 20. desember 2017 22.52
> To: Moritz Lennert <mlenn...@club.worldonline.be>
> Cc: Stefan Blumentrath <stefan.blumentr...@nina.no>; Sajid Pareeth <
spare...@gmail.com>; GRASS user list <grass-user@lists.osgeo.org>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
> Adding to the confusion. I used
>
> On Wed, Dec 20, 2017 at 5:41 PM, Moritz Lennert <
mlenn...@club.worldonline.be<mailto:mlenn...@club.worldonline.be>> wrote:
> >
> > On 19/12/17 15:24, Stefan Blumentrath wrote:
> >>
> >>
> >> In case someone would be willing to test my data (which I would be
very grateful for), you can get it directly here:
> >>
> >> dem: http://www.filedropper.com/dem_1
> >>
> >> S2 band 8:
http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t044118r008v20160905t10402220160905t104245b08
> >>
> >> 62 params: http://www.filedropper.com/p6s
> with latest 7.4 and 7.5, command is
>
> i.atcorr in=b08 range=1,28001 elevation=dem parameters=p6s.txt
out=b08_atcorr
>
> and I get reasonable results:
>
> r.info<http://r.info> -r b08_atcorr_g74
> min=0.003231863
> max=255
>
> r.info<http://r.info> -r b08_atcorr_g75
> min=0.003231863
> max=255
> my OS is Fedora 27 with compiler gcc (GCC) 7.2.1 20170915 (Red Hat
7.2.1-2)
> relevant compiler flags are
> -g -Wall -Wextra -Wpedantic -Wshadow -Wno-sign-compare -fno-common
-fexceptions -Werror=implicit-function-declaration -Wp,-D_FORTIFY_SOURCE=2
-O3 -fno-fast-math
>
> -fno-fast-math might be important
>
> running i.atcorr through valgrind, I get lots of warnings like
>
> ==14080== Conditional jump or move depends on uninitialised value(s)
> ==14080==at 0x42B18D: os(float, float, float, float, float, float (&)
[51][49], Gauss&, Altitude const&, GeomCond const&) (computations.cpp:831)
> ==14080==by 0x42E9E3: atmref(float, float, float, float, float,
OpticalAtmosProperties&, Gauss&, GeomCond const&, AerosolModel const&,
Altitude const&) (computations.cpp:1408)
> ==14080==by 0x42FCBC: discom(GeomCond const&, AtmosModel const&,
AerosolModel const&, AerosolConcentration const&, Altitude const&, IWave
const&) (computations.cpp:1654)
> ==14080==by 0x40C032: init_6S(char*) (6s.cpp:100)
> ==14080==by 0x405A3C: main (main.cpp:618)
> ...
> later on
>
> ==14080== Conditional jump or move depends on uninitialised value(s)
> ==14080==at 0x42DED8: iso(float, float, float, float, float, float
(&) [3], Gauss&, Altitude const&) (computations.cpp:1262)
> ==14080==by 0x42F011: scatra(float, float, float, float, float,
OpticalAtmosProperties&, Gauss&, GeomCond const&, Altitude const&)
(computations.cpp:1578)
> ==14080==by 0x42FD08: discom(GeomCond const&, AtmosModel const&,
AerosolModel const&, AerosolConcentration const&, Altitude const&, IWave
const&) (computations.cpp:1659)
> ==14080==by 0x406882: pre_compute_h(float) (6s.cpp:148)
> ==14080==by 0x406372: process_raster (main.cpp:369)
> ==14080==by 0x406372: main (main.cpp:632)
> ...
> IMHO, these valgrind warnings need to be investigated.
> Markus M
>
> >>
> >
> > Just a very quick test, in 7.4 RC1, using
> >
> > i.atcorr in=b08 range=1,28001 elevation=dem
parameters=BROL/STEFAN/p6s.txt out=b08_atcorr
> >
> > gives
> >
> > r.info<http://r.info> -r b08_atcorr
> > min=-nan
> > max=-nan
> >
> > So I can confirm that there seems to be a problem.
> > Don't have much time to do more testing.
> >
> > A bug report with example data would probably be warranted.
> >
> > Moritz
> >
> > ___
> > grass-user mailing list
> > grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
> > https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-21 Thread Stefan Blumentrath
For completness:
https://trac.osgeo.org/grass/ticket/3469

-Original Message-
From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Stefan Blumentrath
Sent: torsdag 21. desember 2017 08.18
To: Markus Metz <markus.metz.gisw...@gmail.com>; Moritz Lennert 
<mlenn...@club.worldonline.be>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

Thanks Markus,

As a next try I updated my gcc and g++ to 5.4.1 (on Ubuntu 14.04) and I applied 
your compiler flags, Markus.
Unfortunately, I still get only NULL cells in i.atcorr output…

Will try to test more recent OS (Ubuntu 16) and maybe get a Fedora live system…

Cheers
Stefan

From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
Sent: onsdag 20. desember 2017 22.52
To: Moritz Lennert <mlenn...@club.worldonline.be>
Cc: Stefan Blumentrath <stefan.blumentr...@nina.no>; Sajid Pareeth 
<spare...@gmail.com>; GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

Adding to the confusion. I used

On Wed, Dec 20, 2017 at 5:41 PM, Moritz Lennert 
<mlenn...@club.worldonline.be<mailto:mlenn...@club.worldonline.be>> wrote:
>
> On 19/12/17 15:24, Stefan Blumentrath wrote:
>>
>>
>> In case someone would be willing to test my data (which I would be very 
>> grateful for), you can get it directly here:
>>
>> dem: http://www.filedropper.com/dem_1
>>
>> S2 band 8: 
>> http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t044118r008v20
>> 160905t10402220160905t104245b08
>>
>> 62 params: http://www.filedropper.com/p6s
with latest 7.4 and 7.5, command is

i.atcorr in=b08 range=1,28001 elevation=dem parameters=p6s.txt out=b08_atcorr

and I get reasonable results:

r.info<http://r.info> -r b08_atcorr_g74
min=0.003231863
max=255

r.info<http://r.info> -r b08_atcorr_g75
min=0.003231863
max=255
my OS is Fedora 27 with compiler gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2) 
relevant compiler flags are -g -Wall -Wextra -Wpedantic -Wshadow 
-Wno-sign-compare -fno-common -fexceptions 
-Werror=implicit-function-declaration -Wp,-D_FORTIFY_SOURCE=2 -O3 -fno-fast-math

-fno-fast-math might be important

running i.atcorr through valgrind, I get lots of warnings like

==14080== Conditional jump or move depends on uninitialised value(s)
==14080==at 0x42B18D: os(float, float, float, float, float, float (&) 
[51][49], Gauss&, Altitude const&, GeomCond const&) (computations.cpp:831)
==14080==by 0x42E9E3: atmref(float, float, float, float, float, 
OpticalAtmosProperties&, Gauss&, GeomCond const&, AerosolModel const&, Altitude 
const&) (computations.cpp:1408)
==14080==by 0x42FCBC: discom(GeomCond const&, AtmosModel const&, 
AerosolModel const&, AerosolConcentration const&, Altitude const&, IWave 
const&) (computations.cpp:1654)
==14080==by 0x40C032: init_6S(char*) (6s.cpp:100)
==14080==by 0x405A3C: main (main.cpp:618)
...
later on

==14080== Conditional jump or move depends on uninitialised value(s)
==14080==at 0x42DED8: iso(float, float, float, float, float, float (&) [3], 
Gauss&, Altitude const&) (computations.cpp:1262)
==14080==by 0x42F011: scatra(float, float, float, float, float, 
OpticalAtmosProperties&, Gauss&, GeomCond const&, Altitude const&) 
(computations.cpp:1578)
==14080==by 0x42FD08: discom(GeomCond const&, AtmosModel const&, 
AerosolModel const&, AerosolConcentration const&, Altitude const&, IWave 
const&) (computations.cpp:1659)
==14080==by 0x406882: pre_compute_h(float) (6s.cpp:148)
==14080==by 0x406372: process_raster (main.cpp:369)
==14080==by 0x406372: main (main.cpp:632)
...
IMHO, these valgrind warnings need to be investigated.
Markus M

>>
>
> Just a very quick test, in 7.4 RC1, using
>
> i.atcorr in=b08 range=1,28001 elevation=dem 
> parameters=BROL/STEFAN/p6s.txt out=b08_atcorr
>
> gives
>
> r.info<http://r.info> -r b08_atcorr
> min=-nan
> max=-nan
>
> So I can confirm that there seems to be a problem.
> Don't have much time to do more testing.
>
> A bug report with example data would probably be warranted.
>
> Moritz
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-20 Thread Stefan Blumentrath
Thanks Markus,

As a next try I updated my gcc and g++ to 5.4.1 (on Ubuntu 14.04) and I applied 
your compiler flags, Markus.
Unfortunately, I still get only NULL cells in i.atcorr output…

Will try to test more recent OS (Ubuntu 16) and maybe get a Fedora live system…

Cheers
Stefan

From: Markus Metz [mailto:markus.metz.gisw...@gmail.com]
Sent: onsdag 20. desember 2017 22.52
To: Moritz Lennert <mlenn...@club.worldonline.be>
Cc: Stefan Blumentrath <stefan.blumentr...@nina.no>; Sajid Pareeth 
<spare...@gmail.com>; GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

Adding to the confusion. I used

On Wed, Dec 20, 2017 at 5:41 PM, Moritz Lennert 
<mlenn...@club.worldonline.be<mailto:mlenn...@club.worldonline.be>> wrote:
>
> On 19/12/17 15:24, Stefan Blumentrath wrote:
>>
>>
>> In case someone would be willing to test my data (which I would be very 
>> grateful for), you can get it directly here:
>>
>> dem: http://www.filedropper.com/dem_1
>>
>> S2 band 8: 
>> http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t044118r008v20160905t10402220160905t104245b08
>>
>> 62 params: http://www.filedropper.com/p6s
with latest 7.4 and 7.5, command is

i.atcorr in=b08 range=1,28001 elevation=dem parameters=p6s.txt out=b08_atcorr

and I get reasonable results:

r.info<http://r.info> -r b08_atcorr_g74
min=0.003231863
max=255

r.info<http://r.info> -r b08_atcorr_g75
min=0.003231863
max=255
my OS is Fedora 27 with compiler gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
relevant compiler flags are
-g -Wall -Wextra -Wpedantic -Wshadow -Wno-sign-compare -fno-common -fexceptions 
-Werror=implicit-function-declaration -Wp,-D_FORTIFY_SOURCE=2 -O3 -fno-fast-math

-fno-fast-math might be important

running i.atcorr through valgrind, I get lots of warnings like

==14080== Conditional jump or move depends on uninitialised value(s)
==14080==at 0x42B18D: os(float, float, float, float, float, float (&) 
[51][49], Gauss&, Altitude const&, GeomCond const&) (computations.cpp:831)
==14080==by 0x42E9E3: atmref(float, float, float, float, float, 
OpticalAtmosProperties&, Gauss&, GeomCond const&, AerosolModel const&, Altitude 
const&) (computations.cpp:1408)
==14080==by 0x42FCBC: discom(GeomCond const&, AtmosModel const&, 
AerosolModel const&, AerosolConcentration const&, Altitude const&, IWave 
const&) (computations.cpp:1654)
==14080==by 0x40C032: init_6S(char*) (6s.cpp:100)
==14080==by 0x405A3C: main (main.cpp:618)
...
later on

==14080== Conditional jump or move depends on uninitialised value(s)
==14080==at 0x42DED8: iso(float, float, float, float, float, float (&) [3], 
Gauss&, Altitude const&) (computations.cpp:1262)
==14080==by 0x42F011: scatra(float, float, float, float, float, 
OpticalAtmosProperties&, Gauss&, GeomCond const&, Altitude const&) 
(computations.cpp:1578)
==14080==by 0x42FD08: discom(GeomCond const&, AtmosModel const&, 
AerosolModel const&, AerosolConcentration const&, Altitude const&, IWave 
const&) (computations.cpp:1659)
==14080==by 0x406882: pre_compute_h(float) (6s.cpp:148)
==14080==by 0x406372: process_raster (main.cpp:369)
==14080==by 0x406372: main (main.cpp:632)
...
IMHO, these valgrind warnings need to be investigated.
Markus M

>>
>
> Just a very quick test, in 7.4 RC1, using
>
> i.atcorr in=b08 range=1,28001 elevation=dem parameters=BROL/STEFAN/p6s.txt 
> out=b08_atcorr
>
> gives
>
> r.info<http://r.info> -r b08_atcorr
> min=-nan
> max=-nan
>
> So I can confirm that there seems to be a problem.
> Don't have much time to do more testing.
>
> A bug report with example data would probably be warranted.
>
> Moritz
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-20 Thread Markus Metz
Adding to the confusion. I used

On Wed, Dec 20, 2017 at 5:41 PM, Moritz Lennert <
mlenn...@club.worldonline.be> wrote:
>
> On 19/12/17 15:24, Stefan Blumentrath wrote:
>>
>>
>> In case someone would be willing to test my data (which I would be very
grateful for), you can get it directly here:
>>
>> dem: http://www.filedropper.com/dem_1
>>
>> S2 band 8:
http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t044118r008v20160905t10402220160905t104245b08
>>
>> 62 params: http://www.filedropper.com/p6s

with latest 7.4 and 7.5, command is

i.atcorr in=b08 range=1,28001 elevation=dem parameters=p6s.txt
out=b08_atcorr

and I get reasonable results:

r.info -r b08_atcorr_g74
min=0.003231863
max=255

r.info -r b08_atcorr_g75
min=0.003231863
max=255

my OS is Fedora 27 with compiler gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

relevant compiler flags are
-g -Wall -Wextra -Wpedantic -Wshadow -Wno-sign-compare -fno-common
-fexceptions -Werror=implicit-function-declaration -Wp,-D_FORTIFY_SOURCE=2
-O3 -fno-fast-math

-fno-fast-math might be important

running i.atcorr through valgrind, I get lots of warnings like

==14080== Conditional jump or move depends on uninitialised value(s)
==14080==at 0x42B18D: os(float, float, float, float, float, float (&)
[51][49], Gauss&, Altitude const&, GeomCond const&) (computations.cpp:831)
==14080==by 0x42E9E3: atmref(float, float, float, float, float,
OpticalAtmosProperties&, Gauss&, GeomCond const&, AerosolModel const&,
Altitude const&) (computations.cpp:1408)
==14080==by 0x42FCBC: discom(GeomCond const&, AtmosModel const&,
AerosolModel const&, AerosolConcentration const&, Altitude const&, IWave
const&) (computations.cpp:1654)
==14080==by 0x40C032: init_6S(char*) (6s.cpp:100)
==14080==by 0x405A3C: main (main.cpp:618)
...

later on

==14080== Conditional jump or move depends on uninitialised value(s)
==14080==at 0x42DED8: iso(float, float, float, float, float, float (&)
[3], Gauss&, Altitude const&) (computations.cpp:1262)
==14080==by 0x42F011: scatra(float, float, float, float, float,
OpticalAtmosProperties&, Gauss&, GeomCond const&, Altitude const&)
(computations.cpp:1578)
==14080==by 0x42FD08: discom(GeomCond const&, AtmosModel const&,
AerosolModel const&, AerosolConcentration const&, Altitude const&, IWave
const&) (computations.cpp:1659)
==14080==by 0x406882: pre_compute_h(float) (6s.cpp:148)
==14080==by 0x406372: process_raster (main.cpp:369)
==14080==by 0x406372: main (main.cpp:632)
...

IMHO, these valgrind warnings need to be investigated.

Markus M

>>
>
> Just a very quick test, in 7.4 RC1, using
>
> i.atcorr in=b08 range=1,28001 elevation=dem
parameters=BROL/STEFAN/p6s.txt out=b08_atcorr
>
> gives
>
> r.info -r b08_atcorr
> min=-nan
> max=-nan
>
> So I can confirm that there seems to be a problem.
> Don't have much time to do more testing.
>
> A bug report with example data would probably be warranted.
>
> Moritz
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-20 Thread Stefan Blumentrath
Thanks again, Sajid and Moritz!
I will try to compile on a newer OS and also file a ticket (I guess it is a 
packaging issue?)...
Cheers
Stefan
-Original Message-
From: Moritz Lennert [mailto:mlenn...@club.worldonline.be] 
Sent: onsdag 20. desember 2017 17.41
To: Stefan Blumentrath <stefan.blumentr...@nina.no>; Sajid Pareeth 
<spare...@gmail.com>
Cc: Žofie Cimburová <zoficimbur...@gmail.com>; GRASS user list 
<grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On 19/12/17 15:24, Stefan Blumentrath wrote:
> 
> In case someone would be willing to test my data (which I would be 
> very grateful for), you can get it directly here:
> 
> dem: http://www.filedropper.com/dem_1
> 
> S2 band 8: 
> http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t044118r008v201
> 60905t10402220160905t104245b08
> 
> 62 params: http://www.filedropper.com/p6s
> 

Just a very quick test, in 7.4 RC1, using

i.atcorr in=b08 range=1,28001 elevation=dem parameters=BROL/STEFAN/p6s.txt 
out=b08_atcorr

gives

r.info -r b08_atcorr
min=-nan
max=-nan

So I can confirm that there seems to be a problem.
Don't have much time to do more testing.

A bug report with example data would probably be warranted.

Moritz
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-20 Thread Moritz Lennert

On 19/12/17 15:24, Stefan Blumentrath wrote:


In case someone would be willing to test my data (which I would be very 
grateful for), you can get it directly here:


dem: http://www.filedropper.com/dem_1

S2 band 8: 
http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t044118r008v20160905t10402220160905t104245b08


62 params: http://www.filedropper.com/p6s



Just a very quick test, in 7.4 RC1, using

i.atcorr in=b08 range=1,28001 elevation=dem 
parameters=BROL/STEFAN/p6s.txt out=b08_atcorr


gives

r.info -r b08_atcorr
min=-nan
max=-nan

So I can confirm that there seems to be a problem.
Don't have much time to do more testing.

A bug report with example data would probably be warranted.

Moritz
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-20 Thread Markus Neteler
On Dec 20, 2017 3:31 PM, "Sajid Pareeth"  wrote:
...
>> GRASS 7.4.svn> i.atcorr -r input=s2a_b8 range=0,1 elevation=dem
parameters=p6s.txt output=s2a_b8_corr_2 rescale=0,1
>> WARNING: Request for unsupported compressor
>> WARNING: Request for unsupported compressor
>> Atmospheric correction...
>> ERROR: Request for unsupported compressor

Apparently the data got zstd compressed in 7.5.svn which isn't supported in
7.4.x. You need to switch the compression in 7.5 with r.compress.

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-20 Thread Sajid Pareeth
Hi Stefan

I tested your data in different versions.

Now, I compiled both GRASS 7.4 and 7.5 on Ubuntu 14.04 (gcc (Ubuntu
> 4.8.4-2ubuntu1~14.04.1) 4.8.4).
>

I get the same output (with numbers) for both compiled 7.4 and 7.5
in Ubuntu 16.04.3 LTS (gcc version 5.4.0 20160609 (Ubuntu
5.4.0-6ubuntu1~16.04.5)).


> To test a completely different system I also tested GRASS 7.5 (daily) and
> 7.4.0RC1 on OSGeo4W. Both fail as well.
>

I tried both daily and 7.4.0RC1 in windows 7, installed using OSGeo4W.
Here I get different results:

With GRASS GIS 7.5.svn (r71953), I get NULL output.

With GRASS GIS 7.4 RC1 (r71752), the i.atcorr process crashed with
following error:


>
>
>
> *GRASS 7.4.svn> i.atcorr -r input=s2a_b8 range=0,1 elevation=dem
> parameters=p6s.txt output=s2a_b8_corr_2 rescale=0,1WARNING: Request for
> unsupported compressorWARNING: Request for unsupported
> compressorAtmospheric correction...ERROR: Request for unsupported
> compressor*




> Sajid, which code revision are you using? Maybe a change somewhere else
> interferes?
>

In Ubuntu, I used r71952 (latest trunk).

Sajid
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Stefan Blumentrath
Thanks Markus for the hint, and many thanks Sajid for your continuous support!

Now, I compiled both GRASS 7.4 and 7.5 on Ubuntu 14.04 (gcc (Ubuntu 
4.8.4-2ubuntu1~14.04.1) 4.8.4).
I configured with the parameters Sajid sent and dropped all optimisation flags.
However, the result is still the same for both versions: Only NULL cells from 
i.atcorr with Sentinel-2

On my Ubuntu 16.04 box I only have a package-install from UbunutGIS 
experimental, which also fails.
To test a completely different system I also tested GRASS 7.5 (daily) and 
7.4.0RC1 on OSGeo4W. Both fail as well.

For completeness: I could not get Sajids data to work for me either.

Sajid, which code revision are you using? Maybe a change somewhere else 
interferes?
Or would you mind trying the release candidate?

Cheers
Stefan



-Original Message-
From: neteler.os...@gmail.com [mailto:neteler.os...@gmail.com] On Behalf Of 
Markus Neteler
Sent: tirsdag 19. desember 2017 20.38
To: Stefan Blumentrath <stefan.blumentr...@nina.no>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On Tue, Dec 19, 2017 at 4:58 PM, Stefan Blumentrath 
<stefan.blumentr...@nina.no> wrote:
[...]
> Given that the i.atcorr code did not change the last ½ year and given 
> that you succeeded with current trunk as well (also with my data), I 
> am afraid I have to conclude this is an issue of my local installation.
>
> Does anyone know if an underlying library can be causing trouble or 
> what parts of my setup I would have to look for?


How did you compile the version? Perhaps a compiler optimization is creating 
troubles?
Which operating system, which compiler, etc?

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Markus Neteler
On Tue, Dec 19, 2017 at 10:30 PM, Sajid Pareeth  wrote:
>> g.version
>> GRASS 7.2.2 (2017)
>> GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > cat p6s.txt
>> 25# originally 25
>>
>> 9 5 10.6728 10.73413 59.90647
>> 4
>> 3
>> 50
>> -0.055
>> -1000
>> 165# original 173
>> GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > i.atcorr --v -r --o
>> input=S2A.B08 elev=dem output=test_atcorr param=p6s.txt range=1,1
>> rescale=1,1
>> ERROR: Unsupported/unreadable format in control file (found igeom=25)

... ah, right, not in G72!

> I think support to sentinel 2A is not yet backported to GRASS 72 stable
> version.
> https://grass.osgeo.org/grass72/manuals/i.atcorr.html
>
> https://grass.osgeo.org/grass73/manuals/i.atcorr.html
> Markus, can you confirm?

Yes, confirmed. This is rolled out with 7.4.0:
https://trac.osgeo.org/grass/wiki/Release/7.4.0-News#Majormodulechanges

best,
Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Sajid Pareeth
>
> g.version
> GRASS 7.2.2 (2017)
> GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > cat p6s.txt
> 25# originally 25
>
> 9 5 10.6728 10.73413 59.90647
> 4
> 3
> 50
> -0.055
> -1000
> 165# original 173
> GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > i.atcorr --v -r --o
> input=S2A.B08 elev=dem output=test_atcorr param=p6s.txt range=1,1
> rescale=1,1
> ERROR: Unsupported/unreadable format in control file (found igeom=25)
>

I think support to sentinel 2A is not yet backported to GRASS 72 stable
version.
https://grass.osgeo.org/grass72/manuals/i.atcorr.html

https://grass.osgeo.org/grass73/manuals/i.atcorr.html
Markus, can you confirm?

Best
Sajid
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Stefan Blumentrath
Hi Micha,

Thanks for testing!
You would need either the release candidate for the upcoming version 7.4 or 
development version (7.5). GRASS 7.2 does not support Sentinel-2 in i.acorr…

Cheers
Stefan

From: Micha Silver [mailto:tsvi...@gmail.com]
Sent: tirsdag 19. desember 2017 21.58
To: Stefan Blumentrath <stefan.blumentr...@nina.no>; Sajid Pareeth 
<spare...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

Dear Stefan:
I also tried your data, and failed. Any values for the geom (first line in the 
6S parameters) above 24 cause this error:

GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > g.version
GRASS 7.2.2 (2017)
GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > cat p6s.txt
25# originally 25
9 5 10.6728 10.73413 59.90647
4
3
50
-0.055
-1000
165# original 173
GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > i.atcorr --v -r --o input=S2A.B08 
elev=dem output=test_atcorr param=p6s.txt range=1,1 rescale=1,1
ERROR: Unsupported/unreadable format in control file (found igeom=25)

If I put the igeom value at 24, and value for the wavelengthis above 164 (WV3 
in the i.atcorr manpage)  then the module segfaults.
??

Do I need a newer GRASS?

Best,
Micha

On 12/19/2017 04:24 PM, Stefan Blumentrath wrote:
Dear Sajid,

Thanks so much for your reply and confirming that the module works in principle!

Would you be able to provide me with the 1000 X 1000 clip of your data, so I 
can check if it is my installation?

I tried also two different boxes and GRASS versions (Ubunut 14.04 with GRASS 
7.3 and 7.4 compiled from source and Ubuntu 16.04 with GRASS 7.4 from 
UbuntuGIS) and none of it worked.
Also, altering the terrain model from floating point with negative values to 
integer without negative values did not change a thing…
I still get only NULL pixels…

In case someone would be willing to test my data (which I would be very 
grateful for), you can get it directly here:
dem: http://www.filedropper.com/dem_1
S2 band 8: 
http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t044118r008v20160905t10402220160905t104245b08
62 params: http://www.filedropper.com/p6s
I also have it on FTP and can share username and password offlist…

Cheers
Stefan

From: Sajid Pareeth [mailto:spare...@gmail.com]
Sent: tirsdag 19. desember 2017 12.51
To: Stefan Blumentrath 
<stefan.blumentr...@nina.no><mailto:stefan.blumentr...@nina.no>
Cc: Moritz Lennert 
<mlenn...@club.worldonline.be><mailto:mlenn...@club.worldonline.be>; Žofie 
Cimburová <zoficimbur...@gmail.com><mailto:zoficimbur...@gmail.com>; GRASS user 
list <grass-user@lists.osgeo.org><mailto:grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

To add, I have used the input as such with out applying the quantification 
value.

>>
>>  
>>  6s file:
>>  25- geometrical conditions=Sentinel-2A
>>  9 5 10.6728 10.73413 59.90647- month day hh.ddd longitude latitude
>>  4 - atmospheric model=subarctic summer
>>  3- aerosol model=urban
>>  50- visibility [km] (aerosol model concentration) (this is
>>  estimated, I also tried with AOD specified)
>>  -0.055- mean target elevation above sea level [km]
>>  -1000- sensor height
>>  166- Sentinel2A Blue band B2 (440nm - 535nm)

Just noticed, the last parameter should be 167 for Sentinel B2.

Sajid






___

grass-user mailing list

grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>

https://lists.osgeo.org/mailman/listinfo/grass-user



--

Micha Silver

Ben Gurion Univ.

Sde Boker, Remote Sensing Lab

cell: +972-523-665918
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Markus Neteler
On Tue, Dec 19, 2017 at 9:58 PM, Micha Silver  wrote:
> Dear Stefan:
> I also tried your data, and failed. Any values for the geom (first line in
> the 6S parameters) above 24 cause this error:

(there is a comment inside - likely not supported to have that in the
parameter file)

> GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > g.version
> GRASS 7.2.2 (2017)
> GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > cat p6s.txt
> 25# originally 25
> 9 5 10.6728 10.73413 59.90647
> 4
> 3
> 50
> -0.055
> -1000
> 165# original 173
> GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > i.atcorr --v -r --o input=S2A.B08
> elev=dem output=test_atcorr param=p6s.txt range=1,1 rescale=1,1
> ERROR: Unsupported/unreadable format in control file (found igeom=25)

... probably caused by the # comment? I'd put values only.

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Micha Silver

  
  
Dear Stefan:
I also tried your data, and failed. Any values for the geom (first
line in the 6S parameters) above 24 cause this error:

GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > g.version
GRASS 7.2.2 (2017)
GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > cat p6s.txt 
25    # originally 25
9 5 10.6728 10.73413 59.90647
4
3
50
-0.055
-1000
165    # original 173
GRASS 7.2.2 (SB):~/work/tmp/Blumentrath > i.atcorr --v
  -r --o input=S2A.B08 elev=dem output=test_atcorr param=p6s.txt
  range=1,1 rescale=1,1
ERROR: Unsupported/unreadable format in control file (found
  igeom=25)

If I put the igeom value at 24, and value for the wavelengthis above
164 (WV3 in the i.atcorr manpage)  then the module segfaults.
??

Do I need a newer GRASS?

Best,
Micha


On 12/19/2017 04:24 PM, Stefan
  Blumentrath wrote:


  
  
  
  
Dear Sajid,
 
Thanks so much for your reply and confirming
that the module works in principle!
 
Would you be able to provide me with the 1000 X
1000 clip of your data, so I can check if it is my
installation?
 
I tried also two different boxes and GRASS
versions (Ubunut 14.04 with GRASS 7.3 and 7.4 compiled from
source and Ubuntu 16.04 with GRASS 7.4 from UbuntuGIS) and
none of it worked.
Also, altering the terrain model from floating
point with negative values to integer without negative
values did not change a thing…
I still get only NULL pixels…
 
In case someone would be willing to test my
data (which I would be very grateful for), you can get it
directly here:
dem:
http://www.filedropper.com/dem_1
S2 band 8:
http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t044118r008v20160905t10402220160905t104245b08
62 params:
http://www.filedropper.com/p6s
I also have it on FTP and can share username
and password offlist…
 
Cheers
Stefan
 
From: Sajid Pareeth [mailto:spare...@gmail.com]

Sent: tirsdag 19. desember 2017 12.51
To: Stefan Blumentrath
<stefan.blumentr...@nina.no>
Cc: Moritz Lennert
<mlenn...@club.worldonline.be>; Žofie Cimburová
<zoficimbur...@gmail.com>; GRASS user list
<grass-user@lists.osgeo.org>
        Subject: Re: [GRASS-user] i.atcorr with Sentinel2
 

  
To add, I have used
the input as such with out applying the quantification
value. 
  
  
 

  

  

  

  

  >>
  >>         
  
  >>          6s file:
  >>          25- geometrical
  conditions=Sentinel-2A
  >>          9 5 10.6728 10.73413
  59.90647- month day hh.ddd longitude
  latitude
  >>          4 - atmospheric
  model=subarctic summer
  >>          3- aerosol
  model=urban
  >>          50- visibility [km]
  (aerosol model concentration) (this is
  >>          estimated, I also
  tried with AOD specified)
  >>          -0.055- mean target
  elevation above sea level [km]
  >>          -1000- sensor height
  >>          166- Sentinel2A Blue
  band B2 (440nm - 535nm)

  

  

  

  
  
 
  
  Just noticed, the
  last parameter should be 167

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Markus Neteler
On Tue, Dec 19, 2017 at 4:58 PM, Stefan Blumentrath
 wrote:
[...]
> Given that the i.atcorr code did not change the last ½ year and given that
> you succeeded with current trunk as well (also with my data), I am afraid I
> have to conclude this is an issue of my local installation.
>
> Does anyone know if an underlying library can be causing trouble or what
> parts of my setup I would have to look for?


How did you compile the version? Perhaps a compiler optimization is
creating troubles?
Which operating system, which compiler, etc?

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Sajid Pareeth
Hi

> but I get only NULL values also for those data and settings and when
> running i.atcorr in GRASS 7.4.0RC1.
>

That's strange !!!

> I stumbled over the following line in i.atcorr output (see full verbose
> output below):
>
> *view zenith angle: 0.00 deg  view azimuthal angle: 0.00
> deg   *
>
> Do you get that as well?
>

Yes, I am getting the same atmospheric model description.


> Sajid, can you send me the output of your
>
> grass75 --config
>
Here it is:

x86_64-pc-linux-gnu
> ./configure  --enable-largefile=yes --with-nls --with-cxx --with-readline
> --with-proj-share=/usr/share/proj --with-geos=/usr/bin/geos-config
> --with-python=yes --with-wxwidgets --with-cairo --with-fftw
> --with-opengl-libs=/usr/include/GL --with-freetype=yes
> --with-freetype-includes=/usr/include/freetype2/ --with-postgresql=yes
> --with-postgres-includes=/usr/include/postgresql --with-sqlite=yes
> --with-mysql=yes --with-mysql-includes=/usr/include/mysql
> gcc
> /usr/local/src/grass7_trunk/dist.x86_64-pc-linux-gnu
> 70829
> 7.5.svn
>

Hope it helps.

Sajid
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Stefan Blumentrath
osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

Hi




Would you be able to provide me with the 1000 X 1000 clip of your data, so I 
can check if it is my installation?

here it is, including the dem and parameters text file: (epsg:32632)

http://scientificpubs.com/data_share/sen2data.tar.gz


Sajid
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Sajid Pareeth
Hi


>>
>> Would you be able to provide me with the 1000 X 1000 clip of your data,
>> so I can check if it is my installation?
>>
>
here it is, including the dem and parameters text file: (epsg:32632)

http://scientificpubs.com/data_share/sen2data.tar.gz


Sajid
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Sajid Pareeth
Hi Stefan

I tried with your data, and it works for me.

Check the output here:
http://www.scientificpubs.com/data_share/s2a_b8_corr.tif.tar.gz

I am running it in Ubuntu 16.04, and GRASS latest trunk version, inside a
EPSG:25833 location.

I will send you the other clipped data from my study area, shortly.

Regards

Sajid


On Tue, Dec 19, 2017 at 3:31 PM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:

> Forgot to mention, my test data is tiny (< 3MB)…
>
>
>
> *From:* grass-user [mailto:grass-user-boun...@lists.osgeo.org] *On Behalf
> Of *Stefan Blumentrath
> *Sent:* tirsdag 19. desember 2017 15.24
> *To:* Sajid Pareeth <spare...@gmail.com>
> *Cc:* GRASS user list <grass-user@lists.osgeo.org>
>
> *Subject:* Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> Dear Sajid,
>
>
>
> Thanks so much for your reply and confirming that the module works in
> principle!
>
>
>
> Would you be able to provide me with the 1000 X 1000 clip of your data, so
> I can check if it is my installation?
>
>
>
> I tried also two different boxes and GRASS versions (Ubunut 14.04 with
> GRASS 7.3 and 7.4 compiled from source and Ubuntu 16.04 with GRASS 7.4 from
> UbuntuGIS) and none of it worked.
>
> Also, altering the terrain model from floating point with negative values
> to integer without negative values did not change a thing…
>
> I still get only NULL pixels…
>
>
>
> In case someone would be willing to test my data (which I would be very
> grateful for), you can get it directly here:
>
> dem: http://www.filedropper.com/dem_1
>
> S2 band 8: http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t0
> 44118r008v20160905t10402220160905t104245b08
>
> 62 params: http://www.filedropper.com/p6s
>
> I also have it on FTP and can share username and password offlist…
>
>
>
> Cheers
>
> Stefan
>
>
>
> *From:* Sajid Pareeth [mailto:spare...@gmail.com <spare...@gmail.com>]
> *Sent:* tirsdag 19. desember 2017 12.51
> *To:* Stefan Blumentrath <stefan.blumentr...@nina.no>
> *Cc:* Moritz Lennert <mlenn...@club.worldonline.be>; Žofie Cimburová <
> zoficimbur...@gmail.com>; GRASS user list <grass-user@lists.osgeo.org>
> *Subject:* Re: [GRASS-user] i.atcorr with Sentinel2
>
>
>
> To add, I have used the input as such with out applying the quantification
> value.
>
>
>
> >>
> >>  
> >>  6s file:
> >>  25- geometrical conditions=Sentinel-2A
> >>  9 5 10.6728 10.73413 59.90647- month day hh.ddd longitude
> latitude
> >>  4 - atmospheric model=subarctic summer
> >>  3- aerosol model=urban
> >>  50- visibility [km] (aerosol model concentration) (this is
> >>  estimated, I also tried with AOD specified)
> >>  -0.055- mean target elevation above sea level [km]
> >>  -1000- sensor height
> >>  166- Sentinel2A Blue band B2 (440nm - 535nm)
>
>
>
> Just noticed, the last parameter should be 167 for Sentinel B2.
>
>
>
> Sajid
>
>
>
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Stefan Blumentrath
Forgot to mention, my test data is tiny (< 3MB)…

From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Stefan Blumentrath
Sent: tirsdag 19. desember 2017 15.24
To: Sajid Pareeth <spare...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

Dear Sajid,

Thanks so much for your reply and confirming that the module works in principle!

Would you be able to provide me with the 1000 X 1000 clip of your data, so I 
can check if it is my installation?

I tried also two different boxes and GRASS versions (Ubunut 14.04 with GRASS 
7.3 and 7.4 compiled from source and Ubuntu 16.04 with GRASS 7.4 from 
UbuntuGIS) and none of it worked.
Also, altering the terrain model from floating point with negative values to 
integer without negative values did not change a thing…
I still get only NULL pixels…

In case someone would be willing to test my data (which I would be very 
grateful for), you can get it directly here:
dem: http://www.filedropper.com/dem_1
S2 band 8: 
http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t044118r008v20160905t10402220160905t104245b08
62 params: http://www.filedropper.com/p6s
I also have it on FTP and can share username and password offlist…

Cheers
Stefan

From: Sajid Pareeth [mailto:spare...@gmail.com]
Sent: tirsdag 19. desember 2017 12.51
To: Stefan Blumentrath 
<stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>
Cc: Moritz Lennert 
<mlenn...@club.worldonline.be<mailto:mlenn...@club.worldonline.be>>; Žofie 
Cimburová <zoficimbur...@gmail.com<mailto:zoficimbur...@gmail.com>>; GRASS user 
list <grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

To add, I have used the input as such with out applying the quantification 
value.

>>
>>  
>>  6s file:
>>  25- geometrical conditions=Sentinel-2A
>>  9 5 10.6728 10.73413 59.90647- month day hh.ddd longitude latitude
>>  4 - atmospheric model=subarctic summer
>>  3- aerosol model=urban
>>  50- visibility [km] (aerosol model concentration) (this is
>>  estimated, I also tried with AOD specified)
>>  -0.055- mean target elevation above sea level [km]
>>  -1000- sensor height
>>  166- Sentinel2A Blue band B2 (440nm - 535nm)

Just noticed, the last parameter should be 167 for Sentinel B2.

Sajid


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

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Stefan Blumentrath
Dear Sajid,

Thanks so much for your reply and confirming that the module works in principle!

Would you be able to provide me with the 1000 X 1000 clip of your data, so I 
can check if it is my installation?

I tried also two different boxes and GRASS versions (Ubunut 14.04 with GRASS 
7.3 and 7.4 compiled from source and Ubuntu 16.04 with GRASS 7.4 from 
UbuntuGIS) and none of it worked.
Also, altering the terrain model from floating point with negative values to 
integer without negative values did not change a thing…
I still get only NULL pixels…

In case someone would be willing to test my data (which I would be very 
grateful for), you can get it directly here:
dem: http://www.filedropper.com/dem_1
S2 band 8: 
http://www.filedropper.com/s2aoperprdmsil1cpdmc20160907t044118r008v20160905t10402220160905t104245b08
62 params: http://www.filedropper.com/p6s
I also have it on FTP and can share username and password offlist…

Cheers
Stefan

From: Sajid Pareeth [mailto:spare...@gmail.com]
Sent: tirsdag 19. desember 2017 12.51
To: Stefan Blumentrath <stefan.blumentr...@nina.no>
Cc: Moritz Lennert <mlenn...@club.worldonline.be>; Žofie Cimburová 
<zoficimbur...@gmail.com>; GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

To add, I have used the input as such with out applying the quantification 
value.

>>
>>  
>>  6s file:
>>  25- geometrical conditions=Sentinel-2A
>>  9 5 10.6728 10.73413 59.90647- month day hh.ddd longitude latitude
>>  4 - atmospheric model=subarctic summer
>>  3- aerosol model=urban
>>  50- visibility [km] (aerosol model concentration) (this is
>>  estimated, I also tried with AOD specified)
>>  -0.055- mean target elevation above sea level [km]
>>  -1000- sensor height
>>  166- Sentinel2A Blue band B2 (440nm - 535nm)

Just noticed, the last parameter should be 167 for Sentinel B2.

Sajid


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

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Sajid Pareeth
To add, I have used the input as such with out applying the quantification
value.

>>
>> >>  
>> >>  6s file:
>> >>  25- geometrical conditions=Sentinel-2A
>> >>  9 5 10.6728 10.73413 59.90647- month day hh.ddd longitude
>> latitude
>> >>  4 - atmospheric model=subarctic summer
>> >>  3- aerosol model=urban
>> >>  50- visibility [km] (aerosol model concentration) (this is
>> >>  estimated, I also tried with AOD specified)
>> >>  -0.055- mean target elevation above sea level [km]
>> >>  -1000- sensor height
>> >>  166- Sentinel2A Blue band B2 (440nm - 535nm)
>>
>
Just noticed, the last parameter should be 167 for Sentinel B2.

Sajid
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Sajid Pareeth
Dear Stefan

I have applied i.atcorr to many S2A scenes last year and it worked. Today I
rechecked them again, and it worked on a older svn version (7.3) and also
on the latest trunk version.

All the steps I have taken is similar to what you have done, so I dont
really know whats going wrong with you.

Here is the command I used:

i.atcorr -r input="S2A_OPER_MSI_L1C_TL_MTI_20151012T101024457Z_T32TPR_B02"
> range=0,1 elevation="eudem_euregio_utm32_10m"
> parameters="S2_B02_T32TPR.txt"
> output="S2A_OPER_MSI_L1C_TL_MTI_20151012T101024457Z_T32TPR_02_6S"
> rescale=0,1
>


S2_B02_T32TPR.txt:
[image: Inline image 1]


The AOD value is coming from the output of Sen2cor (It was a trial approach
!). I tried with a visibility value of 15 and it works.

And the ouput of r.univar is:

[image: Inline image 2]


I also tried it on a smaller clip (1000 X 1000), and it is giving some
output.

Let me know if you need any more info.

Regards

Sajid


On Tue, Dec 19, 2017 at 11:33 AM, Stefan Blumentrath <
stefan.blumentr...@nina.no> wrote:

> Hi again,
>
> Even with constant spectral conditions and values for filter function from
> Sentinel-2, all combinations of input band ranges result in empty maps.
> Constant spectral conditions and values for filter function from  Landsat7
> however, give results in the expected scale (0-255) regardless input image
> and value ranges...
>
> Shall I open a ticket?
>
> Any idea/chance to get this new feature in G7.4 to work...?
>
> Any pointer/help would be very much appreciated!
>
> Cheers
> Stefan
>
> -Original Message-
> From: Stefan Blumentrath
> Sent: tirsdag 19. desember 2017 10.56
> To: Stefan Blumentrath <stefan.blumentr...@nina.no>; Moritz Lennert <
> mlenn...@club.worldonline.be>; Žofie Cimburová <zoficimbur...@gmail.com>
> Cc: GRASS user list <grass-user@lists.osgeo.org>
> Subject: RE: [GRASS-user] i.atcorr with Sentinel2
>
> Hi again,
>
> Still trying to track down the issue...
> I now ran i.atcorr with constant spectral condition and manually defined
> "wl inf" and "wl sup".
>
> First I got those values for Sentinel-2 band 2:
> *spectral condition
>  *
> *--
>  *
> *sentinel2a blue b2
>  *
> *value of filter function :
>  *
> * wl inf=0.300 mic   wl sup=2.600 mic
> *
>
> Then for Landsat 7 band 4 (that was known to give results):
> *spectral condition
>  *
> *--
>  *
> *etm+ 4
>  *
> *value of filter function :
>  *
> * wl inf=0.740 mic   wl sup=0.913 mic
> *
>
>
> If I then feed those values into a filter function for constant spectral
> conditions, and again the Sentinel-2 values:
> *spectral condition
>  *
> *--
>  *
> *constant
>  *
> *value of filter function :
>  *
> * wl inf=0.300 mic   wl sup=2.600 mic
> *
> lead to empty maps, while Landsat7 values:
> *spectral condition
>  *
> *--
>  *
> *constant
>  *
> *value of filter function :
>  *
> * wl inf=0.740 mic   wl sup=0.913 mic
> *
> work fine (with all other settings being equal).
>
> That makes me suspect that the values of the Sentinel-2 filter function
> are actually causing the issue here...
> I am currently testing all thinkable combinations of input band ranges to
> see if any of them works with wl inf=0.300 mic and wl sup=2.600 mic and
> will report back from that exercise.
>
> Meanwhile, can anyone confirm that i.atcorr in GRASS 7.4.0RC1 actually
> works with Sentinel-2 data?
>
> Cheers
> Stefan
>
>
>
> -Original Message-
> From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of
> Stefan Blumentrath
> Sent: tirsdag 19. desember 2017 08.45
> To: Moritz Lennert <mlenn...@club.worldonline.be>; Žofie Cimburová <
> zoficimbur...@gmail.com>
> Cc: GRASS user list <grass-user@lists.osgeo.org>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>
> Hi again,
>
> A little update on the problem:
> Now I ran i.atcorr with all possible band values for Sentinel-2 in the 6s
> parameters (166-178) with input maps ranges scaled to 0-1, 0-255, 0-1
> All runs resulted in completely empty maps!
>

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Stefan Blumentrath
Hi again,

Even with constant spectral conditions and values for filter function from 
Sentinel-2, all combinations of input band ranges result in empty maps.
Constant spectral conditions and values for filter function from  Landsat7 
however, give results in the expected scale (0-255) regardless input image and 
value ranges...

Shall I open a ticket?

Any idea/chance to get this new feature in G7.4 to work...?

Any pointer/help would be very much appreciated!

Cheers
Stefan

-Original Message-
From: Stefan Blumentrath 
Sent: tirsdag 19. desember 2017 10.56
To: Stefan Blumentrath <stefan.blumentr...@nina.no>; Moritz Lennert 
<mlenn...@club.worldonline.be>; Žofie Cimburová <zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: RE: [GRASS-user] i.atcorr with Sentinel2

Hi again,

Still trying to track down the issue...
I now ran i.atcorr with constant spectral condition and manually defined "wl 
inf" and "wl sup".

First I got those values for Sentinel-2 band 2: 
*spectral condition 
*
*-- 
*
*sentinel2a blue b2 
*
*value of filter function : 
*
* wl inf=0.300 mic   wl sup=2.600 mic  *

Then for Landsat 7 band 4 (that was known to give results):
*spectral condition 
*
*-- 
*
*etm+ 4 
*
*value of filter function : 
*
* wl inf=0.740 mic   wl sup=0.913 mic  *


If I then feed those values into a filter function for constant spectral 
conditions, and again the Sentinel-2 values:
*spectral condition 
*
*-- 
*
*constant   
*
*value of filter function : 
*
* wl inf=0.300 mic   wl sup=2.600 mic  *
lead to empty maps, while Landsat7 values:
*spectral condition 
*
*-- 
*
*constant   
*
*value of filter function : 
*
* wl inf=0.740 mic   wl sup=0.913 mic  *
work fine (with all other settings being equal).

That makes me suspect that the values of the Sentinel-2 filter function are 
actually causing the issue here...
I am currently testing all thinkable combinations of input band ranges to see 
if any of them works with wl inf=0.300 mic and wl sup=2.600 mic and will report 
back from that exercise.

Meanwhile, can anyone confirm that i.atcorr in GRASS 7.4.0RC1 actually works 
with Sentinel-2 data?

Cheers
Stefan



-Original Message-
From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Stefan Blumentrath
Sent: tirsdag 19. desember 2017 08.45
To: Moritz Lennert <mlenn...@club.worldonline.be>; Žofie Cimburová 
<zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

Hi again,

A little update on the problem:
Now I ran i.atcorr with all possible band values for Sentinel-2 in the 6s 
parameters (166-178) with input maps ranges scaled to 0-1, 0-255, 0-1 All 
runs resulted in completely empty maps!
Any ideas?

Thanks for helping in advance!

Kind regards,
Stefan

-Original Message-
From: Moritz Lennert [mailto:mlenn...@club.worldonline.be]
Sent: mandag 18. desember 2017 16.58
To: Stefan Blumentrath <stefan.blumentr...@nina.no>; Žofie Cimburová 
<zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On 18/12/17 16:35, Stefan Blumentrath wrote:
> Hi Moritz,
> 
> Thanks for helping with troubleshooting!
> QUANTIFICATION_VALUE is 1, Thus dividing with it gives a maximum value of 
> 2.8...
> Any idea how to figure out if it is 12 or 16 bit image. It is directly 
> downloaded from ESA...

Check which proportion of the image is > 1. AFAIR (which is a bit limited), you 
might have reflectances above 1 in saturated pixels. I just checked on a random 
image and I also have some pixels above 1, but only 0.25% of the pixels:

GRASS 7.5.svn (UTM32N):/data/

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-19 Thread Stefan Blumentrath
Hi again,

Still trying to track down the issue...
I now ran i.atcorr with constant spectral condition and manually defined "wl 
inf" and "wl sup".

First I got those values for Sentinel-2 band 2: 
*spectral condition 
*
*-- 
*
*sentinel2a blue b2 
*
*value of filter function : 
*
* wl inf=0.300 mic   wl sup=2.600 mic  *

Then for Landsat 7 band 4 (that was known to give results):
*spectral condition 
*
*-- 
*
*etm+ 4 
*
*value of filter function : 
*
* wl inf=0.740 mic   wl sup=0.913 mic  *


If I then feed those values into a filter function for constant spectral 
conditions, and again the Sentinel-2 values:
*spectral condition 
*
*-- 
*
*constant   
*
*value of filter function : 
*
* wl inf=0.300 mic   wl sup=2.600 mic  *
lead to empty maps, while Landsat7 values:
*spectral condition 
*
*-- 
*
*constant   
*
*value of filter function : 
*
* wl inf=0.740 mic   wl sup=0.913 mic  *
work fine (with all other settings being equal).

That makes me suspect that the values of the Sentinel-2 filter function are 
actually causing the issue here...
I am currently testing all thinkable combinations of input band ranges to see 
if any of them works with wl inf=0.300 mic and wl sup=2.600 mic and will report 
back from that exercise.

Meanwhile, can anyone confirm that i.atcorr in GRASS 7.4.0RC1 actually works 
with Sentinel-2 data?

Cheers
Stefan



-Original Message-
From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Stefan Blumentrath
Sent: tirsdag 19. desember 2017 08.45
To: Moritz Lennert <mlenn...@club.worldonline.be>; Žofie Cimburová 
<zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

Hi again,

A little update on the problem:
Now I ran i.atcorr with all possible band values for Sentinel-2 in the 6s 
parameters (166-178) with input maps ranges scaled to 0-1, 0-255, 0-1 All 
runs resulted in completely empty maps!
Any ideas?

Thanks for helping in advance!

Kind regards,
Stefan

-Original Message-
From: Moritz Lennert [mailto:mlenn...@club.worldonline.be]
Sent: mandag 18. desember 2017 16.58
To: Stefan Blumentrath <stefan.blumentr...@nina.no>; Žofie Cimburová 
<zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On 18/12/17 16:35, Stefan Blumentrath wrote:
> Hi Moritz,
> 
> Thanks for helping with troubleshooting!
> QUANTIFICATION_VALUE is 1, Thus dividing with it gives a maximum value of 
> 2.8...
> Any idea how to figure out if it is 12 or 16 bit image. It is directly 
> downloaded from ESA...

Check which proportion of the image is > 1. AFAIR (which is a bit limited), you 
might have reflectances above 1 in saturated pixels. I just checked on a random 
image and I also have some pixels above 1, but only 0.25% of the pixels:

GRASS 7.5.svn (UTM32N):/data/home/mlennert > r.mapcalc "test = 
if(b04_refl>1,1,0)"
  100%
GRASS 7.5.svn (UTM32N):/data/home/mlennert > r.stats -cp test
  100%
0 120259106 99.75%
1 301294 0.25%

And all the pixels with value 1 are in clouded areas.

Moritz

> 
> Cheers
> Stefan
> 
> -Original Message-
> From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf 
> Of Moritz Lennert
> Sent: mandag 18. desember 2017 16.26
> To: Žofie Cimburová <zoficimbur...@gmail.com>
> Cc: GRASS user list <grass-user@lists.osgeo.org>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> 
> On 18/12/17 16:13, Žofie Cimburová wrote:
>> Dear Moritz,
>>
>> According to
>> https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product
>> - type

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-18 Thread Stefan Blumentrath
Hi again,

A little update on the problem:
Now I ran i.atcorr with all possible band values for Sentinel-2 in the 6s 
parameters (166-178) with input maps ranges scaled to 0-1, 0-255, 0-1
All runs resulted in completely empty maps!
Any ideas?

Thanks for helping in advance!

Kind regards,
Stefan

-Original Message-
From: Moritz Lennert [mailto:mlenn...@club.worldonline.be] 
Sent: mandag 18. desember 2017 16.58
To: Stefan Blumentrath <stefan.blumentr...@nina.no>; Žofie Cimburová 
<zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On 18/12/17 16:35, Stefan Blumentrath wrote:
> Hi Moritz,
> 
> Thanks for helping with troubleshooting!
> QUANTIFICATION_VALUE is 1, Thus dividing with it gives a maximum value of 
> 2.8...
> Any idea how to figure out if it is 12 or 16 bit image. It is directly 
> downloaded from ESA...

Check which proportion of the image is > 1. AFAIR (which is a bit limited), you 
might have reflectances above 1 in saturated pixels. I just checked on a random 
image and I also have some pixels above 1, but only 0.25% of the pixels:

GRASS 7.5.svn (UTM32N):/data/home/mlennert > r.mapcalc "test = 
if(b04_refl>1,1,0)"
  100%
GRASS 7.5.svn (UTM32N):/data/home/mlennert > r.stats -cp test
  100%
0 120259106 99.75%
1 301294 0.25%

And all the pixels with value 1 are in clouded areas.

Moritz

> 
> Cheers
> Stefan
> 
> -Original Message-
> From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf 
> Of Moritz Lennert
> Sent: mandag 18. desember 2017 16.26
> To: Žofie Cimburová <zoficimbur...@gmail.com>
> Cc: GRASS user list <grass-user@lists.osgeo.org>
> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
> 
> On 18/12/17 16:13, Žofie Cimburová wrote:
>> Dear Moritz,
>>
>> According to
>> https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product
>> - types , the L1C product I am using already is in top of atmosphere 
>> reflectance, so this should not be the problem (?).
>> I tried running i.atcorr both with and without the -r flag.
> 
> Reflectance is the percentage of light that is reflected either from 
> the top of the atmosphere or from the surface. Reflectance values 
> should thus be real values between 0 and 1. Your data have
> 
> Range of data:min = 1  max = 28000
> 
> This means that they are expressed in digital (integer) numbers. Try 
> transforming these DN into real numbers. IIRC, in the metadata, you have a 
> variable QUANTIFICATION_VALUE. Divide your pixel values by that value to get 
> real TOA reflectance values.
> 
> AFAIK, it also depends on whether you directly imported the original 12-bit 
> file, or possibly a modified, e.g. 16-bit, version.
> 
> Moritz
> 
>> On Mon, Dec 18, 2017 at 3:35 PM, Moritz Lennert 
>> <mlenn...@club.worldonline.be <mailto:mlenn...@club.worldonline.be>> wrote:
>>
>>  On 18/12/17 13:14, Žofie Cimburová wrote:
>>
>>  Hi all,
>>  Now the 6S parameters are complete, but the output map contains
>>  only NULLs, no matter what combinations of input parameters and
>>  flags I use. Have anyone encountered the same issue? (Info
>> below.)
>>
>>
>>  In the i.atcorr man page it says:
>>
>>  "If flag -r is used, the input raster data are treated as
>>  reflectance. Otherwise, the input raster data are treated as
>>  radiance values"
>>
>>  IIUC, your data is still in DN. You might want to try to transform
>>  this into radiance values before sending it into i.atcorr.
>>
>>  Moritz
>>
>>
>>  Thanks again.
>>  Zofie
>>
>>  
>>  Version:
>>  g.version -g
>>  version=7.4.0RC1
>>  date=2017
>>  revision=exported
>>  build_date=2017-11-18
>>  build_platform=x86_64-pc-linux-gnu
>>  build_off_t_size=8
>>
>>  
>>  Region:
>>  g.region -p
>>  projection: 1 (UTM)
>>  zone:       33
>>  datum:      etrs89
>>  ellipsoid:  grs80
>>  north:      6653695
>>  south:      6643685
>>  west:       256495
>>  east:       266505
>>  nsres:      10
>>  ewres:      10
>>  rows:       1001
>>  cols:       1001
>>  cells:      1002001
>>
>>  ---

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-18 Thread Stefan Blumentrath
Dear Moritz,

Thanks so much for your help with trouble shooting! Very much appreciated!
We now tried all possible combinations of options and I rescaled the input band 
to 0-1 range. All without success.
Result is always just NULL (or nan without -i flag) for S2A.

However, changing the 6s parameters to some random Landsat band configuration 
worked with the provided input data and produced (of course incorrect but) 
result with content.

Now I think I was able to narrow it down to the last line in the 6s parameters, 
the sensor band configuration. i.atcorr with our input data worked with sensor 
band defined as e.g. 64 (Landsat 7 band 4) but everything we tested >= 166 for 
band definition returned empty raster (checking now all systematically).

Seems others had similar problems:
http://permalink.gmane.org/gmane.comp.gis.grass.user/53078
But I was not able to find a solution in existing posts, unfortunately...

Any idea what else we could try?

Cheers
Stefan 

-Original Message-
From: Moritz Lennert [mailto:mlenn...@club.worldonline.be] 
Sent: mandag 18. desember 2017 17.06
To: Stefan Blumentrath <stefan.blumentr...@nina.no>; Žofie Cimburová 
<zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

See also discussion here: 
http://forum.step.esa.int/t/the-quantification-value-has-a-true-value-dn-to-toa-reflectance/1220/



On 18/12/17 16:57, Moritz Lennert wrote:
> On 18/12/17 16:35, Stefan Blumentrath wrote:
>> Hi Moritz,
>>
>> Thanks for helping with troubleshooting!
>> QUANTIFICATION_VALUE is 1, Thus dividing with it gives a maximum value 
>> of 2.8...
>> Any idea how to figure out if it is 12 or 16 bit image. It is directly 
>> downloaded from ESA...
> 
> Check which proportion of the image is > 1. AFAIR (which is a bit 
> limited), you might have reflectances above 1 in saturated pixels. I 
> just checked on a random image and I also have some pixels above 1, 
> but only 0.25% of the pixels:
> 
> GRASS 7.5.svn (UTM32N):/data/home/mlennert > r.mapcalc "test = 
> if(b04_refl>1,1,0)"
>100%
> GRASS 7.5.svn (UTM32N):/data/home/mlennert > r.stats -cp test
>100%
> 0 120259106 99.75%
> 1 301294 0.25%
> 
> And all the pixels with value 1 are in clouded areas.
> 
> Moritz
> 
>>
>> Cheers
>> Stefan
>>
>> -Original Message-
>> From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On 
>> Behalf Of Moritz Lennert
>> Sent: mandag 18. desember 2017 16.26
>> To: Žofie Cimburová <zoficimbur...@gmail.com>
>> Cc: GRASS user list <grass-user@lists.osgeo.org>
>> Subject: Re: [GRASS-user] i.atcorr with Sentinel2
>>
>> On 18/12/17 16:13, Žofie Cimburová wrote:
>>> Dear Moritz,
>>>
>>> According to
>>> https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/produc
>>> t- types , the L1C product I am using already is in top of 
>>> atmosphere reflectance, so this should not be the problem (?).
>>> I tried running i.atcorr both with and without the -r flag.
>>
>> Reflectance is the percentage of light that is reflected either from 
>> the top of the atmosphere or from the surface. Reflectance values 
>> should thus be real values between 0 and 1. Your data have
>>
>> Range of data:min = 1  max = 28000
>>
>> This means that they are expressed in digital (integer) numbers. Try 
>> transforming these DN into real numbers. IIRC, in the metadata, you have a 
>> variable QUANTIFICATION_VALUE. Divide your pixel values by that value to get 
>> real TOA reflectance values.
>>
>> AFAIK, it also depends on whether you directly imported the original 12-bit 
>> file, or possibly a modified, e.g. 16-bit, version.
>>
>> Moritz
>>
>>> On Mon, Dec 18, 2017 at 3:35 PM, Moritz Lennert 
>>> <mlenn...@club.worldonline.be <mailto:mlenn...@club.worldonline.be>> wrote:
>>>
>>>   On 18/12/17 13:14, Žofie Cimburová wrote:
>>>
>>>   Hi all,
>>>   Now the 6S parameters are complete, but the output map contains
>>>   only NULLs, no matter what combinations of input parameters and
>>>   flags I use. Have anyone encountered the same issue? (Info
>>> below.)
>>>
>>>
>>>   In the i.atcorr man page it says:
>>>
>>>   "If flag -r is used, the input raster data are treated as
>>>   reflectance. Otherwise, the input raster data are treated as
>>>   radiance values"
>>>
>>>   IIUC, your data 

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-18 Thread Moritz Lennert
See also discussion here: 
http://forum.step.esa.int/t/the-quantification-value-has-a-true-value-dn-to-toa-reflectance/1220/




On 18/12/17 16:57, Moritz Lennert wrote:

On 18/12/17 16:35, Stefan Blumentrath wrote:

Hi Moritz,

Thanks for helping with troubleshooting!
QUANTIFICATION_VALUE is 1, Thus dividing with it gives a maximum value of 
2.8...
Any idea how to figure out if it is 12 or 16 bit image. It is directly 
downloaded from ESA...


Check which proportion of the image is > 1. AFAIR (which is a bit
limited), you might have reflectances above 1 in saturated pixels. I
just checked on a random image and I also have some pixels above 1, but
only 0.25% of the pixels:

GRASS 7.5.svn (UTM32N):/data/home/mlennert > r.mapcalc "test =
if(b04_refl>1,1,0)"
   100%
GRASS 7.5.svn (UTM32N):/data/home/mlennert > r.stats -cp test
   100%
0 120259106 99.75%
1 301294 0.25%

And all the pixels with value 1 are in clouded areas.

Moritz



Cheers
Stefan

-Original Message-
From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Moritz Lennert
Sent: mandag 18. desember 2017 16.26
To: Žofie Cimburová <zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On 18/12/17 16:13, Žofie Cimburová wrote:

Dear Moritz,

According to
https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-
types , the L1C product I am using already is in top of atmosphere
reflectance, so this should not be the problem (?).
I tried running i.atcorr both with and without the -r flag.


Reflectance is the percentage of light that is reflected either from the top of 
the atmosphere or from the surface. Reflectance values should thus be real 
values between 0 and 1. Your data have

Range of data:min = 1  max = 28000

This means that they are expressed in digital (integer) numbers. Try 
transforming these DN into real numbers. IIRC, in the metadata, you have a 
variable QUANTIFICATION_VALUE. Divide your pixel values by that value to get 
real TOA reflectance values.

AFAIK, it also depends on whether you directly imported the original 12-bit 
file, or possibly a modified, e.g. 16-bit, version.

Moritz


On Mon, Dec 18, 2017 at 3:35 PM, Moritz Lennert
<mlenn...@club.worldonline.be <mailto:mlenn...@club.worldonline.be>> wrote:

  On 18/12/17 13:14, Žofie Cimburová wrote:

  Hi all,
  Now the 6S parameters are complete, but the output map contains
  only NULLs, no matter what combinations of input parameters and
  flags I use. Have anyone encountered the same issue? (Info
below.)


  In the i.atcorr man page it says:

  "If flag -r is used, the input raster data are treated as
  reflectance. Otherwise, the input raster data are treated as
  radiance values"

  IIUC, your data is still in DN. You might want to try to transform
  this into radiance values before sending it into i.atcorr.

  Moritz


  Thanks again.
  Zofie

  
  Version:
  g.version -g
  version=7.4.0RC1
  date=2017
  revision=exported
  build_date=2017-11-18
  build_platform=x86_64-pc-linux-gnu
  build_off_t_size=8

  
  Region:
  g.region -p
  projection: 1 (UTM)
  zone:       33
  datum:      etrs89
  ellipsoid:  grs80
  north:      6653695
  south:      6643685
  west:       256495
  east:       266505
  nsres:      10
  ewres:      10
  rows:       1001
  cols:       1001
  cells:      1002001

  
  Input data: Sentinel2 L1C product B02 (tried with B01 too)
  r.info <http://r.info> <http://r.info>
  map=test_B02@p_Sentinel4Nature_S2_Oslo
     
++
     | Map:      test_B02@p_Sentinel4Nat  Date: Wed Dec  6
  12:06:39 2017
     | Mapset:   p_Sentinel4Nature_S2_Oslo      Login of Creator:
  stefan.blumentr
     | Location: ETRS_33N
     | DataBase: /data/grass
     | Title:
  S2A_OPER_PRD_MSIL1C_PDMC_20160907T044118_R008_V20160905T104022_2
     | Timestamp: none
     
||
     |
     |   Type of Map:  raster               Number of Categories: 0
     |   Data Type:    CELL
     |   Rows:         1001
     |   Columns:      1001
     |   Total Cells:  1002001
     |        Projection: UTM (zone 33)
     |            N:    6653695    S:    6643685   Res:    10
     |          

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-18 Thread Moritz Lennert

On 18/12/17 16:35, Stefan Blumentrath wrote:

Hi Moritz,

Thanks for helping with troubleshooting!
QUANTIFICATION_VALUE is 1, Thus dividing with it gives a maximum value of 
2.8...
Any idea how to figure out if it is 12 or 16 bit image. It is directly 
downloaded from ESA...


Check which proportion of the image is > 1. AFAIR (which is a bit 
limited), you might have reflectances above 1 in saturated pixels. I 
just checked on a random image and I also have some pixels above 1, but 
only 0.25% of the pixels:


GRASS 7.5.svn (UTM32N):/data/home/mlennert > r.mapcalc "test = 
if(b04_refl>1,1,0)"

 100%
GRASS 7.5.svn (UTM32N):/data/home/mlennert > r.stats -cp test
 100%
0 120259106 99.75%
1 301294 0.25%

And all the pixels with value 1 are in clouded areas.

Moritz



Cheers
Stefan

-Original Message-
From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Moritz Lennert
Sent: mandag 18. desember 2017 16.26
To: Žofie Cimburová <zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On 18/12/17 16:13, Žofie Cimburová wrote:

Dear Moritz,

According to
https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-
types , the L1C product I am using already is in top of atmosphere
reflectance, so this should not be the problem (?).
I tried running i.atcorr both with and without the -r flag.


Reflectance is the percentage of light that is reflected either from the top of 
the atmosphere or from the surface. Reflectance values should thus be real 
values between 0 and 1. Your data have

Range of data:min = 1  max = 28000

This means that they are expressed in digital (integer) numbers. Try 
transforming these DN into real numbers. IIRC, in the metadata, you have a 
variable QUANTIFICATION_VALUE. Divide your pixel values by that value to get 
real TOA reflectance values.

AFAIK, it also depends on whether you directly imported the original 12-bit 
file, or possibly a modified, e.g. 16-bit, version.

Moritz


On Mon, Dec 18, 2017 at 3:35 PM, Moritz Lennert
<mlenn...@club.worldonline.be <mailto:mlenn...@club.worldonline.be>> wrote:

 On 18/12/17 13:14, Žofie Cimburová wrote:

 Hi all,
 Now the 6S parameters are complete, but the output map contains
 only NULLs, no matter what combinations of input parameters and
 flags I use. Have anyone encountered the same issue? (Info
below.)


 In the i.atcorr man page it says:

 "If flag -r is used, the input raster data are treated as
 reflectance. Otherwise, the input raster data are treated as
 radiance values"

 IIUC, your data is still in DN. You might want to try to transform
 this into radiance values before sending it into i.atcorr.

 Moritz


 Thanks again.
 Zofie

 
 Version:
 g.version -g
 version=7.4.0RC1
 date=2017
 revision=exported
 build_date=2017-11-18
 build_platform=x86_64-pc-linux-gnu
 build_off_t_size=8

 
 Region:
 g.region -p
 projection: 1 (UTM)
 zone:       33
 datum:      etrs89
 ellipsoid:  grs80
 north:      6653695
 south:      6643685
 west:       256495
 east:       266505
 nsres:      10
 ewres:      10
 rows:       1001
 cols:       1001
 cells:      1002001

 
 Input data: Sentinel2 L1C product B02 (tried with B01 too)
 r.info <http://r.info> <http://r.info>
 map=test_B02@p_Sentinel4Nature_S2_Oslo
    
++
    | Map:      test_B02@p_Sentinel4Nat  Date: Wed Dec  6
 12:06:39 2017
    | Mapset:   p_Sentinel4Nature_S2_Oslo      Login of Creator:
 stefan.blumentr
    | Location: ETRS_33N
    | DataBase: /data/grass
    | Title:
 S2A_OPER_PRD_MSIL1C_PDMC_20160907T044118_R008_V20160905T104022_2
    | Timestamp: none
    
||
    |
    |   Type of Map:  raster               Number of Categories: 0
    |   Data Type:    CELL
    |   Rows:         1001
    |   Columns:      1001
    |   Total Cells:  1002001
    |        Projection: UTM (zone 33)
    |            N:    6653695    S:    6643685   Res:    10
    |            E:     266505    W:     256495   Res:    10
    |   Range of data:    min = 1  max = 28000
    |
 

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-18 Thread Stefan Blumentrath
P. S. Neither does it help to divide by 1...

Von: grass-user [grass-user-boun...@lists.osgeo.org] im Auftrag von Stefan 
Blumentrath [stefan.blumentr...@nina.no]
Gesendet: Montag, 18. Dezember 2017 16:35
An: Moritz Lennert; Žofie Cimburová
Cc: GRASS user list
Betreff: Re: [GRASS-user] i.atcorr with Sentinel2

Hi Moritz,

Thanks for helping with troubleshooting!
QUANTIFICATION_VALUE is 1, Thus dividing with it gives a maximum value of 
2.8...
Any idea how to figure out if it is 12 or 16 bit image. It is directly 
downloaded from ESA...

Cheers
Stefan

-Original Message-
From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Moritz Lennert
Sent: mandag 18. desember 2017 16.26
To: Žofie Cimburová <zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On 18/12/17 16:13, Žofie Cimburová wrote:
> Dear Moritz,
>
> According to
> https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-
> types , the L1C product I am using already is in top of atmosphere
> reflectance, so this should not be the problem (?).
> I tried running i.atcorr both with and without the -r flag.

Reflectance is the percentage of light that is reflected either from the top of 
the atmosphere or from the surface. Reflectance values should thus be real 
values between 0 and 1. Your data have

Range of data:min = 1  max = 28000

This means that they are expressed in digital (integer) numbers. Try 
transforming these DN into real numbers. IIRC, in the metadata, you have a 
variable QUANTIFICATION_VALUE. Divide your pixel values by that value to get 
real TOA reflectance values.

AFAIK, it also depends on whether you directly imported the original 12-bit 
file, or possibly a modified, e.g. 16-bit, version.

Moritz

> On Mon, Dec 18, 2017 at 3:35 PM, Moritz Lennert
> <mlenn...@club.worldonline.be <mailto:mlenn...@club.worldonline.be>> wrote:
>
> On 18/12/17 13:14, Žofie Cimburová wrote:
>
> Hi all,
> Now the 6S parameters are complete, but the output map contains
> only NULLs, no matter what combinations of input parameters and
> flags I use. Have anyone encountered the same issue? (Info
> below.)
>
>
> In the i.atcorr man page it says:
>
> "If flag -r is used, the input raster data are treated as
> reflectance. Otherwise, the input raster data are treated as
> radiance values"
>
> IIUC, your data is still in DN. You might want to try to transform
> this into radiance values before sending it into i.atcorr.
>
> Moritz
>
>
> Thanks again.
> Zofie
>
> 
> Version:
> g.version -g
> version=7.4.0RC1
> date=2017
> revision=exported
> build_date=2017-11-18
> build_platform=x86_64-pc-linux-gnu
> build_off_t_size=8
>
> 
> Region:
> g.region -p
> projection: 1 (UTM)
> zone:   33
> datum:  etrs89
> ellipsoid:  grs80
> north:  6653695
> south:  6643685
> west:   256495
> east:   266505
> nsres:  10
> ewres:  10
> rows:   1001
> cols:   1001
> cells:  1002001
>
> 
> Input data: Sentinel2 L1C product B02 (tried with B01 too)
> r.info <http://r.info> <http://r.info>
> map=test_B02@p_Sentinel4Nature_S2_Oslo
>
> ++
>| Map:  test_B02@p_Sentinel4Nat  Date: Wed Dec  6
> 12:06:39 2017
>| Mapset:   p_Sentinel4Nature_S2_Oslo  Login of Creator:
> stefan.blumentr
>| Location: ETRS_33N
>| DataBase: /data/grass
>| Title:
> S2A_OPER_PRD_MSIL1C_PDMC_20160907T044118_R008_V20160905T104022_2
>| Timestamp: none
>
> ||
>|
>|   Type of Map:  raster   Number of Categories: 0
>|   Data Type:CELL
>|   Rows: 1001
>|   Columns:  1001
>|   Total Cells:  1002001
>|    Projection: UTM (zone 33)
>|    N:6653695S:6643685   Res:10
>|    E: 266505W: 256495   Res:10
>|   Range of data:

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-18 Thread Stefan Blumentrath
Hi Moritz,

Thanks for helping with troubleshooting!
QUANTIFICATION_VALUE is 1, Thus dividing with it gives a maximum value of 
2.8...
Any idea how to figure out if it is 12 or 16 bit image. It is directly 
downloaded from ESA...

Cheers
Stefan

-Original Message-
From: grass-user [mailto:grass-user-boun...@lists.osgeo.org] On Behalf Of 
Moritz Lennert
Sent: mandag 18. desember 2017 16.26
To: Žofie Cimburová <zoficimbur...@gmail.com>
Cc: GRASS user list <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] i.atcorr with Sentinel2

On 18/12/17 16:13, Žofie Cimburová wrote:
> Dear Moritz,
> 
> According to
> https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-
> types , the L1C product I am using already is in top of atmosphere 
> reflectance, so this should not be the problem (?).
> I tried running i.atcorr both with and without the -r flag.

Reflectance is the percentage of light that is reflected either from the top of 
the atmosphere or from the surface. Reflectance values should thus be real 
values between 0 and 1. Your data have

Range of data:min = 1  max = 28000

This means that they are expressed in digital (integer) numbers. Try 
transforming these DN into real numbers. IIRC, in the metadata, you have a 
variable QUANTIFICATION_VALUE. Divide your pixel values by that value to get 
real TOA reflectance values.

AFAIK, it also depends on whether you directly imported the original 12-bit 
file, or possibly a modified, e.g. 16-bit, version.

Moritz

> On Mon, Dec 18, 2017 at 3:35 PM, Moritz Lennert 
> <mlenn...@club.worldonline.be <mailto:mlenn...@club.worldonline.be>> wrote:
> 
> On 18/12/17 13:14, Žofie Cimburová wrote:
> 
> Hi all,
> Now the 6S parameters are complete, but the output map contains
> only NULLs, no matter what combinations of input parameters and
> flags I use. Have anyone encountered the same issue? (Info 
> below.)
> 
> 
> In the i.atcorr man page it says:
> 
> "If flag -r is used, the input raster data are treated as
> reflectance. Otherwise, the input raster data are treated as
> radiance values"
> 
> IIUC, your data is still in DN. You might want to try to transform
> this into radiance values before sending it into i.atcorr.
> 
> Moritz
> 
> 
> Thanks again.
> Zofie
> 
> 
> Version:
> g.version -g
> version=7.4.0RC1
> date=2017
> revision=exported
> build_date=2017-11-18
> build_platform=x86_64-pc-linux-gnu
> build_off_t_size=8
> 
> 
> Region:
> g.region -p
> projection: 1 (UTM)
> zone:       33
> datum:      etrs89
> ellipsoid:  grs80
> north:      6653695
> south:      6643685
> west:       256495
> east:       266505
> nsres:      10
> ewres:      10
> rows:       1001
> cols:       1001
> cells:      1002001
> 
> 
> Input data: Sentinel2 L1C product B02 (tried with B01 too)
> r.info <http://r.info> <http://r.info>
> map=test_B02@p_Sentinel4Nature_S2_Oslo
>    
> ++
>    | Map:      test_B02@p_Sentinel4Nat  Date: Wed Dec  6
> 12:06:39 2017
>    | Mapset:   p_Sentinel4Nature_S2_Oslo      Login of Creator:
> stefan.blumentr
>    | Location: ETRS_33N
>    | DataBase: /data/grass
>    | Title:   
> S2A_OPER_PRD_MSIL1C_PDMC_20160907T044118_R008_V20160905T104022_2
>    | Timestamp: none
>    
> ||
>    |
>    |   Type of Map:  raster               Number of Categories: 0
>    |   Data Type:    CELL
>    |   Rows:         1001
>    |   Columns:      1001
>    |   Total Cells:  1002001
>    |        Projection: UTM (zone 33)
>    |            N:    6653695    S:    6643685   Res:    10
>    |            E:     266505    W:     256495   Res:    10
>    |   Range of data:    min = 1  max = 28000
>    |
>    |   Data Description:
>    |    generated by r.in.gdal
>    
> +-
> ---+
> 
> 
> 6s file:
> 25- geomet

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-18 Thread Moritz Lennert

On 18/12/17 16:13, Žofie Cimburová wrote:

Dear Moritz,

According to 
https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types 
, the L1C product I am using already is in top of atmosphere 
reflectance, so this should not be the problem (?).

I tried running i.atcorr both with and without the -r flag.


Reflectance is the percentage of light that is reflected either from the 
top of the atmosphere or from the surface. Reflectance values should 
thus be real values between 0 and 1. Your data have


Range of data:min = 1  max = 28000

This means that they are expressed in digital (integer) numbers. Try 
transforming these DN into real numbers. IIRC, in the metadata, you have 
a variable QUANTIFICATION_VALUE. Divide your pixel values by that value 
to get real TOA reflectance values.


AFAIK, it also depends on whether you directly imported the original 
12-bit file, or possibly a modified, e.g. 16-bit, version.


Moritz

On Mon, Dec 18, 2017 at 3:35 PM, Moritz Lennert 
> wrote:


On 18/12/17 13:14, Žofie Cimburová wrote:

Hi all,
Now the 6S parameters are complete, but the output map contains
only NULLs, no matter what combinations of input parameters and
flags I use. Have anyone encountered the same issue? (Info below.)


In the i.atcorr man page it says:

"If flag -r is used, the input raster data are treated as
reflectance. Otherwise, the input raster data are treated as
radiance values"

IIUC, your data is still in DN. You might want to try to transform
this into radiance values before sending it into i.atcorr.

Moritz


Thanks again.
Zofie


Version:
g.version -g
version=7.4.0RC1
date=2017
revision=exported
build_date=2017-11-18
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8


Region:
g.region -p
projection: 1 (UTM)
zone:       33
datum:      etrs89
ellipsoid:  grs80
north:      6653695
south:      6643685
west:       256495
east:       266505
nsres:      10
ewres:      10
rows:       1001
cols:       1001
cells:      1002001


Input data: Sentinel2 L1C product B02 (tried with B01 too)
r.info  
map=test_B02@p_Sentinel4Nature_S2_Oslo
   
++
   | Map:      test_B02@p_Sentinel4Nat  Date: Wed Dec  6
12:06:39 2017
   | Mapset:   p_Sentinel4Nature_S2_Oslo      Login of Creator:
stefan.blumentr
   | Location: ETRS_33N
   | DataBase: /data/grass
   | Title:   
S2A_OPER_PRD_MSIL1C_PDMC_20160907T044118_R008_V20160905T104022_2

   | Timestamp: none
   
||
   |
   |   Type of Map:  raster               Number of Categories: 0
   |   Data Type:    CELL
   |   Rows:         1001
   |   Columns:      1001
   |   Total Cells:  1002001
   |        Projection: UTM (zone 33)
   |            N:    6653695    S:    6643685   Res:    10
   |            E:     266505    W:     256495   Res:    10
   |   Range of data:    min = 1  max = 28000
   |
   |   Data Description:
   |    generated by r.in.gdal
   
++


6s file:
25- geometrical conditions=Sentinel-2A
9 5 10.6728 10.73413 59.90647- month day hh.ddd longitude latitude
4 - atmospheric model=subarctic summer
3- aerosol model=urban
50- visibility [km] (aerosol model concentration) (this is
estimated, I also tried with AOD specified)
-0.055- mean target elevation above sea level [km]
-1000- sensor height
166- Sentinel2A Blue band B2 (440nm - 535nm)


Command:
i.atcorr input=test_B02@p_Sentinel4Nature_S2_Oslo range=1,28000
elevation=dem_10m_25833@p_Sentinel4Nature_S2_Oslo
parameters=/home/NINA.NO/zofie.cimburova/Sentinel4Nature/DATA/6s.txt

>
output=test_B02_atcorr
  >Atmospheric correction...
  >Atmospheric correction complete.

(I am not sure about the range 

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-18 Thread Žofie Cimburová
Dear Moritz,

According to
https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types
, the L1C product I am using already is in top of atmosphere reflectance,
so this should not be the problem (?).
I tried running i.atcorr both with and without the -r flag.

Zofie

On Mon, Dec 18, 2017 at 3:35 PM, Moritz Lennert <
mlenn...@club.worldonline.be> wrote:

> On 18/12/17 13:14, Žofie Cimburová wrote:
>
>> Hi all,
>> Now the 6S parameters are complete, but the output map contains only
>> NULLs, no matter what combinations of input parameters and flags I use.
>> Have anyone encountered the same issue? (Info below.)
>>
>
> In the i.atcorr man page it says:
>
> "If flag -r is used, the input raster data are treated as reflectance.
> Otherwise, the input raster data are treated as radiance values"
>
> IIUC, your data is still in DN. You might want to try to transform this
> into radiance values before sending it into i.atcorr.
>
> Moritz
>
>
>> Thanks again.
>> Zofie
>>
>> 
>> Version:
>> g.version -g
>> version=7.4.0RC1
>> date=2017
>> revision=exported
>> build_date=2017-11-18
>> build_platform=x86_64-pc-linux-gnu
>> build_off_t_size=8
>>
>> 
>> Region:
>> g.region -p
>> projection: 1 (UTM)
>> zone:   33
>> datum:  etrs89
>> ellipsoid:  grs80
>> north:  6653695
>> south:  6643685
>> west:   256495
>> east:   266505
>> nsres:  10
>> ewres:  10
>> rows:   1001
>> cols:   1001
>> cells:  1002001
>>
>> 
>> Input data: Sentinel2 L1C product B02 (tried with B01 too)
>> r.info  map=test_B02@p_Sentinel4Nature_S2_Oslo
>>   +-
>> ---+
>>   | Map:  test_B02@p_Sentinel4Nat  Date: Wed Dec  6 12:06:39 2017
>>   | Mapset:   p_Sentinel4Nature_S2_Oslo  Login of Creator:
>> stefan.blumentr
>>   | Location: ETRS_33N
>>   | DataBase: /data/grass
>>   | Title:S2A_OPER_PRD_MSIL1C_PDMC_20160
>> 907T044118_R008_V20160905T104022_2
>>   | Timestamp: none
>>   |-
>> ---|
>>   |
>>   |   Type of Map:  raster   Number of Categories: 0
>>   |   Data Type:CELL
>>   |   Rows: 1001
>>   |   Columns:  1001
>>   |   Total Cells:  1002001
>>   |Projection: UTM (zone 33)
>>   |N:6653695S:6643685   Res:10
>>   |E: 266505W: 256495   Res:10
>>   |   Range of data:min = 1  max = 28000
>>   |
>>   |   Data Description:
>>   |generated by r.in.gdal
>>   +-
>> ---+
>>
>> 
>> 6s file:
>> 25- geometrical conditions=Sentinel-2A
>> 9 5 10.6728 10.73413 59.90647- month day hh.ddd longitude latitude
>> 4 - atmospheric model=subarctic summer
>> 3- aerosol model=urban
>> 50- visibility [km] (aerosol model concentration) (this is estimated, I
>> also tried with AOD specified)
>> -0.055- mean target elevation above sea level [km]
>> -1000- sensor height
>> 166- Sentinel2A Blue band B2 (440nm - 535nm)
>>
>> 
>> Command:
>> i.atcorr input=test_B02@p_Sentinel4Nature_S2_Oslo range=1,28000
>> elevation=dem_10m_25833@p_Sentinel4Nature_S2_Oslo parameters=/home/
>> NINA.NO/zofie.cimburova/Sentinel4Nature/DATA/6s.txt <
>> http://NINA.NO/zofie.cimburova/Sentinel4Nature/DATA/6s.txt>
>> output=test_B02_atcorr
>>  >Atmospheric correction...
>>  >Atmospheric correction complete.
>>
>> (I am not sure about the range parameter, tried with 0,255 too. The DEM
>> contains no NULLs. Also tried running with -r and -a flags.)
>>
>> 
>> Output:
>> r.info  map=test_B02_atcorr@p_Sentinel4Nature_S2_Oslo
>>   +-
>> ---+
>>   | Map:  test_B02_atcorr@p_Sentinel4N  Date: Mon Dec 18 13:10:14
>> 2017
>>   | Mapset:   p_Sentinel4Nature_S2_Oslo  Login of Creator:
>> zofie.cimburova
>>   | Location: ETRS_33N
>>   | DataBase: /data/grass
>>   | Title:test_B02_atcorr2
>>   | Timestamp: none
>>   |-
>> ---|
>>   |
>>   |   Type of Map:  raster   Number of Categories: 0
>>   |   Data Type:FCELL
>>   |   Rows: 1001
>>   |   Columns:  1001
>>   |   Total Cells:  1002001
>>   |Projection: UTM (zone 33)
>>   |N:6653695S:6643685   Res:10
>>   |E: 266505W: 256495   Res:10
>>   |   Range of data:min = -nan  max = -nan
>>   |
>>   |   Data Description:
>>   |generated by i.atcorr
>>   |
>>   |   Comments:
>>   |i.atcorr input="test_B02@p_Sentinel4Nature_S2_Oslo" range=1,28\
>>   |000 

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-18 Thread Moritz Lennert

On 18/12/17 13:14, Žofie Cimburová wrote:

Hi all,
Now the 6S parameters are complete, but the output map contains only 
NULLs, no matter what combinations of input parameters and flags I use. 
Have anyone encountered the same issue? (Info below.)


In the i.atcorr man page it says:

"If flag -r is used, the input raster data are treated as reflectance. 
Otherwise, the input raster data are treated as radiance values"


IIUC, your data is still in DN. You might want to try to transform this 
into radiance values before sending it into i.atcorr.


Moritz



Thanks again.
Zofie


Version:
g.version -g
version=7.4.0RC1
date=2017
revision=exported
build_date=2017-11-18
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8


Region:
g.region -p
projection: 1 (UTM)
zone:       33
datum:      etrs89
ellipsoid:  grs80
north:      6653695
south:      6643685
west:       256495
east:       266505
nsres:      10
ewres:      10
rows:       1001
cols:       1001
cells:      1002001


Input data: Sentinel2 L1C product B02 (tried with B01 too)
r.info  map=test_B02@p_Sentinel4Nature_S2_Oslo
  ++
  | Map:      test_B02@p_Sentinel4Nat  Date: Wed Dec  6 12:06:39 2017
  | Mapset:   p_Sentinel4Nature_S2_Oslo      Login of Creator: 
stefan.blumentr

  | Location: ETRS_33N
  | DataBase: /data/grass
  | Title:
S2A_OPER_PRD_MSIL1C_PDMC_20160907T044118_R008_V20160905T104022_2

  | Timestamp: none
  ||
  |
  |   Type of Map:  raster               Number of Categories: 0
  |   Data Type:    CELL
  |   Rows:         1001
  |   Columns:      1001
  |   Total Cells:  1002001
  |        Projection: UTM (zone 33)
  |            N:    6653695    S:    6643685   Res:    10
  |            E:     266505    W:     256495   Res:    10
  |   Range of data:    min = 1  max = 28000
  |
  |   Data Description:
  |    generated by r.in.gdal
  ++


6s file:
25- geometrical conditions=Sentinel-2A
9 5 10.6728 10.73413 59.90647- month day hh.ddd longitude latitude
4 - atmospheric model=subarctic summer
3- aerosol model=urban
50- visibility [km] (aerosol model concentration) (this is estimated, I 
also tried with AOD specified)

-0.055- mean target elevation above sea level [km]
-1000- sensor height
166- Sentinel2A Blue band B2 (440nm - 535nm)


Command:
i.atcorr input=test_B02@p_Sentinel4Nature_S2_Oslo range=1,28000 
elevation=dem_10m_25833@p_Sentinel4Nature_S2_Oslo 
parameters=/home/NINA.NO/zofie.cimburova/Sentinel4Nature/DATA/6s.txt 
 
output=test_B02_atcorr

 >Atmospheric correction...
 >Atmospheric correction complete.

(I am not sure about the range parameter, tried with 0,255 too. The DEM 
contains no NULLs. Also tried running with -r and -a flags.)



Output:
r.info  map=test_B02_atcorr@p_Sentinel4Nature_S2_Oslo
  ++
  | Map:      test_B02_atcorr@p_Sentinel4N  Date: Mon Dec 18 13:10:14 2017
  | Mapset:   p_Sentinel4Nature_S2_Oslo      Login of Creator: 
zofie.cimburova

  | Location: ETRS_33N
  | DataBase: /data/grass
  | Title:    test_B02_atcorr2
  | Timestamp: none
  ||
  |
  |   Type of Map:  raster               Number of Categories: 0
  |   Data Type:    FCELL
  |   Rows:         1001
  |   Columns:      1001
  |   Total Cells:  1002001
  |        Projection: UTM (zone 33)
  |            N:    6653695    S:    6643685   Res:    10
  |            E:     266505    W:     256495   Res:    10
  |   Range of data:    min = -nan  max = -nan
  |
  |   Data Description:
  |    generated by i.atcorr
  |
  |   Comments:
  |    i.atcorr input="test_B02@p_Sentinel4Nature_S2_Oslo" range=1,28\
  |    000 elevation="dem_10m_25833@p_Sentinel4Nature_S2_Oslo" para\
  |    meters="/home/NINA.NO/zofie.cimburova/Sentinel4Nature/DATA/6s.txt 
" o\

  |    utput="test_B02_atcorr2" rescale=0,255
  |
  ++



On Fri, Dec 15, 2017 at 5:12 PM, Žofie Cimburová 
> wrote:


Dear Markus,
thanks for your reply, this is exactly what I need to know!

Best, Zofie

On Fri, Dec 15, 2017 at 5:09 PM, Markus Neteler > wrote:


On Dec 15, 2017 3:54 PM, "Žofie Cimburová"


Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-18 Thread Žofie Cimburová
Hi all,
Now the 6S parameters are complete, but the output map contains only NULLs,
no matter what combinations of input parameters and flags I use. Have
anyone encountered the same issue? (Info below.)

Thanks again.
Zofie


Version:
g.version -g
version=7.4.0RC1
date=2017
revision=exported
build_date=2017-11-18
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8


Region:
g.region -p

projection: 1 (UTM)
zone:   33
datum:  etrs89
ellipsoid:  grs80
north:  6653695
south:  6643685
west:   256495
east:   266505
nsres:  10
ewres:  10
rows:   1001
cols:   1001
cells:  1002001


Input data: Sentinel2 L1C product B02 (tried with B01 too)
r.info map=test_B02@p_Sentinel4Nature_S2_Oslo
 ++
 | Map:  test_B02@p_Sentinel4Nat  Date: Wed Dec  6 12:06:39 2017
 | Mapset:   p_Sentinel4Nature_S2_Oslo  Login of Creator:
stefan.blumentr
 | Location: ETRS_33N

 | DataBase: /data/grass

 | Title:
S2A_OPER_PRD_MSIL1C_PDMC_20160907T044118_R008_V20160905T104022_2
 | Timestamp: none

 ||
 |

 |   Type of Map:  raster   Number of Categories: 0

 |   Data Type:CELL

 |   Rows: 1001

 |   Columns:  1001

 |   Total Cells:  1002001

 |Projection: UTM (zone 33)

 |N:6653695S:6643685   Res:10

 |E: 266505W: 256495   Res:10

 |   Range of data:min = 1  max = 28000

 |

 |   Data Description:

 |generated by r.in.gdal

 ++


6s file:
25 - geometrical conditions=Sentinel-2A
9 5 10.6728 10.73413 59.90647 - month day hh.ddd longitude latitude
4  - atmospheric model=subarctic summer
3 - aerosol model=urban
50 - visibility [km] (aerosol model concentration) (this is estimated, I
also tried with AOD specified)
-0.055 - mean target elevation above sea level [km]
-1000 - sensor height
166 - Sentinel2A Blue band B2 (440nm - 535nm)


Command:
i.atcorr input=test_B02@p_Sentinel4Nature_S2_Oslo range=1,28000
elevation=dem_10m_25833@p_Sentinel4Nature_S2_Oslo parameters=/home/
NINA.NO/zofie.cimburova/Sentinel4Nature/DATA/6s.txt output=test_B02_atcorr
>Atmospheric correction...
>Atmospheric correction complete.

(I am not sure about the range parameter, tried with 0,255 too. The DEM
contains no NULLs. Also tried running with -r and -a flags.)


Output:
r.info map=test_B02_atcorr@p_Sentinel4Nature_S2_Oslo

 ++
 | Map:  test_B02_atcorr@p_Sentinel4N  Date: Mon Dec 18 13:10:14 2017

 | Mapset:   p_Sentinel4Nature_S2_Oslo  Login of Creator:
zofie.cimburova
 | Location: ETRS_33N

 | DataBase: /data/grass

 | Title:test_B02_atcorr2

 | Timestamp: none

 ||
 |

 |   Type of Map:  raster   Number of Categories: 0

 |   Data Type:FCELL

 |   Rows: 1001

 |   Columns:  1001

 |   Total Cells:  1002001

 |Projection: UTM (zone 33)

 |N:6653695S:6643685   Res:10

 |E: 266505W: 256495   Res:10

 |   Range of data:min = -nan  max = -nan

 |

 |   Data Description:

 |generated by i.atcorr

 |

 |   Comments:

 |i.atcorr input="test_B02@p_Sentinel4Nature_S2_Oslo" range=1,28\
 |000 elevation="dem_10m_25833@p_Sentinel4Nature_S2_Oslo" para\
 |meters="/home/NINA.NO/zofie.cimburova/Sentinel4Nature/DATA/6s.txt"
o\
 |utput="test_B02_atcorr2" rescale=0,255

 |

 ++



On Fri, Dec 15, 2017 at 5:12 PM, Žofie Cimburová 
wrote:

> Dear Markus,
> thanks for your reply, this is exactly what I need to know!
>
> Best, Zofie
>
> On Fri, Dec 15, 2017 at 5:09 PM, Markus Neteler  wrote:
>
>>
>> On Dec 15, 2017 3:54 PM, "Žofie Cimburová" 
>> wrote:
>> >
>> > Dear all,
>> > I am trying to use i.atcorr (GRASS 7.4) to apply atmospheric
>> corrections for Sentinel 2 data. The documentation provides a great help,
>> but there are two points I am not sure about -
>> >
>> > - I don't need the atmospheric correction to be applied to the whole
>> scene, so I only imported a small clip of the scene to GRASS. What
>> longitude and latitude shall I then specify in the 6S parameters?
>>
>> I'd use the center coordinates of the clipped area.
>>
>> > Or is it necessary to apply the corrections to the entire scene?
>>
>> No since it is a pixel based algorithm.
>>

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-15 Thread Žofie Cimburová
Dear Markus,
thanks for your reply, this is exactly what I need to know!

Best, Zofie

On Fri, Dec 15, 2017 at 5:09 PM, Markus Neteler  wrote:

>
> On Dec 15, 2017 3:54 PM, "Žofie Cimburová" 
> wrote:
> >
> > Dear all,
> > I am trying to use i.atcorr (GRASS 7.4) to apply atmospheric corrections
> for Sentinel 2 data. The documentation provides a great help, but there are
> two points I am not sure about -
> >
> > - I don't need the atmospheric correction to be applied to the whole
> scene, so I only imported a small clip of the scene to GRASS. What
> longitude and latitude shall I then specify in the 6S parameters?
>
> I'd use the center coordinates of the clipped area.
>
> > Or is it necessary to apply the corrections to the entire scene?
>
> No since it is a pixel based algorithm.
>
> > - How can I estimate the value of visibility (aerosol model
> concentration)?
>
> There are AERONET data online somewhere which might be the best choice.
>
> Markus
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-15 Thread Markus Neteler
On Dec 15, 2017 3:54 PM, "Žofie Cimburová"  wrote:
>
> Dear all,
> I am trying to use i.atcorr (GRASS 7.4) to apply atmospheric corrections
for Sentinel 2 data. The documentation provides a great help, but there are
two points I am not sure about -
>
> - I don't need the atmospheric correction to be applied to the whole
scene, so I only imported a small clip of the scene to GRASS. What
longitude and latitude shall I then specify in the 6S parameters?

I'd use the center coordinates of the clipped area.

> Or is it necessary to apply the corrections to the entire scene?

No since it is a pixel based algorithm.

> - How can I estimate the value of visibility (aerosol model
concentration)?

There are AERONET data online somewhere which might be the best choice.

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] i.atcorr with Sentinel2

2017-12-15 Thread Thomas Adams
Zofie,

You could mask the area or set the region to include only the area you're
interested in

Tom

On Fri, Dec 15, 2017 at 9:53 AM, Žofie Cimburová 
wrote:

> Dear all,
> I am trying to use i.atcorr (GRASS 7.4) to apply atmospheric corrections
> for Sentinel 2 data. The documentation provides a great help, but there are
> two points I am not sure about -
>
> - I don't need the atmospheric correction to be applied to the whole
> scene, so I only imported a small clip of the scene to GRASS. What
> longitude and latitude shall I then specify in the 6S parameters? Or is it
> necessary to apply the corrections to the entire scene? (In that case, do
> the latitude and longitude refer to the centre or to the corner of the
> scene?)
>
> - How can I estimate the value of visibility (aerosol model
> concentration)?
>
>
> Thanks for any help!
>
> Best regards,
> Zofie
>
>
>
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>



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