03Atmospheric correction
Created Friday 05 May 2017
Pilot production of Sentinel-2 L2A products over Europe
Alternativas de correccion
sen2cor
- Better use standalone
- By granule correction is possible (gtif subscene seems is not)
- Ask how to display position of granules
MAJA
- Summary of method: http://www.cesbio.ups-tlse.fr/multitemp/?p=6203
- https://github.com/olivierhagolle/Start_maja
- On-demand SENTINEL2 L2A processing with MAJA on PEPS http://www.cesbio.ups-tlse.fr/multitemp/?p=14335
- adapted peps scripts https://github.com/olivierhagolle/maja_peps
- Instrucciones:
- go to https://peps.cnes.fr, create an account, log in.
- Use the explore Menu, select your data. I like the semantic research possibility, for instance, you can ask for Sentinel-2 L1C Toulouse August, and you'll get all the products available in August.
- Select the ones you are interested and click on the gearing icon.
- Go to "your processing center" page (top left, with the gearing icon in black)
- Select the "MAJA atmospheric processor" and the products to process. It only works for Sentinel-2 L1C in single tile format, no need to try to process a Sentinel1 image,+ a S2 L2A image, or the old S2 format grouping several granules. Then press on "Process the products"
- Go to "My processing" page
- Wait (don't be fooled by the percentage, it goes fast at the beginning, but it takes between 1 and 2 hours)
- Download the results. If the image you chose contains more than 90 % of clouds, you get a filename which starts with "NOVALD" for "Not Valid".
- https://peps.cnes.fr/rocket/#/processings/jobs
- ./MAJA’s Native Sentinel-2 format _ Séries Temporelles.pdf
- Coding for CLoud MASKS
A no_data mask, at 10m resolution (EDG_R1.tif) and 20m (EDG_R2.tif)
A saturated pixel mask that comes from Level 1 with 10m resolution (SAT_R1.tif) and 20m (SAT_R2.tif)
first bit corresponds to first band at each resolution
second bit corresponds to second band at each resolution
...
Pour R1, the bands appear in this order B2, B3, B4, B8, and for R2 : B5, B6, B7, B8a, B11, B12
a cloud mask for each resolution (CLM_R1.tif ou CLM_R2.tif)
bit 0 (1) : all clouds except the thinnest and all shadows
bit 1 (2) : all clouds (except the thinnest)
bit 2 (4) : clouds detected via mono-temporal thresholds
bit 3 (8) : clouds detected via multi-temporal thresholds
bit 4 (16) : thinnest clouds
bit 5 (32) : cloud shadows cast by a detected cloud
bit 6 (64) : cloud shadows cast by a cloud outside image
bit 7 (128) : high clouds detected by 1.38 µm
Example 1 : value 33 = 32+1 (00100001) : bit 1 tells us a shoadow or a cloud has been detected and bit 5 that it is a shadow (32),
Example 2 : value 11 = 8 + 2 +1 (00001011) tells us that it is a cloud (bits 1 and 2), detected by multi-temporal threshold (bit 4)
A geophysical mask MG2 :
bit 0 (1) : Water mask
bit 1 (2) : All clouds (except the thinnests)
bit 2 (4) : Snow Mask
bit 3 (8) : all shadows ("OU" des bits 5 et 6 du masque de nuages)
bit 4 (16) : Topographic shadows
bit 5 (32) : Unseen pixels due to topography
bit 6 (64) : Sun too low for a correct terrain correction
bit 7 (128) : Sun direction tangent to slope (inaccurate terrain correction)
IAB : A mask of pixels for which the WaterVapour (bit 1) and Aerosol Optical Thickness (bit 2) was interpolated (available at resolutions R1 or R2). However, in MAJA 3.2, there is an inversion of bit 2, which equals zero if interpolated)
How to use the cloud mask
If you want a very strict cloud and shadows mask, just test if cloud mask is greater than 0. This is our advice.If you are working in a region where you think MACCS/MAJA detects too many clouds, check that bit 1 is 1. (Mask & (00000001) == 1)
sen2agri
(much more than atm. corr., which is provided by MAJA)
(works on CentOS 7 only)
- http://www.esa-sen2agri.org/
- https://github.com/Sen2Agri/Sen2Agri-System
- http://www.cesbio.ups-tlse.fr/multitemp/?p=10897#more-10897
The system manages the following operations :
- Sentinel-2 and LANDSAT 8 data download,
- L2A processing with MACCS/MAJA software (developed by CNES and CESBIO)
- Monthly Synthesis product generation (with a method developed at CESBIO)
- Generation of LAI products (based on a method developed at INRA, France, and updated, integrated to Orfeo Toolbox by CESBIO)
- A Crop mask (issued several times per year), with two different methods :
- without in situ data (method developed at UCL)
- with in-situ data (method developed at CESBIO)
- A crop type product (with a method developed at CESBIO, an early version of iota2 processor)