L2 mask threshold

Technical questions about ACOLITE
Post Reply
emanuele.ciancia
Posts: 11
Joined: Thu Oct 25, 2018 4:05 pm

L2 mask threshold

Post by emanuele.ciancia »

Hi Quinten,
I'm trying to generate L2 files from Sentinel2-MSI data. Concerning L2 water mask, I've slightly changed the wave and threshold, as following:
wave= 2202
threshold=0.0215
I think this configuration is quite similar to the default one (wave 1600, threshold=0.0215), but most of the scene is depicted by NaN values, or it computes Rrs or rhow only in proximity of cloud shadows and most of the scene is flagged as 1 (scene out of ROI). Do you think the problem is the L2 masking? Do you think I need to increase the threshold? up to what maximum value I can set for?
In the attached files you can find the rgb image of rhos (where in most of the lake I expect to find valid values) and the derived Rrs(2202) for the corresponding day.

Thank you very much in advance,
Emanuele
Attachments
S2A_MSI_2017_05_28_09_50_31_T33TWE_Rrs_2202.png
S2A_MSI_2017_05_28_09_50_31_T33TWE_Rrs_2202.png (109.87 KiB) Viewed 12919 times
S2A_MSI_2017_05_28_09_50_31_T33TWE_rgb_rhos.jpg
S2A_MSI_2017_05_28_09_50_31_T33TWE_rgb_rhos.jpg (239.01 KiB) Viewed 12919 times
serge
Posts: 5
Joined: Tue Nov 21, 2017 8:55 am

Re: L2 mask threshold

Post by serge »

I think Rrs(2202) shoud be very low for the high water absorbtion. If you'll select color scale 0..0.0215 you can see Rrs over full river.

PS: And it is very interesting image and basin, but it seems there is a lot of sun glint there.
quinten
Posts: 1019
Joined: Tue Mar 03, 2015 8:13 am

Re: L2 mask threshold

Post by quinten »

Hi Emanuele

The non water masking is indeed not perfect, and does not work very well for cloud and mountain shadows. It will also exclude pixels with high glint and adjacency effects.

On your scene I expect the SWIR reflectance to be quite high for your lake, due to direct sun glint on the water surface. You will need to significantly raise the threshold to retrieve the lake pixels. You could use a visualisation tool, e.g. SNAP to find typical rhot_2202 values for your lake, and use this as threshold.

I would recommend trying the optional glint correction, but likely the results for this image will not be very good due to this significant glint.

Quinten
emanuele.ciancia
Posts: 11
Joined: Thu Oct 25, 2018 4:05 pm

Re: L2 mask threshold

Post by emanuele.ciancia »

Hi Quinten,
I've applied the optional glint correction, following your suggestions showed in previous posts:
glint_force_band=865
glint_mask_rhos_band=865
glint_mask_rhos_threshold=0.15
The image was corrected significantly. However, I have two main doubts concerning the glint correction options:
1. within the user manual, it is specified that " Pixels with glint_mash_rhos_band > the threshold will not be corrected". If I have understood well, all the pixels having rhos_865 less than 0.15 will be corrected? this threshold allows at excluding no water pixels (land or vegetation pixels) for the correction? Is it correct? With this threshold all the water pixels presumibly will be corrected?
2. Do you suggest to set on "True" the option glint_correction also to process a long dataset of images? The glint correction is planned also to work by processing a lot of images? Otherwise is ts developed to work selecting the single image the user wants to correct?
Please, try to explain better how the glint correction works
Thank you very much, Quinten
quinten
Posts: 1019
Joined: Tue Mar 03, 2015 8:13 am

Re: L2 mask threshold

Post by quinten »

Hi Emanuele

1) Yes, with the settings you give, all pixels with rhos_865 < 0.15 will be corrected. This likely includes all of your water pixels. The default threshold and band combination (rhos at 1.6 micron < 0.05) is indeed aimed at excluding non water pixels, but may be insufficient at very high glint reflectances.

2) You can use the glint_correction=True option in batch mode, and generally this will work quite well. In inland waters you may find that the NIR/SWIR reflectances are impacted by adjacency effects as well. In those cases the glint may be overestimated.

Note that in your case it is probably best to use the default (SWIR) bands for the glint correction, or use a SWIR band explicitly (glint_force_band=1600). The glint_mask_rhos_threshold may have to be increased as you have done here. I will download your image and have a look.

Quinten
quinten
Posts: 1019
Joined: Tue Mar 03, 2015 8:13 am

Re: L2 mask threshold

Post by quinten »

Hi Emanuele

The default settings give the following output:
S2A_MSI_2017_05_28_09_50_31_T33TWE_rgb_rhos_noglint.png
S2A_MSI_2017_05_28_09_50_31_T33TWE_rgb_rhos_noglint.png (631.83 KiB) Viewed 12844 times
With glint correction enabled (glint_correction=True):
S2A_MSI_2017_05_28_09_50_31_T33TWE_rgb_rhos_glint.png
S2A_MSI_2017_05_28_09_50_31_T33TWE_rgb_rhos_glint.png (630.56 KiB) Viewed 12844 times
Here the threshold (0.05) prevents the whole lake from being corrected. Only the areas along the northern shore with relatively low glint were changed from the above figure.

By increasing the threshold (glint_correction=True and glint_mask_rhos_threshold=0.11):
S2A_MSI_2017_05_28_09_50_31_T33TWE_rgb_rhos_glint2.png
S2A_MSI_2017_05_28_09_50_31_T33TWE_rgb_rhos_glint2.png (621.89 KiB) Viewed 12844 times
Here the whole lake was corrected, but some noise is introduced from the SWIR bands. The spectra look reasonable though.

Hope this helps!

Quinten
emanuele.ciancia
Posts: 11
Joined: Thu Oct 25, 2018 4:05 pm

Re: L2 mask threshold

Post by emanuele.ciancia »

Hi Quinten,
First of all, thank you for the exhaustive replay, but just the last question, I hope:
if I process n (for example 50 images) images in batch mode do you think that setting the glint correction on "True" it ensure to obtain reasonable rhos values also in cases when the glint correction could not be ncecessary?
For instance, looking at the image (Fig. 1) acquired on 14/06/2017, it seems not affected by sun glint effects and the rhos_560 derived is also reported in Fig. 2
Within a batch mode processing (in which I can process images affected or unaffected by sun glint) and applying these correction options ( wave=1600, threshold=0.11) I obtain the corresponding Figures 3 (rgb)
Attachments
Fig.3. rgb glint corrected
Fig.3. rgb glint corrected
S2A_MSI_2017_06_14_09_40_31_T33TWE_rgb_rhos_glint_corrected.png (892.01 KiB) Viewed 12840 times
Fig.2 no glint correction
Fig.2 no glint correction
S2A_MSI_2017_06_14_09_40_31_T33TWE_rhow_560.png (124.69 KiB) Viewed 12840 times
Fig.1 rgb no glint correction
Fig.1 rgb no glint correction
S2A_MSI_2017_06_14_09_40_31_T33TWE_rgb_rhos_no_glint.png (888.47 KiB) Viewed 12840 times
emanuele.ciancia
Posts: 11
Joined: Thu Oct 25, 2018 4:05 pm

Re: L2 mask threshold

Post by emanuele.ciancia »

Applying the glint correction the rhos_560 image is (Fig.4).
Within a batch processing mode the user cannot have the possibility to check each single image if it is affected/unaffected by sun glint, so do you suggest to set on True the glint correction option on "True" for all the images involved within the batch processing?
Which is the theoretical criterion on which the sun glint correction is based on?
Thank you again for your kindness
Cheers
Emanuele
Attachments
Fig.4. rhos_560_glint_corrected
Fig.4. rhos_560_glint_corrected
S2A_MSI_2017_06_14_09_40_31_T33TWE_rhow_560_glint_corrected.png (130.69 KiB) Viewed 12840 times
quinten
Posts: 1019
Joined: Tue Mar 03, 2015 8:13 am

Re: L2 mask threshold

Post by quinten »

Hi Emanuele

The glint correction assumes the water leaving radiance reflectance is zero in a reference band, so that all signal remaining in that band after the atmospheric correction is from the surface itself. The glint signal is then transferred to the other bands by multiplying by the ratio of direct transmittance and Fresnel reflectance in the reference and target bands. By default the SWIR band giving the lowest glint reflectance is used, but with glint_force_band you can specify the reference band.

It is not so straightforward to answer whether you can apply this to all images. NIR and SWIR bands may also be affected by adjacency effects, here in particular from nearby land pixels. Land adjacency effects have a spectral shape very different from glint, and hence applying the glint correction described above may not be accurate. In your image, while not super obvious on the RGB, there also may be a small glint factor present. The most obvious impact of the correction is at the land/water border, where mixed pixels also increase the SWIR signal, and the corrected rhos are unrealistically low.

Hope this helps! I am currently working on some ideas to correct for both glint and adjacency effects.

Quinten
Post Reply