MAJA outputs products as a collection of directories, each of which refer to the given input L1C product, together with a log file. As an example:
SENTINEL2A_20170706-090107-511_L2A_T33KWP_C_V1-0/
SENTINEL2B_20170701-090105-359_L2A_T33KWP_C_V1-0/
S2A_MSIL1C_20170706T083601_N0205_R064_T33KWP_20170706T090107.log
S2B_MSIL1C_20170701T084019_N0205_R064_T33KWP_20170701T090105.log
..
Each product directory is named according to the sensor, date of acquisition, level, tile ID and version. It contains a collection of GeoTIFF and XML files:
- a DATA/ directory for product meta-data inherited from the L1C
- a MASK/ directory with:
- *_CLM_*.tif : the cloud mask
- *_DTF_*.tif:
- *_DFP_*.tif:
- *_EDG_*.tif : the edge mask (actual border of the image within the tile extent)
- *_IAB_*.tif : the water vapour and AOD interpolation mask
- *_MG2_*.tif : the geophysical mask
- *_SAT_*.tif : the saturation mask
- *_SRE_B*.tif : surface reflectance of band B* corrected for adjacency (divide by 10000 to convert Digit Number to surface reflectance)
- *_FRE_B*.tif : surface reflectance of band B* corrected for adjacency and topography effects (divide by 10000 to convert Digit Number to surface reflectance)
- *_ATB_*.tif : a 2-bands GeoTIFF with:
- band 1 being the water vapour (divide by 20 to convert Digit Numbers to g/cm2);
- band 2 being the Aerosol Optical Thickness (divide by 200 to convent Digit Number to AOD (-)
- *_MTD_ALL.xml : product meta-data
- *_QKL_ALL.jpg : product quicklook from bands (B4, B3, B2)
The suffix “_R1” and “_R2” relate to the 10m-resolution and the 20m-resolution bands respectively.
Product meta-data
Although each GeoTIFF surface reflectance file is self-sufficient for geolocation of the data, you will need some of the information stored in the XML meta-data file to properly use a MAJA product. Among other, the scale factor values such that <value> = <digit number> / <quantification value>, and the NODATA values:
<Radiometric_Informations>
<REFLECTANCE_QUANTIFICATION_VALUE>10000</REFLECTANCE_QUANTIFICATION_VALUE>
<WATER_VAPOR_CONTENT_QUANTIFICATION_VALUE>20</WATER_VAPOR_CONTENT_QUANTIFICATION_VALUE>
<AEROSOL_OPTICAL_THICKNESS_QUANTIFICATION_VALUE>200</AEROSOL_OPTICAL_THICKNESS_QUANTIFICATION_VALUE>
<Special_Values_List>
<SPECIAL_VALUE name="nodata">-10000</SPECIAL_VALUE>
<SPECIAL_VALUE name="water_vapor_content_nodata">0</SPECIAL_VALUE>
<SPECIAL_VALUE name="aerosol_optical_thickness_nodata">0</SPECIAL_VALUE>
</Special_Values_List>
You’ll also find quality information related eg. to the cloud cover, snow cover, hot spot detection, etc.. under the <Quality_Information> group:
<Global_Index_List>
<QUALITY_INDEX name="CloudPercent">0</QUALITY_INDEX>
<QUALITY_INDEX name="SnowPercent">0</QUALITY_INDEX>
<QUALITY_INDEX name="RainDetected">false</QUALITY_INDEX>
<QUALITY_INDEX name="HotSpotDetected">false</QUALITY_INDEX>
<QUALITY_INDEX name="SunGlintDetected">true</QUALITY_INDEX>
</Global_Index_List>
Whenever you need to trace back the version of MAJA used to process a given product, it is stored at:
<PRODUCTION_SOFTWARE>MAJA 4.6.0</PRODUCTION_SOFTWARE>
Finally, the structure of the different masks are described in the <Mask_List>
subgroup and detailed in the section below.
Product masks
Erratum : there was a mistake in the bit order of the CLM and MG2 tables below, corrected on Dec. 1st 2023
The mask layers are bitmasks, not to be confused with classified layers. Each pixel of a bitmask is a 8-bit unsigned integer which could be considered as a vector of 8 booleans (either 0 or 1). Each bit defaults to 0, unless the pixel matches a given mask category and changes to 1.
As an example, consider a cloud mask pixel whose value is 35. This integer is stored as a sequence of bits numbered from 0 to 7. It should be interpreted as follow :
Here, the pixel is affected by a cloud or a cloud shadow (bit 0), and matches the cloud category (except the thinnest) (bit 1), and was detected by the multi-temporal threshold (bit 3). This byte 00001011 is stored as a 8-bit integer of value 11 as illustrated below :
Masks bitcodes
The tables below describe the different bitmasks produces by MAJA
Bit | CLM mask description (for both R1 and R2) |
0 | all clouds except the thinnest and all shadows |
1 | all clouds (except the thinnest) |
2 | clouds detected via mono-temporal thresholds |
3 | clouds detected via multi-temporal thresholds |
4 | thinnest clouds |
5 | cloud shadows cast by a detected cloud |
6 | cloud shadows cast by a cloud outside image |
7 | high clouds detected by 1.38 µm |
Bit | MG2 mask description (for both R1 and R2) |
0 | open water |
1 | all clouds (except the thinnests) |
2 | snow |
3 | all shadows (bit 5 or bit 6 of CLM) |
4 | topographic shadows |
5 | unseen pixels due to topography |
6 | sun too low for a correct terrain correction |
7 | sun direction tangent to slope (inaccurate terrain correction) |
Bit | IAB mask (for both R1 and R2) |
0 | Water vapour content is an interpolated value |
1 | AOD is an interpolated value |
Bit | SAT R1 mask |
0 | L1C B2 value is saturated |
1 | L1C B3 value is saturated |
2 | L1C B4 value is saturated |
3 | L1C B8 value is saturated |
Bit | SAT R2 mask |
0 | L1C B5 value is saturated |
1 | L1C B6 value is saturated |
2 | L1C B7 value is saturated |
3 | L1C B8A value is saturated |
4 | L1C B11 value is saturated |
5 | L1C B12 value is saturated |