=> Attention, il s’agit du format des données de Niveau 2A Sentinel-2 (et bientôt LANDSAT8) produites directement par le logiciel MAJA. C’est aussi le format utilisé en sortie de Sen2Agri. Attention, le format de ces mêmes données en sortie de Muscate, téléchargées sur le site de Theia est légèrement différent. Le format des données produites par l’outil SEN2COR de l’ESA est complètement différent.

Niveau 2A : Réflectances de surface et masques de nuages

Les fichiers d’un répertoire de niveau 2 produit par MAJA sont les suivants :
  • Pour Sentinel-2, les réflectances de surface sont fournies sous la forme d’un fichier GeoTiff pour les bandes à 10m (B2,B3,B4,B8), avec l’extension « _R1 » et d’un autre fichier GEOTIFF pour les bandes à 20m (B5, B6, B7, B8A, B11 et B12), avec l’extension « _R2 » . Les bandes à 60m ne sont pas fournies, elles servent à estimer les propriétés de l’atmosphère.
  • pour le moment, les fichiers de réflectance de surface sont de deux types :
    • les données se terminant par « FRE_Bx.tif » (FRE pour Flat REflectance) ont, de plus, subi une correction supplémentaire qui prend en compte les effets des pentes
    • A terme, très probablement, seuls les fichiers « FRE » seront fournis, afin de diminuer les volumes à distribuer.
    • Dans les deux cas, les données sont codées sur 16 bits et il faut diviser par 10000 pour obtenir des réflectances de surface.
    • <REFLECTANCE_QUANTIFICATION_VALUE>10000</REFLECTANCE_QUANTIFICATION_VALUE>
    • La valeur No_Data (en dehors de l’image) vaut -10000

Nous fournissons aussi les variables atmosphériques déterminées par MACCS, aux résolutions 10m (ATB_R1.tif) et 20m (ATB_R2.tif).

  • Les fichiers contiennent deux bandes codées sur 8 bits :
    • La bande 1 correspond à la vapeur d’eau, il faut diviser les valeurs par 20 pour obtenir des g/cm2 <WATER_VAPOR_CONTENT_QUANTIFICATION_VALUE>20</WATER_VAPOR_CONTENT_QUANTIFICATION_VALUE>
    • La bande 2 correspond à l’épaisseur optique des aérosols, il faut diviser les valeurs par 200 pour obtenir l’épaisseur optique <AEROSOL_OPTICAL_THICKNESS_QUANTIFICATION_VALUE>200</AEROSOL_OPTICAL_THICKNESS_QUANTIFICATION_VALUE>

Le répertoire MASK contient les informations suivantes :

Un fichier QLT à résolution 10m (QLT_R1.tif) et 20m (QLT_R2.tif) qui contient plusieurs informations :

  • Le premier plan de 8 bits contient un masque décrivant les pixels saturés pour chaque bande à 10m (B2,B3,B4,B8) ou chaque bande à 20m (B5,B6,B7,B8A, B11,B12). Une valeur à un pour le 4 bit indique que la bande B8 était saturée au niveau 1C.
  • Le second plan de 8 bits contient un masque décrivant les pixels de mauvaise qualité pour chaque bande à 10m (B2,B3,B4,B8) ou chaque bande à 20m (B5,B6,B7,B8A, B11,B12). Une valeur à un pour le 4 bit indique que la bande B8 n’est pas de bonne qualité au  N1C.
  • Un troisième plan de 8 bits dont trois bits sont utilisés :
    • Bit 0 : égal à 1 en dehors de l’image
    • Bit 1 : un plan qui indique si l’AOT a été estimée ou interpolée
    • Bit 2 : un plan qui indique si la vapeur d’eau a été calculée 0 ou interpolée 1.

Un masque de nuages à chaque résolution (CLD_R1.tif ou CLD_R2.tif)

  • bit 0 (1) :Tous nuages (sauf les plus fins), et toutes les ombres
  • bit 1 (2) : Tous nuages (sauf les plus fins)
  • bit 2 (4) : Ombres de nuages correspondant à un nuage
  • bit 3 (8) : Ombres de nuages détectées dans la zone où les nuages pourraient être hors image (moins fiable)
  • bit 4 (16) : Nuages détectés par seuil absolu dans le bleu
  • bit 5 (32) : Nuages détectés par seuil multi-temporel
  • bit 6 (64) : Nuages très fins
  • bit 7 (128) : Nuages hauts détectés par la bande 1.38 µm
  • Exemple 1 : la valeur 5 = 4+1 (00000101) indique qu’il s’agit d’une ombre (32), et le bit 1 indique qu’il s’agit soit d’une ombre, soit d’un nuage.
  • Exemple 2 : la valeur 35 = 32 + 2 +1 (00100011) indique qu’il s’agit d’un nuage détecté en multitemporel (32) et les bits 0 et 1 sont mis à 1.

Un masque géophysique :

  • bit 0 (1) : Masque d’eau
    bit 1 (2) : Zones masquées par le relief
    bit 2 (4) : Ombres topographiques
    bit 3 (8) : Soleil trop bas pour une bonne correction des pentes
    bit 4 (16) : Soleil tangent à la surface (mauvaise correction des pentes)
    bit 5 (32) : Masque de neige

  => This page describes the data format of Sentinel-2 L2A data generated by MAJA in stand alone version. It is also the data format generated within Sen2Agri system. Beware, the format of Sentinel-2A L2A products from THEIA MUSCATE processing center at CNES is different.. ESA Sen2Cor format is also completely different.

Level 2A : Surface reflectances and cloud mask

MAJA provides a folder as output, which contains the following files :

The files are as follows :
  • the surface reflectances are provided as a GeoTiff file for 10m bands (« _R1_ » file)  with 4 bands (B2, B3, B4, B8) and another GeoTiff file (« _R2_ » file) for the 20m bands (B5, B6, B7, B8A, B11 et B12) of Sentinel-2.
  • there are two types of surface reflectance files
    • the files which end with « FRE_R2.tif » (FRE for Flat REflectance) are also corrected for slope effect, which consists in suppressing the apparent reflectances variations. The corrected images look like if the land was flat.
    • After having compiled the user feedback, it is likely that we will only distribute « FRE » files to reduce the data volume.
    • In any case, the data are coded on 16bits and you have to divide by 10000 to obtain reflectances.
    • <REFLECTANCE_QUANTIFICATION_VALUE>10000</REFLECTANCE_QUANTIFICATION_VALUE>
    • The  No_Data value (outside the image) is -10000

 We also provide the values of the atmospheric variables computed by MACCS/MAJA, with a 10m resolution (ATB_R1.tif) and 20m resolution (ATB_R2.tif).

  • The files contain two bands coded on 8 bits each :
    • Band 1 is water vapour, you have to divide by 20 to obtain g/cm2  <WATER_VAPOR_CONTENT_QUANTIFICATION_VALUE>20</WATER_VAPOR_CONTENT_QUANTIFICATION_VALUE>
    • Band 2 is the Aerosol Optical Thickness, you have to divide by 200 to get the AOT. <AEROSOL_OPTICAL_THICKNESS_QUANTIFICATION_VALUE>200</AEROSOL_OPTICAL_THICKNESS_QUANTIFICATION_VALUE>

  

The mask directory provides :

A quality file QLT at 10m resolution (QLT_R1.tif) and 20m (QLT_R2.tif) which contains diverse information

  • The first 8 bit channel is a mask that flags the saturated pixels at Level 1C for each 10m band (B2,B3,B4,B8) or each 20m band(B5,B6,B7,B8A, B11,B12). If the fourth bit is 1, it means that B8 band was saturated at level 1C.
  • The second 8 bit channel is a mask that flags the bad quality pixels  for each 10m band  (B2,B3,B4,B8) or 20m band (B5,B6,B7,B8A, B11,B12).
  • A third 8 bits channel. Only the 3 first bits are used  :
    • Bit 0 : is 1, for no-data pixels, outside the image footprint
    • Bit 1 : tells if AOT was estimated (0) or interpolated (1)
    • Bit 2 : tells if water vapour was estimated (0) or interpolated (1)

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) : cloud shadows cast by a detected cloud
    bit 3 (8) : cloud shadows cast by a cloud outside image
    bit 4 (16) : clouds detected via mono-temporal thresholds
    bit 5 (32) : clouds detected via multi-temporal thresholds
    bit 6 (64) : thinnest clouds
    bit 7 (128) : high clouds detected by 1.38 µm
  • Example 1 : value 5 = 4+1 (00000101) :  bit 0 tells us a shadow or a cloud has been detected and bit 2 that it is a shadow (4),
  • Example 2 : value 35 =  32 + 2 +1 (00100011) tells us that it is a cloud (bits 1 and 2), detected by multi-temporal threshold (bit 5)

A geophysical mask MSK :

  • bit 0 (1) : Water mask
  • bit 1 (2) : Zones masked by terrain
  • bit 2 (4) : Topographic shadows
  • bit 3 (8) : Sun too low for an accurate slope correction
  • bit 4 (16) : Sun too tangent to surface for an accurate slope correction
  • bit 5 (32) : Snow mask
  • 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)

5 thoughts on “MAJA’s Native Sentinel-2 format

  1. I am very excited to see that MAJA V4 will be released soon. How will this be different to the github code / v3.3? The article mentioned it’ll be a few weeks in March 2020, can you give me more information on the release? – Currently not sure whether to begin processing using v3.3 or not!

    1. Yes, we are very late, sorry. In March we had the authorisation to make MAJA 4 open source, but we learned in June that we had to make an audit of the code, to check it does not contain code subject to incompatible licences. And we cannot also release it as excutable like the previous versions, because MAJA contains python code, which is readable.

      The audit is now done, we have a few little changes to make to clean MAJA up, and we should be able to release it in November. Although it has been considerably rewritten, MAJA 4 does not change much the results, and we have mostly preserved the interfaces. If you are in a hurry, I think you may start with MAJA 3.3.

      Best,
      Olivier

  2. Hi, congrats on the good job!

    Let me just make some comments in order to make things a bit more clear if you agree:

    1. « bit 0 (1) : all clouds except the thinnest and all shadows » -> all clouds (except the thinnest) and all shadows

    2. « Example 2 : value 35 = 32 + 2 +1 (00100011) tells us that it is a cloud (bits 1 and 2), detected by multi-temporal threshold (bit 5) », should bits 1 and 2, be corrected to 0 and 1?

    3. « 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) ».
    In this example bit 1 is zero (0). Maybe you mean bit 0 should equal to 1? Or does « 00000001 » contain a typo? Please if possible specify and be more descriptive.

    4. For bit 4 you have a different description in french (threshold in blue) and english (mono-temporal thresholds)

    Thank you once again.

    Kind Regards,
    CK

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.