[GRASS-user] R: R: R: R: NULL values as output of i.atcorr

2022-01-28 Thread ilaria.ferrando87
Thank you very much for your support! I will keep you update on my (I hope) 
progresses!

-Messaggio originale-
Da: Moritz Lennert  
Inviato: venerdì 28 gennaio 2022 12:07
A: ilaria.ferrand...@gmail.com; 'Maris Nartiss' 
Cc: 'GRASS user list' 
Oggetto: Re: R: R: R: [GRASS-user] NULL values as output of i.atcorr

On 28/01/22 10:55, ilaria.ferrand...@gmail.com wrote:
> 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).

The man page suggests https://aeronet.gsfc.nasa.gov/.

> How can I transform digital number into radiance/reflectance?

This information should be in the metadata that accompanies the Sentinel data. 
I haven't worked with this data in a couple of years, so don't remember.

However, in the doc on
https://docs.sentinel-hub.com/api/latest/data/sentinel-2-l2a/, you can read:

For Sentinel-2 optical data, the relation between DN and REFLECTANCE (default 
unit) is: DN = 1 * REFLECTANCE.

Moritz

> Thank you very much for your precious help!
> 
> -Messaggio originale-
> Da: Moritz Lennert 
> Inviato: giovedì 27 gennaio 2022 17:50
> A: ilaria.ferrand...@gmail.com; 'Maris Nartiss' 
> Cc: 'GRASS user list' 
> Oggetto: Re: R: R: [GRASS-user] NULL values as output of i.atcorr
> 
> On 27/01/22 14:54, ilaria.ferrand...@gmail.com wrote:
>> The output of r.info is the following
>>
>> r.info map=immagine@mapset
>>
>> ++
>>| Map:  immagine@mapsetDate: Tue Nov 30 12:51:12 2021|
>>| Mapset:   mapset Login of Creator: [...]  |
>>| Location: WGS84_UTM32   
>>|
>>| DataBase: C:\Users\[...]\grassdata  |
>>| Title:immagine  
>>|
>>| Timestamp: none 
>>|
>>
>> ||
>>| 
>>|
>>|   Type of Map:  raster   Number of Categories: 0
>>|
>>|   Data Type:CELL
>>|
>>|   Rows: 10980   
>>|
>>|   Columns:  10980   
>>|
>>|   Total Cells:  120560400   
>>|
>>|Projection: UTM (zone 32)
>>|
>>|N:4900020S:4790220   Res:10  
>>|
>>|E: 609780W: 499980   Res:10  
>>|
>>|   Range of data:min = 0  max = 18876
>>|
>>| 
>>|
>>|   Data Description: 
>>|
>>|generato da r.in.gdal
>>|
>>| 
>>|
>>|   Comments: 
>>|
>>|r.in.gdal -e input="C:\Users\[...]\T32TNP_2020062\   |
>>|2T100559_B04.jp2" output="immagine" memory=300 offset=0 num_digits=0 
>>|
>>| 
>>|
>>
>> +
>> +-
>> ---+
> 
> 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.
> 
>>
>> 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.
>> 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?
> 
> 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
> states: "If you have an estimate of aerosol o

[GRASS-user] R: R: R: R: NULL values as output of i.atcorr

2022-01-28 Thread ilaria.ferrando87
Thank you very much Vero for your kind answer and for sharing the presentation, 
which for sure will result very useful!

 

Da: Veronica Andreo  
Inviato: venerdì 28 gennaio 2022 14:50
A: Moritz Lennert 
Cc: Pilafin ; Maris Nartiss ; 
GRASS user list 
Oggetto: Re: [GRASS-user] R: R: R: NULL values as output of i.atcorr

 

Dear Ilaria, 

 

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 > 
1, as theoretically reflectance range is [0,1].

 

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: 
https://gitlab.com/veroandreo/maie-procesamiento/-/blob/taller-grass-online/pdf/03_exercise_processing_s2.pdf.
 In any case, i.atcorr manual page shows the process of correcting a S2 L1C 
scene step by step.

 

hth, 

Vero

 

El vie, 28 ene 2022 a las 12:07, Moritz Lennert (mailto:mlenn...@club.worldonline.be> >) escribió:

On 28/01/22 10:55, ilaria.ferrand...@gmail.com 
<mailto:ilaria.ferrand...@gmail.com>  wrote:
> 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).

The man page suggests https://aeronet.gsfc.nasa.gov/.

> How can I transform digital number into radiance/reflectance?

This information should be in the metadata that accompanies the Sentinel 
data. I haven't worked with this data in a couple of years, so don't 
remember.

However, in the doc on 
https://docs.sentinel-hub.com/api/latest/data/sentinel-2-l2a/, you can read:

For Sentinel-2 optical data, the relation between DN and REFLECTANCE 
(default unit) is: DN = 1 * REFLECTANCE.

Moritz

> Thank you very much for your precious help!
> 
> -Messaggio originale-
> Da: Moritz Lennert  <mailto:mlenn...@club.worldonline.be> >
> Inviato: giovedì 27 gennaio 2022 17:50
> A: ilaria.ferrand...@gmail.com <mailto:ilaria.ferrand...@gmail.com> ; 'Maris 
> Nartiss' mailto:maris@gmail.com> >
> Cc: 'GRASS user list'  <mailto:grass-user@lists.osgeo.org> >
> Oggetto: Re: R: R: [GRASS-user] NULL values as output of i.atcorr
> 
> On 27/01/22 14:54, ilaria.ferrand...@gmail.com 
> <mailto:ilaria.ferrand...@gmail.com>  wrote:
>> The output of r.info <http://r.info>  is the following
>>
>> r.info <http://r.info>  map=immagine@mapset
>>
>> ++
>>| Map:  immagine@mapsetDate: Tue Nov 30 12:51:12 2021|
>>| Mapset:   mapset Login of Creator: [...]  |
>>| Location: WGS84_UTM32   
>>|
>>| DataBase: C:\Users\[...]\grassdata  |
>>| Title:immagine  
>>|
>>| Timestamp: none 
>>|
>>
>> ||
>>| 
>>|
>>|   Type of Map:  raster   Number of Categories: 0
>>|
>>|   Data Type:CELL
>>|
>>|   Rows: 10980   
>>|
>>|   Columns:  10980   
>>|
>>|   Total Cells:  120560400   
>>|
>>|Projection: UTM (zone 32)
>>|
>>|N:4900020S:4790220   Res:10  
>>|
>>|E: 609780W: 499980   Res:10  
>>|
>>|   Range of data:min = 0  max = 18876
>>|
>>| 
>>|
>>|   Data Description: