<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.StileMessaggioDiPostaElettronica18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=IT link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'>Thank you very much Vero for your kind answer and for sharing the presentation, which for sure will result very useful!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b>Da:</b> Veronica Andreo <veroandreo@gmail.com> <br><b>Inviato:</b> venerdì 28 gennaio 2022 14:50<br><b>A:</b> Moritz Lennert <mlennert@club.worldonline.be><br><b>Cc:</b> Pilafin <ilaria.ferrando87@gmail.com>; Maris Nartiss <maris.gis@gmail.com>; GRASS user list <grass-user@lists.osgeo.org><br><b>Oggetto:</b> Re: [GRASS-user] R: R: R: NULL values as output of i.atcorr<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Dear Ilaria, <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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].<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>hth, <o:p></o:p></p></div><div><p class=MsoNormal>Vero<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>El vie, 28 ene 2022 a las 12:07, Moritz Lennert (<<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>>) escribió:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal>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/" 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/" 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" target="_blank">r.info</a> is the following<br>>><br>>> <a href="http://r.info" 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" 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" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>>>>>        <<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" 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" 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" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><o:p></o:p></p></blockquote></div></div></body></html>