<div dir="ltr"><div>Dear Ilaria, <br></div><div><br></div><div>If you use Level 2A data, you do not need to do atmospheric correction. The products are already corrected and the only thing you need to do, if you want floating point data, is to rescale reflectances with the equation indicated by Moritz. Optionally removing the overshoots by setting a ceiling for values > 10000, as theoretically reflectance range is [0,1].<br></div><div><br></div><div>If, instead, you are using a Level 1C product, then yes, atmospheric correction is needed, as those products are top of atmosphere (TOA) reflectance. For Sentinel data you have different options. Either you use i.atcorr or i.sentinel.preproc. If you do not have a visibility layer, you need an AOD value (or file) from a station within the scene ideally and of the ~date when the image was taken. If you can read some Spanish, I have a presentation with all the details: <a href="https://gitlab.com/veroandreo/maie-procesamiento/-/blob/taller-grass-online/pdf/03_exercise_processing_s2.pdf">https://gitlab.com/veroandreo/maie-procesamiento/-/blob/taller-grass-online/pdf/03_exercise_processing_s2.pdf</a>. In any case, i.atcorr manual page shows the process of correcting a S2 L1C scene step by step.<br></div><div><br></div><div>hth, <br></div><div>Vero<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El vie, 28 ene 2022 a las 12:07, Moritz Lennert (<<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</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">On 28/01/22 10:55, <a href="mailto:ilaria.ferrando87@gmail.com" target="_blank">ilaria.ferrando87@gmail.com</a> wrote:<br>
> Thank you Moritz, I will do some research on visibility (aerosol model concentration) to put a reasonable value there (any suggestion is appreciated, also regarding references to look at).<br>
<br>
The man page suggests <a href="https://aeronet.gsfc.nasa.gov/" rel="noreferrer" target="_blank">https://aeronet.gsfc.nasa.gov/</a>.<br>
<br>
> How can I transform digital number into radiance/reflectance?<br>
<br>
This information should be in the metadata that accompanies the Sentinel <br>
data. I haven't worked with this data in a couple of years, so don't <br>
remember.<br>
<br>
However, in the doc on <br>
<a href="https://docs.sentinel-hub.com/api/latest/data/sentinel-2-l2a/" rel="noreferrer" target="_blank">https://docs.sentinel-hub.com/api/latest/data/sentinel-2-l2a/</a>, you can read:<br>
<br>
For Sentinel-2 optical data, the relation between DN and REFLECTANCE <br>
(default unit) is: DN = 10000 * REFLECTANCE.<br>
<br>
Moritz<br>
<br>
> Thank you very much for your precious help!<br>
> <br>
> -----Messaggio originale-----<br>
> Da: Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>><br>
> Inviato: giovedì 27 gennaio 2022 17:50<br>
> A: <a href="mailto:ilaria.ferrando87@gmail.com" target="_blank">ilaria.ferrando87@gmail.com</a>; 'Maris Nartiss' <<a href="mailto:maris.gis@gmail.com" target="_blank">maris.gis@gmail.com</a>><br>
> Cc: 'GRASS user list' <<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>><br>
> Oggetto: Re: R: R: [GRASS-user] NULL values as output of i.atcorr<br>
> <br>
> On 27/01/22 14:54, <a href="mailto:ilaria.ferrando87@gmail.com" target="_blank">ilaria.ferrando87@gmail.com</a> wrote:<br>
>> The output of <a href="http://r.info" rel="noreferrer" target="_blank">r.info</a> is the following<br>
>><br>
>> <a href="http://r.info" rel="noreferrer" target="_blank">r.info</a> map=immagine@mapset<br>
>> +----------------------------------------------------------------------------+<br>
>> | Map: immagine@mapset Date: Tue Nov 30 12:51:12 2021 |<br>
>> | Mapset: mapset Login of Creator: [...] |<br>
>> | Location: WGS84_UTM32 |<br>
>> | DataBase: C:\Users\[...]\grassdata |<br>
>> | Title: immagine |<br>
>> | Timestamp: none |<br>
>> |----------------------------------------------------------------------------|<br>
>> | |<br>
>> | Type of Map: raster Number of Categories: 0 |<br>
>> | Data Type: CELL |<br>
>> | Rows: 10980 |<br>
>> | Columns: 10980 |<br>
>> | Total Cells: 120560400 |<br>
>> | Projection: UTM (zone 32) |<br>
>> | N: 4900020 S: 4790220 Res: 10 |<br>
>> | E: 609780 W: 499980 Res: 10 |<br>
>> | Range of data: min = 0 max = 18876 |<br>
>> | |<br>
>> | Data Description: |<br>
>> | generato da r.in.gdal |<br>
>> | |<br>
>> | Comments: |<br>
>> | r.in.gdal -e input="C:\Users\[...]\T32TNP_2020062\ |<br>
>> | 2T100559_B04.jp2" output="immagine" memory=300 offset=0 num_digits=0 |<br>
>> | |<br>
>> <br>
>> +---------------------------------------------------------------------<br>
>> -------+<br>
> <br>
> This looks to me like the data is in digital number, not in radiance or reflectance. You first have to translate it to one or the other before feeding it to i.attcor.<br>
> <br>
>><br>
>> Do you mean the sixth line of the file? From the i.atcorr help it is the "mean target elevation above sea level [km]", and it is correct that it is negative.<br>
>> I'm now wondering if the problem can be having put "0" for visibility (aerosol model concentration, fifth line). What do you think about it?<br>
> <br>
> I am speaking about the value '-0.293' in line 6 (and yes, my bad for not paying attention to the value 0 in the line before). The man page<br>
> states: "If you have an estimate of aerosol optical depth, enter 0 for the visibility and in a following line enter the aerosol optical depth at 550nm (iaer means 'i' for input and 'aer' for aerosol), for example:"<br>
> So, if you have 0 on line 5, so line 6 is AOD and not mean target elevation above sea level.<br>
> <br>
> In this case line 7 is the "mean target elevation above sea level [-km]"<br>
> with value -1000 :-).<br>
> <br>
> Moritz<br>
> <br>
> <br>
> <br>
> <br>
>> <br>
>><br>
>> -----Messaggio originale-----<br>
>> Da: Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>><br>
>> Inviato: giovedì 27 gennaio 2022 14:08<br>
>> A: <a href="mailto:ilaria.ferrando87@gmail.com" target="_blank">ilaria.ferrando87@gmail.com</a>; 'Maris Nartiss' <<a href="mailto:maris.gis@gmail.com" target="_blank">maris.gis@gmail.com</a>><br>
>> Cc: 'GRASS user list' <<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>><br>
>> Oggetto: Re: R: [GRASS-user] NULL values as output of i.atcorr<br>
>><br>
>> On 27/01/22 14:01, <a href="mailto:ilaria.ferrando87@gmail.com" target="_blank">ilaria.ferrando87@gmail.com</a> wrote:<br>
>>> Dear Moritz,<br>
>>> thank you for your reply.<br>
>>> I tried with and without the -r flag and the results is the same.<br>
>><br>
>> I reformulate this part of the question then: what exactly is the<br>
>> content of immagine@mapset ? Please provide the output of<br>
>><br>
>> <a href="http://r.info" rel="noreferrer" target="_blank">r.info</a> map=immagine@mapset<br>
>><br>
>><br>
>>> Please find attached the parameters of the file 22giugno2020_b4.txt:<br>
>>><br>
>>> 26<br>
>>> 6 22 17.05 9.68728523 43.75514951<br>
>>> 2<br>
>>> 1<br>
>>> 0<br>
>>> -0.293<br>
>><br>
>> Are you sure this should be a negative number ? This should be visibility in km IIRC.<br>
>><br>
>>> -1000<br>
>>> 182<br>
>><br>
>><br>
>> Moritz<br>
>>><br>
>>> -----Messaggio originale-----<br>
>>> Da: Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>><br>
>>> Inviato: giovedì 27 gennaio 2022 13:22<br>
>>> A: Ilaria Ferrando <<a href="mailto:ilaria.ferrando87@gmail.com" target="_blank">ilaria.ferrando87@gmail.com</a>>; Maris Nartiss<br>
>>> <<a href="mailto:maris.gis@gmail.com" target="_blank">maris.gis@gmail.com</a>><br>
>>> Cc: GRASS user list <<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>><br>
>>> Oggetto: Re: [GRASS-user] NULL values as output of i.atcorr<br>
>>><br>
>>> On 26/01/22 19:50, Ilaria Ferrando wrote:<br>
>>>> Dear Māris,<br>
>>>> Thank you for your reply.<br>
>>>> Yes, the image is inside the computational region.<br>
>>>> Any other ideas?<br>
>>><br>
>>><br>
>>> 1) Are you sure your input data is reflectance (-r flag used) ?<br>
>>> 2) Could you provide us with the contents of the 22giugno2020_b4.txt file ?<br>
>>><br>
>>> Moritz<br>
>>><br>
>>>><br>
>>>> Il mer 26 gen 2022, 19:45 Maris Nartiss <<a href="mailto:maris.gis@gmail.com" target="_blank">maris.gis@gmail.com</a><br>
>>>> <mailto:<a href="mailto:maris.gis@gmail.com" target="_blank">maris.gis@gmail.com</a>>> ha scritto:<br>
>>>><br>
>>>> One thing to always check – does your computational region contain<br>
>>>> data you are analysing? Try to run `g.region rast=immagine` before<br>
>>>> running i.atcorr.<br>
>>>><br>
>>>> Māris.<br>
>>>><br>
>>>> trešd., 2022. g. 26. janv., plkst. 18:13 — lietotājs<br>
>>>> <<a href="mailto:ilaria.ferrando87@gmail.com" target="_blank">ilaria.ferrando87@gmail.com</a> <mailto:<a href="mailto:ilaria.ferrando87@gmail.com" target="_blank">ilaria.ferrando87@gmail.com</a>>><br>
>>>> rakstīja:<br>
>>>> ><br>
>>>> > Dear all,<br>
>>>> ><br>
>>>> > I am having troubles in processing a Sentinel-2 image with i.atcorr.<br>
>>>> ><br>
>>>> > The command I use is the following:<br>
>>>> ><br>
>>>> > i.atcorr -r -input=immagine@mapset range=0,10000<br>
>>>> parameters=C:\...\22giugno2020_b4.txt output=immagine_atcorr rescale=0,1<br>
>>>> ><br>
>>>> > and I obtain this output:<br>
>>>> ><br>
>>>> > wavelength less than 0.25 micron:<br>
>>>> ><br>
>>>> > let's take s(l)=s(0.25)<br>
>>>> ><br>
>>>> > Atmospheric correction...<br>
>>>> ><br>
>>>> > Atmospheric correction complete.<br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> > The map I obtain is constituted by pixels with 6.669033e-34 values.<br>
>>>> ><br>
>>>> > Can anyone explain the meaning of the output and why I obtain a<br>
>>>> NULL value corrected map?<br>
>>>> ><br>
>>>> > Thank you for your support.<br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> > _______________________________________________<br>
>>>> > grass-user mailing list<br>
>>>> > <a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a> <mailto:<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>
>>>> <<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>
>>>> 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>
> <br>
> <br>
<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>
</blockquote></div>