﻿{"id":16111,"date":"2025-12-15T14:06:36","date_gmt":"2025-12-15T13:06:36","guid":{"rendered":"https:\/\/www.sigterritoires.fr\/?p=16111"},"modified":"2025-12-15T14:06:36","modified_gmt":"2025-12-15T13:06:36","slug":"sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments","status":"publish","type":"post","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/","title":{"rendered":"Sentinel-2 with 1 m resolution: towards a more detailed analysis of coastal environments"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contenu <\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#The_calculated_indices\" >The calculated indices<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#NDVI_%E2%80%94_Normalized_Difference_Vegetation_Index\" >NDVI \u2014 Normalized Difference Vegetation Index<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#NDWI_%E2%80%94_Normalized_Difference_Water_Index\" >NDWI \u2014 Normalized Difference Water Index<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#MNDWI_%E2%80%94_Modified_NDWI\" >MNDWI \u2014 Modified NDWI<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#BSI_%E2%80%94_Bare_Soil_Index\" >BSI \u2014 Bare Soil Index<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#NDBI_%E2%80%94_Normalized_Difference_Built-up_Index\" >NDBI \u2014 Normalized Difference Built-up Index<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#EVI_%E2%80%94_Enhanced_Vegetation_Index\" >EVI \u2014 Enhanced Vegetation Index<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#SAVI_%E2%80%94_Soil_Adjusted_Vegetation_Index\" >SAVI \u2014 Soil Adjusted Vegetation Index<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#UI_%E2%80%94_Urban_Index_or_Urbanization_Index\" >UI \u2014 Urban Index (or Urbanization Index)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#RDI_%E2%80%94_Redness_Difference_Index\" >RDI \u2014 Redness Difference Index<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#Complete_summary_table\" >Complete summary table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#Sentinel_Index_Palette\" >Sentinel Index Palette<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#Why_use_a_cloud_mask\" >Why use a cloud mask?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#Cloud_mask_for_Sentinel-2_at_10_m\" >Cloud mask for Sentinel-2 at 10 m<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#a_Official_mask_provided_by_ESA\" >a) Official mask provided by ESA<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#b_Methods_based_on_spectral_indices\" >b) Methods based on spectral indices<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#c_Automatic_algorithms\" >c) Automatic algorithms<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#How_we_proceeded_in_the_Colab_script\" >How we proceeded in the Colab script<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#Main_steps\" >Main steps:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#Why_this_method\" >Why this method?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#Proceduree\" >Proceduree<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/sentinel-2-with-1-m-resolution-towards-a-more-detailed-analysis-of-coastal-environments\/#Conclusion_towards_integrated_processing_of_Sentinel-2_images\" >Conclusion: towards integrated processing of Sentinel-2 images<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>In two previous articles, we explored how to convert standard Sentinel-2 images (10 m resolution) to a super-resolution 1 m version using the S2DR3 module, developed for coral research in Mauritius. This step provides an unprecedented level of detail from open data, revealing fine structures that are often invisible at 10 m: seagrass beds, reef flats, sandy areas, and subtle transitions between vegetation and reef.<\/p>\n\n\n\n<p>Traditionally, spectral indices (NDVI, NDWI, MNDWI, BSI, NDBI, etc.) is done in QGIS, once the images have been downloaded and processed. However, it is often more efficient to generate these indices directly at the source, i.e., as soon as the super-resolution Sentinel-2 images are produced.<\/p>\n\n\n\n<p>This approach has several advantages:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Complete automation: the indices are calculated as soon as the dataset is created, without additional manual processing in QGIS.<\/li>\n\n\n\n<li>Spatial consistency: the indices use exactly the same radiometric corrections and super-resolution as the original bands.<\/li>\n\n\n\n<li>Time savings: no intermediate exports or manual configuration of raster algorithms.<\/li>\n\n\n\n<li>Preparation for analysis: the results can be used immediately in QGIS or any other GIS tool.<\/li>\n<\/ul>\n\n\n\n<p>The script presented below automates the entire workflow:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>downloading and super-resolution of the Sentinel-2 scene,<\/li>\n\n\n\n<li>generation of an intelligent cloud mask (excluding wave-overlap areas),<\/li>\n\n\n\n<li>direct calculation of the main spectral indices,<\/li>\n\n\n\n<li>creation of a multiband file ready for analysis.<\/li>\n<\/ol>\n\n\n\n<p>This integration greatly simplifies the transition from raw image to interpretation maps, while ensuring the reproducibility of scientific processing.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_calculated_indices\"><\/span>The calculated indices<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"NDVI_%E2%80%94_Normalized_Difference_Vegetation_Index\"><\/span>NDVI \u2014 Normalized Difference Vegetation Index<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Purpose: to measure vegetation density and health.<\/li>\n\n\n\n<li>Formula:<\/li>\n<\/ul>\n\n\n\n<p>.<\/p>\n\n\n\n\\(NDVI = \\frac{NIR &#8211; Red}{NIR + Red}\\)\n\n\n\n<p>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>NIR = near-infrared band (B08)<\/li>\n\n\n\n<li>Red = red band (B04)<\/li>\n\n\n\n<li>Values: -1 to 1; &gt;0.2 vegetation, &lt;0.1 bare soil or water.<\/li>\n\n\n\n<li>Use: vegetation monitoring, biomass estimation, agriculture.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"NDWI_%E2%80%94_Normalized_Difference_Water_Index\"><\/span>NDWI \u2014 Normalized Difference Water Index<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Purpose: detect the presence of water in the landscape.<\/li>\n\n\n\n<li>Formula:<\/li>\n<\/ul>\n\n\n\n<p>.<\/p>\n\n\n\n\\(NDWI = \\frac{Green &#8211; NIR}{Green + NIR}\\)\n\n\n\n<p>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Green = green band (B03)<\/li>\n\n\n\n<li>NIR = near-infrared band (B08)<\/li>\n\n\n\n<li>Values: positive = water, negative = soil\/vegetation.<\/li>\n\n\n\n<li>Use: mapping lakes, rivers, wetlands.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"MNDWI_%E2%80%94_Modified_NDWI\"><\/span>MNDWI \u2014 Modified NDWI<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Purpose: to better separate water from urban or built-up areas.<\/li>\n\n\n\n<li>Formula:<\/li>\n<\/ul>\n\n\n\n<p>.<\/p>\n\n\n\n\\(MNDWI = \\frac{Green &#8211; SWIR1}{Green + SWIR1}\\)\n\n\n\n<p>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SWIR1 = short wavelength band (B11)<\/li>\n\n\n\n<li>Values: positive = water; improves detection compared to NDWI.<\/li>\n\n\n\n<li>Use: monitoring water bodies in urban or coastal areas.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"BSI_%E2%80%94_Bare_Soil_Index\"><\/span>BSI \u2014 Bare Soil Index<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Purpose: to detect bare soil and denuded areas.<\/li>\n\n\n\n<li>Formula:<\/li>\n<\/ul>\n\n\n\n<p>.<\/p>\n\n\n\n\\(BSI = \\frac{(SWIR1 + Red) &#8211; (NIR + Blue)}{(SWIR1 + Red) + (NIR + Blue)}\\)\n\n\n\n<p>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Blue = blue band (B02)<\/li>\n\n\n\n<li>Red = B04, NIR = B08, SWIR1 = B11<\/li>\n\n\n\n<li>Values: the higher the BSI, the more open the surface.<\/li>\n\n\n\n<li>Use: monitoring bare soil, urban areas, mineral areas.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"NDBI_%E2%80%94_Normalized_Difference_Built-up_Index\"><\/span>NDBI \u2014 Normalized Difference Built-up Index<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Purpose: to detect built-up or impervious areas.<\/li>\n\n\n\n<li>Formula:<\/li>\n<\/ul>\n\n\n\n<p>.<\/p>\n\n\n\n\\(NDBI = \\frac{SWIR1 &#8211; NIR}{SWIR1 + NIR}\\)\n\n\n\n<p>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Values: positive = built-up, negative = vegetation or water.<\/li>\n\n\n\n<li>Use: urban mapping, monitoring of urban sprawl.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"EVI_%E2%80%94_Enhanced_Vegetation_Index\"><\/span>EVI \u2014 Enhanced Vegetation Index<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Purpose: to improve the sensitivity of NDVI in areas with very dense vegetation and correct for atmospheric effects.<\/p>\n\n\n\n<p>Formula:<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n\\(EVI = 2.5 \\cdot \\frac{NIR &#8211; Red}{NIR + 6 \\cdot Red &#8211; 7.5 \\cdot Blue + 1}\\)\n\n\n\n<p>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Blue = B02, Red = B04, NIR = B08<\/li>\n\n\n\n<li>Values: -1 to 1, similar to NDVI but more robust in dense areas.<\/li>\n\n\n\n<li>Usage: forests, tropical areas, monitoring vegetation health.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"SAVI_%E2%80%94_Soil_Adjusted_Vegetation_Index\"><\/span>SAVI \u2014 Soil Adjusted Vegetation Index<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Purpose: to measure vegetation by correcting for the effect of soil (useful in sparse areas).<\/li>\n\n\n\n<li>Formula:<\/li>\n<\/ul>\n\n\n\n<p>.<\/p>\n\n\n\n\\(SAVI = \\frac{(NIR &#8211; Red) \\cdot (1 + L)}{NIR + Red + L}\\)\n\n\n\n<p>.<\/p>\n\n\n\n<p>where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>NIR = near-infrared band (Sentinel-2 B08)<\/li>\n\n\n\n<li>Red = red band (B04)<\/li>\n\n\n\n<li>L = soil correction factor, often 0.5<\/li>\n\n\n\n<li>Values: -1 to 1, like NDVI, but less sensitive to bare soil.<\/li>\n\n\n\n<li>Use: sparse or low vegetation (grasslands, savannas, coastal areas with low vegetation cover).<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"UI_%E2%80%94_Urban_Index_or_Urbanization_Index\"><\/span>UI \u2014 Urban Index (or Urbanization Index)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Purpose: to detect and quantify urban areas.<\/li>\n\n\n\n<li>Simple formula:<\/li>\n<\/ul>\n\n\n\n<p>.<\/p>\n\n\n\n<div class=\"wp-block-math\"><math display=\"block\"><semantics><mrow><mi>U<\/mi><mi>I<\/mi><mo>=<\/mo><mfrac><mrow><mi>S<\/mi><mi>W<\/mi><mi>I<\/mi><mi>R<\/mi><mo>\u2212<\/mo><mi>N<\/mi><mi>I<\/mi><mi>R<\/mi><\/mrow><mrow><mi>S<\/mi><mi>W<\/mi><mi>I<\/mi><mi>R<\/mi><mo>+<\/mo><mi>N<\/mi><mi>I<\/mi><mi>R<\/mi><\/mrow><\/mfrac><\/mrow><annotation encoding=\"application\/x-tex\">\n\nUI = \\frac{SWIR &#8211; NIR}{SWIR + NIR}\n<\/annotation><\/semantics><\/math><\/div>\n\n\n\n<p>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SWIR = short wavelength band (Sentinel-2 B11 or B12)<\/li>\n\n\n\n<li>NIR = near infrared (B08)<\/li>\n\n\n\n<li>Values: positive for impervious or built-up areas, low\/negative for vegetation or water.<\/li>\n\n\n\n<li>Use: monitoring urbanization, detecting buildings or artificial surfaces.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"RDI_%E2%80%94_Redness_Difference_Index\"><\/span>RDI \u2014 Redness Difference Index<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Purpose: to detect bare soil or areas rich in iron oxide (\u201cred\u201d) in the landscape.<\/li>\n\n\n\n<li>Formula:<\/li>\n<\/ul>\n\n\n\n<p>.<\/p>\n\n\n\n\\(RDI = Red &#8211; Green\\)\n\n\n\n<p>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Red = red band (B04), Green = green band (B03)<\/li>\n\n\n\n<li>Values: the more \u201cred\u201d the soil, the higher the RDI.<\/li>\n\n\n\n<li>Use: monitoring erosion, bare soil, mineral or arid areas.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Complete_summary_table\"><\/span>Complete summary table<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Index<\/th><th>Objective<\/th><th>Formula<\/th><th>Typical use<\/th><\/tr><\/thead><tbody><tr><td>NDVI<\/td><td>Vegetation<\/td><td>(NIR\u2212Red)\/(NIR+Red)<\/td><td>Monitoring vegetation, agriculture<\/td><\/tr><tr><td>EVI<\/td><td>Vegetation enhanced<\/td><td>2.5*(NIR-Red)\/(NIR+6<em>Red-7.5<\/em>Blue+1)<\/td><td>Dense areas, tropical forests<\/td><\/tr><tr><td>SAVI<\/td><td>Vegetation<\/td><td>(NIR\u2212Red)*(1+L)\/(NIR+Red+L)<\/td><td>Sparse areas, visible soil<\/td><\/tr><tr><td>NDWI<\/td><td>Water<\/td><td>(Green\u2212NIR)\/(Green+NIR)<\/td><td>Mapping lakes, rivers<\/td><\/tr><tr><td>MNDWI<\/td><td>water modified<\/td><td>(Green\u2212SWIR1)\/(Green+SWIR1)<\/td><td>Water in urban or coastal areas<\/td><\/tr><tr><td>BSI<\/td><td>Bare soil<\/td><td>((SWIR1+Red)-(NIR+Blue))\/((SWIR1+Red)+(NIR+Blue))<\/td><td>Bare areas, bare soil<\/td><\/tr><tr><td>NDBI<\/td><td>Urban<\/td><td>(SWIR1\u2212NIR)\/(SWIR1+NIR)<\/td><td>Building detection, cities<\/td><\/tr><tr><td>UI<\/td><td>Urban<\/td><td>(SWIR1\u2212NIR)\/(SWIR1+NIR)<\/td><td>Urban mapping<\/td><\/tr><tr><td>RDI<\/td><td>Soil\/red<\/td><td>Red\u2212Green<\/td><td>Bare soil or iron oxide monitoring<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Sentinel_Index_Palette\"><\/span>Sentinel Index Palette<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Each index is presented with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>its name and acronym,<\/li>\n\n\n\n<li>target surface type (vegetation, water, soil, urban),<\/li>\n\n\n\n<li>typical values\/scale,<\/li>\n\n\n\n<li>representative color for map visualization (e.g., NDVI \u2192 green, NDWI \u2192 blue, BSI \u2192 light brown, etc.).<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Index<\/th><th>Type<\/th><th>Values<\/th><th>Representative color<\/th><\/tr><\/thead><tbody><tr><td>NDVI<\/td><td>Vegetation<\/td><td>-1 \u2192 1 (dark green = dense, yellow = sparse) <\/td><td>Green<\/td><\/tr><tr><td>EVI<\/td><td>Vegetation<\/td><td>-1 \u2192 1 (similar to NDVI, more sensitive)<\/td><td>Light green<\/td><\/tr><tr><td>SAVI<\/td><td>Vegetation<\/td><td>-1 \u2192 1 (soil corrected)<\/td><td>Green-yellow<\/td><\/tr><tr><td>NDWI<\/td><td>water<\/td><td>-1 \u2192 1  (positive = water)<\/td><td>Light blue<\/td><\/tr><tr><td>MNDWI<\/td><td>Modified water<\/td><td>-1 \u2192 1<\/td><td>Turquoise blue <\/td><\/tr><tr><td>BSI<\/td><td>Bare soil<\/td><td>-1 \u2192 1 (high = light soil)<\/td><td>Beige\/Brown <\/td><\/tr><tr><td>NDBI<\/td><td>Urban<\/td><td>-1 \u2192 1 (positive = built-up) <\/td><td>Light gray <\/td><\/tr><tr><td>UI<\/td><td>Urban<\/td><td>-1 \u2192 1<\/td><td>Medium gray<\/td><\/tr><tr><td>RDI<\/td><td>Soil\/red<\/td><td>variable, higher = red<\/td><td>Brick red<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_use_a_cloud_mask\"><\/span>Why use a cloud mask?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Clouds and their shadows pose problems in satellite imagery because:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>They obscure surfaces: soil, vegetation, water, coral.<\/li>\n\n\n\n<li>They distort indices (NDVI, NDWI, etc.) because the radiometric values do not correspond to the actual surface.<\/li>\n\n\n\n<li>Areas covered by clouds can generate outliers: very high or very low values, skewing trend calculations.<\/li>\n<\/ol>\n\n\n\n<p>Therefore, for index analysis and the detection of features on land or in water, it is important to mask these pixels.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Cloud_mask_for_Sentinel-2_at_10_m\"><\/span>Cloud mask for Sentinel-2 at 10 m<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Sentinel-2 offers several options for detecting clouds at its native resolution (10 m, 20 m, or 60 m depending on the band):<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"a_Official_mask_provided_by_ESA\"><\/span>a) Official mask provided by ESA<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>QA60 file in Sentinel-2 L2A products: 10 m binary mask indicating clouds and cirrus.<\/li>\n\n\n\n<li>Advantages: reliable and easy to apply.<\/li>\n\n\n\n<li>Disadvantages: coarse mask \u2192 does not always differentiate well between thin clouds and shadows.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"b_Methods_based_on_spectral_indices\"><\/span>b) Methods based on spectral indices<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SWIR and NIR bands: clouds are highly reflective in the visible spectrum but less so in SWIR.<\/li>\n\n\n\n<li>Example of a simple index:<\/li>\n<\/ul>\n\n\n\n<p>.<\/p>\n\n\n\n\\(<br>CI = \\frac{(B02 + B03 + B04)}{3} &#8211; B11<br>\\)\n\n\n\n<p>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Bright pixels in the visible spectrum and faint pixels in SWIR \u2192 probably clouds.<\/li>\n\n\n\n<li>Allows you to create a cloud mask adapted to the context, useful if you want to detect local clouds and cirrus clouds.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"c_Automatic_algorithms\"><\/span>c) Automatic algorithms<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Fmask or s2cloudless: sophisticated detection using machine learning and multispectral spectra.<\/li>\n\n\n\n<li>Useful for large time series.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_we_proceeded_in_the_Colab_script\"><\/span>How we proceeded in the Colab script<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the script, we did not use the official QA60, but rather detection by spectral indices and local texture, adapted to coastal areas and 1 m super-resolution:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Main_steps\"><\/span>Main steps:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Band normalization<\/strong> :<br> <code>blue_n = blue \/ max <\/code><br> <code>green_n = green \/ max <\/code><br> <code>red_n = red \/ max <\/code><br> <code>nir_n = nir \/ max<\/code><br><code>swir1_n = swir1 \/ max<\/code> \u2192 all values between 0 and 1 for homogeneity.<\/li>\n\n\n\n<li>\u201cInitial cloud\u201d condition based on 4 criteria :<ul><li>TVery clear in the visible (albedo_vis > 0.35) High SWIR1 (swir1_n > 0.15) High blue\/red ratio (blue_n \/ red_n > 1.2)High NIR (nir_n > 0.25)<\/li><\/ul>\u2192 pixels meeting at least 3\/4 criteria are considered clouds..<\/li>\n\n\n\n<li><strong>\u201cFoam\u201d mask for marine areas<\/strong> :\n<ul class=\"wp-block-list\">\n<li>We detect foam\/breaking waves via the local standard deviation on the blue band and visible albedo.<\/li>\n\n\n\n<li>These pixels are removed from the cloud mask : <br><code>cloud_final = cloud_init &amp; (~foam_mask)<\/code><\/li>\n\n\n\n<li>This avoids masking coral reefs or rough seas..<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Filtering small components:<\/strong> :\n<ul class=\"wp-block-list\">\n<li>Removes very small clouds that could be noise \u2192 only objects > 500 pixels are kept.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Final result<\/strong> :\n<ul class=\"wp-block-list\">\n<li><code>cloud_mask<\/code> = cleaned cloud mask, ready to be used to exclude cloudy pixels when calculating indices<strong>s<\/strong>.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_this_method\"><\/span>Why this method?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The scene is super-resolved (1 m) \u2192 the official QA60 does not exist at this resolution.<\/li>\n\n\n\n<li>The area is coastal\/coral \u2192 foam and breaking waves must be distinguished from clouds.<\/li>\n\n\n\n<li>The spectral + local texture approach allows us to:\n<ul class=\"wp-block-list\">\n<li>detect clouds<\/li>\n\n\n\n<li>avoid masking water or foam<\/li>\n\n\n\n<li>work on super-resolved images generated by S2DR3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Proceduree\"><\/span>Proceduree<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Open Google Colab: <a href=\"https:\/\/colab.research.google.com\">https:\/\/colab.research.google.com<\/a><\/p>\n\n\n\n<p>In Collab, link your notebook to your Google Drive<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"282\" data-attachment-id=\"15846\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/tutoriel-utiliser-s2dr3-dans-google-colab-pour-letude-des-coraux-a-maurice\/collab1\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?fit=2474%2C1090&amp;ssl=1\" data-orig-size=\"2474,1090\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"collab1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?fit=640%2C282&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?resize=640%2C282&#038;ssl=1\" alt=\"\" class=\"wp-image-15846\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?resize=1024%2C451&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?resize=300%2C132&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?resize=768%2C338&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?resize=1536%2C677&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?resize=2048%2C902&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab1.jpg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/figure>\n\n\n\n<p>Now, to ensure that processing does not take too long, you need to enable a GPU in the runtime environment. Look in the lower right corner of your notebook, where you will see something like \u201cPython 3\u201d with a chip icon. Click on it and select Change Runtime Environment Type. A window will open where you will need to search for Hardware Accelerator and select GPU T4. Save the changes and the notebook will automatically restart with the new configuration.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab3.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"615\" data-attachment-id=\"15847\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/tutoriel-utiliser-s2dr3-dans-google-colab-pour-letude-des-coraux-a-maurice\/collab3\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab3.jpg?fit=1402%2C1347&amp;ssl=1\" data-orig-size=\"1402,1347\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"collab3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab3.jpg?fit=640%2C615&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab3.jpg?resize=640%2C615&#038;ssl=1\" alt=\"\" class=\"wp-image-15847\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab3.jpg?resize=1024%2C984&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab3.jpg?resize=300%2C288&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab3.jpg?resize=768%2C738&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab3.jpg?w=1402&amp;ssl=1 1402w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/10\/collab3.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/figure>\n\n\n\n<p>Copy this code into a new cell in your notebook and run it:<\/p>\n\n\n\n<p><strong><div class='stb-container stb-style-black stb-caption-box'><div class='stb-caption'><div class='stb-logo'><img class='stb-logo__image' src='data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN\/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz\/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH\/w\/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA\/g88wAAKCRFRHgg\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hxARxmcLbrrrGCdGF4jihOAEKPHFCr7soJRCUIgLQOjt6bXuSWP9XKGPBLSJuPfRJU6Md2h1Db7sfM5Lfn+0buR0PK0ta52i7m3VZspO8xMmqvyHTWW3IIgrmZiepZN1cWXg8afmeezIBL4EqwNlURKKDiIepQ1B9SaI0ihrfg5gev1ToAjg4ampgMs1hDq+eeSGfPnp6021f3XHpdYOctoPFUhwEMJ9WWvqw6nwRVthOOA59MgRXnHRDvobdb59x0Hml0rq9Qr5coEEhzYWpTTBF70al7Eos1p91Aqs6YEoiyjTS6C+Fx\/agLWK7twTd2ULRz+m4yh71uzWDlK2pn6hbCriblW9Ea8zSWNkbnqW7975AG\/5\/SvYOGiYHB8j8xHKxChtkeAQQFmDMRGo0JvsqiVEW5SOQEUoFSGsQolBjCZfPnJX0TrxXqWjCQi\/ZBH7eQJKKYvP298ubXM5iPucjuoXPv7okwytS+iraiLpIC5FCChvwGiiJAGjCMGhTG\/VRxvQFqViRKUok4CJCSZC4hrBefLxR25wnZMfVTpe8znJCzsfURqUvtt1l\/5Il9knlK28\/d59D9I\/2I9WAe8ygit6ApIERW9j5kShYbUebIEYpSpgKoS0BtUGqjGAa05N5RMHPlPOP\/0v2jTyF\/WgR6EQpX7m85X3aV\/ekRXZh\/MsvzipVNHWYuIY5xxaCWXZqx+b2BKCweURVmKgjsR9qL4BosF1BAvFxGPfkPbKdeXcU\/uVTn9dZ4gKlGoH774quHs2rq9fneWdtxeFeU21Fsfbt2yg3S2YWchRcYwyhjS2NBqWjq+QNCxxwyN6diZ65vu3LPbt\/np7Zemg8WpZ2WQtIfErPtXtlezHrOHL2vCt9uzkSL0irxqsb7pkpdU5o56Y9VhbGxoweudIcJFeWGqtzEy6vH20ODl\/f27qDymTzKqklWFiCL\/8wa566U81L4G8BPL\/A+R\/BgAzCInEE2+\/LgAAAABJRU5ErkJggg==' alt='img'\/><\/div><div class='stb-caption-content'>script Colab<\/div><div class='stb-tool'><\/div><\/div><div class='stb-content'><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># =========================================================\n#   S2DR3 + Calcul indices Sentinel-2 + Masque nuages\n#   \u00c9tude des coraux \u00e0 Blue Bay \/ \u00cele aux Aigrettes\n# =========================================================\n\n# --- 1. Monter Google Drive ---\nfrom google.colab import drive\ndrive.mount('\/content\/drive')\n\n# Cr\u00e9e un dossier pour les r\u00e9sultats\n!mkdir -p \/content\/drive\/MyDrive\/Sentinel2_Coraux_S2DR3\/output\n!ln -s \/content\/drive\/MyDrive\/Sentinel2_Coraux_S2DR3\/output \/content\/output\n\n# --- 2. Installer le paquet S2DR3 ---\n!pip -q install https:\/\/storage.googleapis.com\/0x7ff601307fa5\/s2dr3-20250905.1-cp312-cp312-linux_x86_64.whl\n\n# --- 3. Importer le module principal ---\nimport s2dr3.inferutils\nimport os, glob, numpy as np, rasterio, scipy.ndimage as ndi\nfrom skimage.transform import resize\n\n# --- 4. D\u00e9finir la zone d'int\u00e9r\u00eat et la date ---\nlonlat = (57.73, -20.44)\ndate = '2025-10-09'\n\n# --- 5. Lancer le traitement S2DR3 ---\ns2dr3.inferutils.test(lonlat, date)\n\n# =========================================================\n#   6. Lecture du fichier _MS.tif\n# =========================================================\nroot_dir = '\/content\/output'\nfiles = sorted(glob.glob(os.path.join(root_dir, '**\/*_MS.tif'), recursive=True),\n               key=os.path.getmtime, reverse=True)\nif not files:\n    raise FileNotFoundError(\"&#x274c; Aucun fichier *_MS.tif trouv\u00e9 dans \/content\/output\")\nms_path = files&#091;0]\noutdir = os.path.dirname(ms_path)\nprint(f\" Fichier trouv\u00e9 : {os.path.basename(ms_path)}\")\nprint(f\" Dossier : {outdir}\")\n\n# Lecture des bandes\nwith rasterio.open(ms_path) as <a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/qgis-projections-crs\/\">src<\/a>:\n    profile = src.profile\n    n_bands = src.count\n    print(f\"Nombre de bandes d\u00e9tect\u00e9es : {n_bands}\")\n    bands = &#091;src.read(i).astype('float32') for i in range(1, n_bands+1)]\n\ndef get_band(index, name):\n    try:\n        return bands&#091;index-1]\n    except IndexError:\n        print(f\" Bande {name} manquante, remplac\u00e9e par z\u00e9ro.\")\n        return np.zeros_like(bands&#091;0])\n\n# Attribution bandes principales Sentinel-2\nblue  = get_band(1, \"B02\")\ngreen = get_band(2, \"B03\")\nred   = get_band(3, \"B04\")\nnir   = get_band(4, \"B08\")\nswir1 = get_band(9, \"B11\")\nswir2 = get_band(10, \"B12\")\n\n# =========================================================\n#   7. Calcul des indices\n# =========================================================\ndef safe_div(a, b, mask=None):\n    res = np.where((b!=0) &amp; (~np.isnan(a)) &amp; (~np.isnan(b)), a\/b, 0)\n    if mask is not None:\n        res&#091;mask] = np.nan\n    return res\n\nL = 0.5  # facteur SAVI\n\nindices = {\n    'NDVI' : safe_div(nir - red, nir + red),\n    'NDWI' : safe_div(green - nir, green + nir),\n    'MNDWI': safe_div(green - swir1, green + swir1),\n    'BSI'  : safe_div((swir1 + red) - (nir + blue), (swir1 + red) + (nir + blue)),\n    'NDBI' : safe_div(swir1 - nir, swir1 + nir),\n    'EVI'  : 2.5 * safe_div((nir - red), (nir + 6*red - 7.5*blue + 1)),\n    'SAVI' : safe_div((nir - red) * (1 + L), (nir + red + L)),\n    'UI'   : safe_div(swir1 - nir, swir1 + nir),\n    'RDI'  : safe_div(red - green, red + green)\n}\n\n# =========================================================\n#   8. Masque nuages l\u00e9ger adapt\u00e9 1 m\n# =========================================================\neps = 1e-8\nblue_n, green_n, red_n, nir_n, swir1_n = &#091;x\/(np.nanmax(x)+eps) for x in &#091;blue, green, red, nir, swir1]]\nalbedo_vis = (blue_n + green_n + red_n)\/3\n\ncond_bright = albedo_vis &gt; 0.35\ncond_swir = swir1_n &gt; 0.15\ncond_ratio = (blue_n\/(red_n+1e-6)) &gt; 1.2\ncond_nir = nir_n &gt; 0.25\ncloud_init = (cond_bright.astype(int) + cond_swir.astype(int) + cond_ratio.astype(int) + cond_nir.astype(int)) &gt;= 3\n\nMNDWI_calc = np.where((green + swir1)!=0, (green - swir1)\/(green + swir1), -1)\nwater_mask = MNDWI_calc &gt; 0\n\nsize = 7\nmean = ndi.uniform_filter(blue_n, size=size)\nmean_sq = ndi.uniform_filter(blue_n**2, size=size)\nlocal_std = np.sqrt(np.maximum(0, mean_sq - mean**2))\nfoam_mask = water_mask &amp; (albedo_vis&gt;0.25) &amp; (local_std&gt;0.03)\n\ncloud_mask = cloud_init &amp; (~foam_mask)\nlabel_im, nb = ndi.label(cloud_mask)\nsizes = ndi.sum(cloud_mask, label_im, range(1, nb+1))\nmask_keep = np.zeros(nb+1, dtype=bool)\nmask_keep&#091;1:] = sizes &gt;= 500\ncloud_mask = mask_keep&#091;label_im].astype(bool)\n\nprint(f\" Nuages finaux : {cloud_mask.sum()} pixels\")\n\n# =========================================================\n#   9. Sauvegarde indices individuels\n# =========================================================\nfor name, data in indices.items():\n    out_path = os.path.join(outdir, f\"{name}.tif\")\n    profile_idx = profile.copy()\n    profile_idx.update(dtype='float32', count=1, compress='lzw', nodata=None)\n    with rasterio.open(out_path, 'w', **profile_idx) as dst:\n        dst.write(data.astype('float32'), 1)\n    print(f\" {name} enregistr\u00e9 \u2192 {out_path}\")\n\n# =========================================================\n#   10. Cr\u00e9ation du stack multibande robuste\n# =========================================================\nall_layers = list(indices.values()) + &#091;cloud_mask.astype('float32')]\nband_names = list(indices.keys()) + &#091;'CLOUD_MASK']\n\nref_shape = indices&#091;'NDVI'].shape\nfor i, layer in enumerate(all_layers):\n    if layer.shape != ref_shape:\n        print(f\" Redimensionnement couche {band_names&#091;i]} de {layer.shape} \u2192 {ref_shape}\")\n        all_layers&#091;i] = resize(layer, ref_shape, order=0, preserve_range=True, anti_aliasing=False).astype('float32')\n\nprofile_stack = profile.copy()\nprofile_stack.update(\n    count=len(all_layers),\n    dtype='float32',\n    compress='lzw',\n    nodata=None,\n    height=ref_shape&#091;0],\n    width=ref_shape&#091;1]\n)\n\nstack_path = os.path.join(outdir, 'indices_stack.tif')\nwith rasterio.open(stack_path, 'w', **profile_stack) as dst:\n    for i, layer in enumerate(all_layers, start=1):\n        dst.write(layer.astype('float32'), i)\n        dst.set_band_description(i, band_names&#091;i-1])\n\nif os.path.exists(stack_path):\n    print(f\"\\n Fichier multibande cr\u00e9\u00e9 avec succ\u00e8s : {stack_path}\")\n    print(\" Bandes : \" + ', '.join(band_names))\nelse:\n    print(f\"\\n \u00c9chec de cr\u00e9ation de {stack_path}\")\n\nprint(\"\\n Traitement complet termin\u00e9.\")<\/code><\/pre>\n\n\n\n<p><\/div><\/div><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B-scaled.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"326\" data-attachment-id=\"16029\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/de-sentinel-2-a-1-m-de-resolution-vers-une-analyse-plus-fine-des-milieux-cotiers\/sent2b\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B-scaled.jpg?fit=2560%2C1302&amp;ssl=1\" data-orig-size=\"2560,1302\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"sent2B\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B-scaled.jpg?fit=640%2C326&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B.jpg?resize=640%2C326&#038;ssl=1\" alt=\"\" class=\"wp-image-16029\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B-scaled.jpg?resize=1024%2C521&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B-scaled.jpg?resize=300%2C153&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B-scaled.jpg?resize=768%2C391&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B-scaled.jpg?resize=1536%2C781&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B-scaled.jpg?resize=2048%2C1042&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B-scaled.jpg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2B-scaled.jpg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/figure>\n\n\n\n<p>Once executed, you will have the .tif files in your Google Drive.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2A.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"346\" data-attachment-id=\"16030\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/de-sentinel-2-a-1-m-de-resolution-vers-une-analyse-plus-fine-des-milieux-cotiers\/sent2a\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2A.jpg?fit=1754%2C948&amp;ssl=1\" data-orig-size=\"1754,948\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"sent2A\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2A.jpg?fit=640%2C346&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2A.jpg?resize=640%2C346&#038;ssl=1\" alt=\"\" class=\"wp-image-16030\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2A.jpg?resize=1024%2C553&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2A.jpg?resize=300%2C162&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2A.jpg?resize=768%2C415&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2A.jpg?resize=1536%2C830&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2A.jpg?w=1754&amp;ssl=1 1754w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/sent2A.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion_towards_integrated_processing_of_Sentinel-2_images\"><\/span>Conclusion: towards integrated processing of Sentinel-2 images<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The integration of spectral index calculation directly into the super-resolution process represents a natural evolution in Sentinel-2 data processing.<br>By automating both the generation of the 1 m image and the production of indices, we obtain a homogeneous, complete, and immediately usable dataset for spatial analysis.<\/p>\n\n\n\n<p>Applied to the coastal environments of Mauritius and Rodrigues, this method opens up new perspectives:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>monitoring of coastal vegetation and mangroves,<\/li>\n\n\n\n<li>observation of reef flats and seagrass beds,<\/li>\n\n\n\n<li>detection of areas of turbidity or siltation,<\/li>\n\n\n\n<li>mapping of land use changes in sensitive coastal areas.<\/li>\n<\/ul>\n\n\n\n<p>By combining all these steps into a single reproducible workflow, this script becomes a research and environmental monitoring tool particularly suited to tropical islands.<br>It also demonstrates that open-source tools (Sentinel-2, Google Colab, QGIS) now make it possible to achieve a level of spatial analysis that was previously reserved for professional platforms.<\/p>\n\n\n\n<p>Next step: integrate these indices into a multi-date chronological analysis to track seasonal or post-cyclonic changes in coastal habitats.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>In two previous articles, we explored how to convert standard Sentinel-2 images (10 m resolution) to a super-resolution 1 m version using the S2DR3 module, developed for coral research in Mauritius. This step provides an unprecedented&hellip;<\/p>\n","protected":false},"author":1,"featured_media":16031,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"give_campaign_id":0,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3857],"tags":[3875,3843],"class_list":["post-16111","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-iaen","tag-ia-en","tag-sentinel-2-en"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2025\/11\/Sentinel-2.jpg?fit=2126%2C1594&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p6XU0A-4bR","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/16111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/comments?post=16111"}],"version-history":[{"count":0,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/16111\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media\/16031"}],"wp:attachment":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media?parent=16111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/categories?post=16111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/tags?post=16111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}