<div dir="ltr"><div>Hi MarkusN</div><div><br></div><div>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. <br></div><div><br></div><div>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. <br></div><div><br></div><div>@MarkusM please correct me if I got it wrong<br></div><div><br></div><div>best,</div><div>Vero</div><div><br></div><div>---</div><div>Hi Vero,<span class="gmail-im"><br><br>On Wed, Nov 13, 2019 at 4:05 PM Veronica Andreo <<a href="mailto:veroandreo@gmail.com" target="_blank">veroandreo@gmail.com</a>> wrote:<br>><br>> Hi Markus<br>><br>> Thanks for the answer :)<br>><br>> El mié., 13 nov. 2019 a las 14:18, Markus Metz (<<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a>>) escribió:<br>>><br>>> Hi Vero,<br>>><br>>> On Wed, Nov 13, 2019 at 12:59 PM Veronica Andreo <<a href="mailto:veroandreo@gmail.com" target="_blank">veroandreo@gmail.com</a>> wrote:<br>>> ><br>>> > Hi all,<br>>> ><br>>> > I'm using i.atcorr for atmospheric correction of Pleiades imagery. The data comes as DN in 12 bits.<br>>><br>>> That is, values can be in the range 0, 4095, but the full possible range is not necessarily used.<br>><br>>
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?<br><div><br></div></span><div>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?</div><div><br></div><div>Best,</div><div></div><div>Markus</div><div class="gmail-yj6qo gmail-ajU"><div><img class="gmail-ajT" src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"></div></div><div class="gmail-adL"><div class="gmail-im">>>
> 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 <a href="http://r.info" target="_blank">r.info</a> for each band. There's no extra info in the metadata about theoretical range for each band.<br>>><br>>>
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.<br>><br>> Theoretical range of radiance or the bits of DN?<br>>><br>>>
Regarding Pleiades or other imagery, you need to get from documentation
or metadata the valid range and use this as range for i.atcorr.<br>><br>>
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.<br>><br>> Thanks again,<br>> Vero<br>><br>>><br>>> HTH,<br>>><br>>> Markus M<br>>><br>>> ><br>>>
> 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.<br>>> ><br>>> > So, I'm a bit lost... What is really this range parameter representing?<br>>> ><br>>> > Thanks much in advance<br>>> ><br>>> > Vero<br>>> ><br>>> > [1] <a href="https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types/level-1c" target="_blank">https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types/level-1c</a><br><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié., 13 nov. 2019 a las 22:43, Markus Neteler (<<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
On Wed, Nov 13, 2019 at 2:18 PM Markus Metz<br>
<<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a>> wrote:<br>
> On Wed, Nov 13, 2019 at 12:59 PM Veronica Andreo <<a href="mailto:veroandreo@gmail.com" target="_blank">veroandreo@gmail.com</a>> wrote:<br>
> ><br>
> > Hi all,<br>
> ><br>
> > I'm using i.atcorr for atmospheric correction of Pleiades imagery. The data comes as DN in 12 bits.<br>
><br>
> That is, values can be in the range 0, 4095, but the full possible range is not necessarily used.<br>
><br>
> > 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 <a href="http://r.info" rel="noreferrer" target="_blank">r.info</a> for each band. There's no extra info in the metadata about theoretical range for each band.<br>
><br>
> No, the range parameter in i.atcorr needs the theoretical range.<br>
<br>
Since it isn't that obvious yet I'd suggest to reword the description at<br>
<a href="https://github.com/OSGeo/grass/blob/master/imagery/i.atcorr/main.cpp#L496" rel="noreferrer" target="_blank">https://github.com/OSGeo/grass/blob/master/imagery/i.atcorr/main.cpp#L496</a><br>
<br>
from:<br>
opts.iscl->description = _("Input range");<br>
<br>
to something like:<br>
opts.iscl->description = _("Input range (theoretical range)");<br>
<br>
(feel free to submit a PR)<br>
<br>
> 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.<br>
<br>
This valuable hint might to into the manual.<br>
<br>
best<br>
markusN<br>
<br>
> Regarding Pleiades or other imagery, you need to get from documentation or metadata the valid range and use this as range for i.atcorr.<br>
><br>
> HTH,<br>
><br>
> Markus M<br>
><br>
> ><br>
> > 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.<br>
> ><br>
> > So, I'm a bit lost... What is really this range parameter representing?<br>
> ><br>
> > Thanks much in advance<br>
> ><br>
> > Vero<br>
> ><br>
> > [1] <a href="https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types/level-1c" rel="noreferrer" target="_blank">https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types/level-1c</a><br>
> > _______________________________________________<br>
> > grass-user mailing list<br>
> > <a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
> > <a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
> _______________________________________________<br>
> grass-user mailing list<br>
> <a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
<br>
<br>
<br>
-- <br>
Markus Neteler, PhD<br>
<a href="https://www.mundialis.de" rel="noreferrer" target="_blank">https://www.mundialis.de</a> - free data with free software<br>
<a href="https://grass.osgeo.org" rel="noreferrer" target="_blank">https://grass.osgeo.org</a><br>
<a href="https://courses.neteler.org/blog" rel="noreferrer" target="_blank">https://courses.neteler.org/blog</a><br>
</blockquote></div>