Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Se2WaQ - Sentinel-2 Water Quality Script

/*
Name:    Sentinel-2 Water Quality (Se2WaQ) 
Version: 1.0
Date:    2020-01-31

Author:      Nuno Sidónio Andrade Pereira
Affiliation: Polytechnic Institute of Beja, Portugal
License:     Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)

Refs.: [1]M. Potes et al., “Use of Sentinel 2 – MSI for water quality 
          monitoring at Alqueva reservoir, Portugal,” Proc. Int. Assoc. 
          Hydrol. Sci., vol. 380, pp. 73–79, Dec. 2018.

       [2]K. Toming, T. Kutser, A. Laas, M. Sepp, B. Paavel, and T. Nõges,
          “First Experiences in Mapping Lake Water Quality Parameters with
          Sentinel-2 MSI Imagery,” Remote Sens., vol. 8, no. 8, p. 640, 
          Aug. 2016.
*/

// user defined FLAGs

var FLAGparam = 5;
var FLAGbackGround = 2;

// Water-land contrast index (to define the background)

var NDWI = index(B03, B08); 

// Background indexes                           

var Black = [0];                                       // FLAGbackGround = 0

var NDVI = index(B08, B04);                            // FLAGbackGround = 1

var TrueColor = [B04*2.5, B03*2.5, B02*2.5];           // FLAGbackGround = 2


// Empirical models

var Chl_a = 4.26 * Math.pow(B03/B01, 3.94);            // FLAGparam = 0; S2-L2A; [1] Unit: mg/m3;        

var Cya = 115530.31 * Math.pow(B03 * B04 / B02, 2.38); // FLAGparam = 1; S2-L2A; [1] Unit: 10^3 cell/ml; 

var Turb = 8.93 * (B03/B01) - 6.39;                    // FLAGparam = 2; S2-L2A; [1] Unit: NTU;          

var CDOM = 537 * Math.exp(-2.93*B03/B04);              // FLAGparam = 3; S2-L1C; [2] Unit: mg/l;         

var DOC = 432 * Math.exp(-2.24*B03/B04);               // FLAGparam = 4; S2-L1C; [2] Unit: mg/l;         

var Color = 25366 * Math.exp(-4.53*B03/B04);           // FLAGparam = 5; S2-L1C; [2] Unit: mg.Pt/l;      


// Numerical values for the scales of parameters

var scaleChl_a = [0, 6, 12, 20, 30, 50];
var scaleCya   = [0, 10, 20, 40, 50, 100];
var scaleTurb  = [0, 4, 8, 12, 16, 20];
var scaleCDOM  = [0, 1, 2, 3, 4, 5];
var scaleDOC   = [0, 5, 10, 20, 30, 40];
var scaleColor = [0, 10, 20, 30, 40, 50];

// Colors for the scales

var s = 255;
var colorScale = 
  [
   [73/s, 111/s, 242/s],
   [130/s, 211/s, 95/s],
   [254/s, 253/s, 5/s],
   [253/s, 0/s, 4/s],
   [142/s, 32/s, 38/s],
   [217/s, 124/s, 245/s]
  ];

// Image generation

if (NDWI<0) {
  if ( FLAGbackGround == 0 ) {
    return Black;
  } else if ( FLAGbackGround == 1 ) {
    return [0, .5*(NDVI+1), 0];
  } else if ( FLAGbackGround == 2 ) {
    return TrueColor;
  }
} else {
  switch ( FLAGparam ) {
    case 0:
     return colorBlend(Chl_a, scaleChl_a, colorScale);
     break;
    case 1:
      return colorBlend(Cya, scaleCya, colorScale);
      break;
    case 2:
      return colorBlend(Turb, scaleTurb, colorScale);
      break;
    case 3:
      return colorBlend(CDOM, scaleCDOM, colorScale);
      break;
    case 4:
      return colorBlend(DOC, scaleDOC, colorScale);
      break;
    case 5:
      return colorBlend(Color, scaleColor, colorScale);
      break;
    default:
      return TrueColor;
  }
}

Evaluate and Visualize

General description of the script

The Se2WaQ - Sentinel-2 Water Quality - script uses Sentinel-2 products (L1C & L2A) to display the spatial distribution of six relevant indicators of water quality: (i) the concentration of Chlorophyll a (Chl_a), (ii) the density of cyanobacteria (Cya), (iii) turbidity (turb), (iv) colored dissolved organic matter (CDOM), (v) dissolved organic carbon (DOC), and (vi) water color (Color). These indicators are used to define the trophic state on inland waters, which is particularly important when these waters are used for human consumption or leisure activities, for agriculture or industrial purposes. Last but not least, inland waters are essential for the sustainability of the biodiversity on the regions where they are located and, therefore, monitoring its quality is of the utmost importance [1-5]. The script implements empirical models that resulted from the fit of in situ data and specific Sentinel-2 spectral bands combinations [2,3]. The goal of this (basic) script is to provide a simple, but efficient tool that allows the visualization of six important water quality indicators just by simply changing one control variable in the script. Moreover, the background (defined as the region surrounding the water body), may be visualized in different modes to provide more information on the context. The equations of each model (one for each parameter) are mapped to a color scale defined in the script. The range of values for each parameter can be adjusted to provide a better contrast on the final image. The simplicity of the implementation allows further adaptations for a particular range of values for each parameter, and allows an easy exploration of combinations of parameters/backgrounds, thus providing a good tool to study the region of interest.

Details of the script

The script was developed to study inland waters (lakes and rivers), and was tested for those cases. The main limitation of the script is the fact that the ranges for each parameter have to be defined by the user, but this is exactly the idea of the script: to allow the user to explore the results as the values of the scales are changed, and to discover more structures on the images.

Author of the script

Nuno Sidónio Andrade Pereira

Description of representative images

1) Distribution of Chl_a in the Neuchatel Lake (and also Murten) on the 2019-06-29. The values close to the shore show values > 50 mg/m3. The script example 1

2) Distribution of Cya in the Alqueva Lake, in Portugal, on the 2017-10-12, during a particular dry Autumn. The lake is showing a high density of cyanobacteria (> 10^5 cells/ml), specially in the northern region. The script example 2

3) Distribution of dissolved organic carbon (DOC) in Sarygamysh Lake (Central Asia), on the 2019-07-31. We can observe the diffusion of the DOC (>40 mg/l) concentrated in a pocket close to the shore. The script example 3

4) Distribution of color dissolved organic matter (CDOM) in Kariba Lake in Africa, between Zambia and Zimbabwe, showing large areas of values above 5 mg/l. The script example 3

5) Distribution of cyanobacteria in a region of Lake Ontario, North America, on the 2019-07-26. Close to shore values are above 10^5 cells/ml. This is a good example to show how the script deals with the presence of clouds. The script example 3

References

[1] J. Gower, S. King, and P. Goncalves, ìGlobal monitoring of plankton blooms using MERIS MCI,î Int. J. Remote Sens., vol. 29, no. 21, pp. 6209ñ6216, Nov. 2008.

[2] K. Toming, T. Kutser, A. Laas, M. Sepp, B. Paavel, and T. Nıges, ìFirst Experiences in Mapping Lake Water Quality Parameters with Sentinel-2 MSI Imagery,î Remote Sens., vol. 8, no. 8, p. 640, Aug. 2016.

[3] M. Potes et al., ìUse of Sentinel 2-MSI for water quality monitoring at Alqueva reservoir, Portugal,î Proc. Int. Assoc. Hydrol. Sci., vol. 380, pp. 73ñ79, Dec. 2018.

[4] M. Potes, M. J. Costa, J. C. B. da Silva, A. M. Silva, and M. Morais, ìRemote sensing of water quality parameters over Alqueva reservoir in the south of Portugal,î Int. J. Remote Sens., vol. 32, no. 12, pp. 3373ñ3388, 2011.

[5] M. Potes, M. J. Costa, and R. Salgado, ìSatellite remote sensing of water turbidity in Alqueva reservoir and implications on lake modelling,î Hydrol. Earth Syst. Sci., vol. 16, no. 6, pp. 1623ñ1633, Jun. 2012.

Credits

The equations from the empirical models implemented in the script are presented in the following papers (References [2], and [3], respectively):

  • K. Toming, T. Kutser, A. Laas, M. Sepp, B. Paavel, and T. Nıges, ìFirst Experiences in Mapping Lake Water Quality Parameters with Sentinel-2 MSI Imagery,î Remote Sens., vol. 8, no. 8, p. 640, Aug. 2016.

  • M. Potes et al., ìUse of Sentinel 2-MSI for water quality monitoring at Alqueva reservoir, Portugal,î Proc. Int. Assoc. Hydrol. Sci., vol. 380, pp. 73ñ79, Dec. 2018.