[GRASS-user] i.atcorr: which is the meaning of range parameter?

Markus Metz markus.metz.giswork at gmail.com
Sat Nov 23 11:51:11 PST 2019


Hi Vero,

On Thu, Nov 14, 2019 at 1:37 PM Veronica Andreo <veroandreo at gmail.com>
wrote:
>
> Hi MarkusN
>
> I accidentaly only answered to MarkusM, sorry... Below, I forward the
emails for further reference. All in all, I understood that the range
parameter is then the theoretical radiance range given that the input is
expected to be radiance.
>
> So, the example for S2 should say S2 level 1C that comes as scaled TOA
and hence it is fine to use 1,10000 as range. But in the example for
Landsat if that's a L1 product (L2 wouldn't need atmospheric correction at
all), IIUC, the default range 0,255 is wrong, because those are DN. So, one
should apply Gain and Bias coefficients to the DN range in order to get the
radiance theoretical range required by i.atcorr.

For i.atcorr, it does not really matter if you apply gain and bias. For
example wit S2, if you apply gain and bias with gain = 1/10000 and bias =
0, you get values in the range 0, 1 and for i.atcorr you would use
range=0,1. If you do not apply gain and bias, you can let i.atcorr applay
gain and bias by using range=1,10000 (0 is nodata in S2).

HTH,

Markus M
>
> @MarkusM please correct me if I got it wrong
>
> best,
> Vero
>
> ---
> Hi Vero,
>
> On Wed, Nov 13, 2019 at 4:05 PM Veronica Andreo <veroandreo at gmail.com>
wrote:
> >
> > Hi Markus
> >
> > Thanks for the answer :)
> >
> > El mié., 13 nov. 2019 a las 14:18, Markus Metz (<
markus.metz.giswork at gmail.com>) escribió:
> >>
> >> Hi Vero,
> >>
> >> On Wed, Nov 13, 2019 at 12:59 PM Veronica Andreo <veroandreo at gmail.com>
wrote:
> >> >
> >> > Hi all,
> >> >
> >> > I'm using i.atcorr for atmospheric correction of Pleiades imagery.
The data comes as DN in 12 bits.
> >>
> >> That is, values can be in the range 0, 4095, but the full possible
range is not necessarily used.
> >
> > Yes, that's clear. Metadata says 0 is for nodata and 4095 for bad
values, so range would be 1,4094. But these are DN, not radiance and the
manual of i.atcorr says that the module accepts radiance, this is what I
don't understand... Shall I convert to radiance before i.atcorr or use raw
data and the DN range?
>
> Yes, I guess it's better to convert to radiance. So if you have gain and
bias, you can apply them to 1 and 4094 to get the theoretical range of
radiance, no?
>
> Best,
> Markus
> >> > Reading the manual of i.atcorr, I get that I must provide radiance
data. Hence I converted each band to radiance using gain and bias from the
metadata. Now, for the range parameter in i.atcorr, I assume I must pass
the min/max output of r.info for each band. There's no extra info in the
metadata about theoretical range for each band.
> >>
> >> No, the range parameter in i.atcorr needs the theoretical range. For
example for Landsat, values can be in the range 1, 255 (0 is reserved for
nodata IIRC), but actual band values usually cover only a part of that
range. Therefore min/max of a band is not correct.
> >
> > Theoretical range of radiance or the bits of DN?
> >>
> >> Regarding Pleiades or other imagery, you need to get from
documentation or metadata the valid range and use this as range for
i.atcorr.
> >
> > I went through metadata file and user guide, but theoretical range for
radiance I didn't find... only the gain and bias and radiometric resolution.
> >
> > Thanks again,
> > Vero
> >
> >>
> >> HTH,
> >>
> >> Markus M
> >>
> >> >
> >> > In the i.atcorr manual and in some older emails, I read for example,
that the range for Sentinel 2 is 1 to 10000. However here [1] it says:
"Per-pixel radiometric measurements are provided in Top Of Atmosphere (TOA)
reflectances along with the parameters to transform them into radiances".
AFAIU, 1,10000 is TOA range.
> >> >
> >> > So, I'm a bit lost... What is really this range parameter
representing?
> >> >
> >> > Thanks much in advance
> >> >
> >> > Vero
> >> >
> >> > [1]
https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types/level-1c
>
>
> El mié., 13 nov. 2019 a las 22:43, Markus Neteler (<neteler at osgeo.org>)
escribió:
>>
>> Hi,
>>
>> On Wed, Nov 13, 2019 at 2:18 PM Markus Metz
>> <markus.metz.giswork at gmail.com> wrote:
>> > On Wed, Nov 13, 2019 at 12:59 PM Veronica Andreo <veroandreo at gmail.com>
wrote:
>> > >
>> > > Hi all,
>> > >
>> > > I'm using i.atcorr for atmospheric correction of Pleiades imagery.
The data comes as DN in 12 bits.
>> >
>> > That is, values can be in the range 0, 4095, but the full possible
range is not necessarily used.
>> >
>> > > Reading the manual of i.atcorr, I get that I must provide radiance
data. Hence I converted each band to radiance using gain and bias from the
metadata. Now, for the range parameter in i.atcorr, I assume I must pass
the min/max output of r.info for each band. There's no extra info in the
metadata about theoretical range for each band.
>> >
>> > No, the range parameter in i.atcorr needs the theoretical range.
>>
>> Since it isn't that obvious yet I'd suggest to reword the description at
>> https://github.com/OSGeo/grass/blob/master/imagery/i.atcorr/main.cpp#L496
>>
>> from:
>>    opts.iscl->description = _("Input range");
>>
>> to something like:
>>    opts.iscl->description = _("Input range (theoretical range)");
>>
>> (feel free to submit a PR)
>>
>> > For example for Landsat, values can be in the range 1, 255 (0 is
reserved for nodata IIRC), but actual band values usually cover only a part
of that range. Therefore min/max of a band is not correct.
>>
>> This valuable hint might to into the manual.
>>
>> best
>> markusN
>>
>> > Regarding Pleiades or other imagery, you need to get from
documentation or metadata the valid range and use this as range for
i.atcorr.
>> >
>> > HTH,
>> >
>> > Markus M
>> >
>> > >
>> > > In the i.atcorr manual and in some older emails, I read for example,
that the range for Sentinel 2 is 1 to 10000. However here [1] it says:
"Per-pixel radiometric measurements are provided in Top Of Atmosphere (TOA)
reflectances along with the parameters to transform them into radiances".
AFAIU, 1,10000 is TOA range.
>> > >
>> > > So, I'm a bit lost... What is really this range parameter
representing?
>> > >
>> > > Thanks much in advance
>> > >
>> > > Vero
>> > >
>> > > [1]
https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types/level-1c
>> > > _______________________________________________
>> > > grass-user mailing list
>> > > grass-user at lists.osgeo.org
>> > > https://lists.osgeo.org/mailman/listinfo/grass-user
>> > _______________________________________________
>> > grass-user mailing list
>> > grass-user at lists.osgeo.org
>> > https://lists.osgeo.org/mailman/listinfo/grass-user
>>
>>
>>
>> --
>> Markus Neteler, PhD
>> https://www.mundialis.de - free data with free software
>> https://grass.osgeo.org
>> https://courses.neteler.org/blog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20191123/7009b7c1/attachment.html>


More information about the grass-user mailing list