# Sentinel-1 and -2 Based near Real Time Inland Excess Water Mapping for Optimized Water Management
## 2 Materials and Methods
### Optical Data Based Classification  
Open water surfaces are extracted from preprocessed Sentinel-2 optical data using two different approaches. The first one applies an automatic multispectral classification based on Iterative Self-Organizing Data Analysis Technique (ISODATA) clustering [47]. The mean values of the reference permanent water bodies (see Section 2.2.3) are calculated for each Sentinel-2 band. These statistics are then compared to the statistics of the ISODATA output classes. The comparison is based on the nD similarity measurement of the spectral angle difference:  
\[cos^{-1}\left(\frac{\sum_{i=1}^{nb}t_{i}r_{i}}{\left(\sum_{i=1}^{nb}t_{i}^{2} \right)^{1/2}\left(\sum_{i=1}^{nb}r_{i}^{2}\right)^{1/2}}\right) \tag{4}\]  
where  
\(nb\) is the number of selected Sentinel-2 bands;  
\(t\) is the list of mean values of the selected Sentinel-2 bands in the examined ISODATA class;  
\(r\) is the list of mean values of the selected Sentinel-2 bands in the training pixel group. Natural breaks were identified among similarity values, which are ordered by increasing value. The most similar ISODATA classes were normally located before the first break, and they were labeled as \"water\" classes. The method requires a sufficient number of training pixels, which is sometimes difficult to acquire due to cloud cover in the optical data. Therefore, a checking and verification step was implemented in the algorithm. In case of insufficient quantity of reference data (less than 30,000 training pixels), the Sentinel-2 classification was not performed. Furthermore, if the statistics were beyond the normal range, empirically defined values for the mean of each band were used for the classification. The classified raster was reclassified to a binary map, differentiating water and non-water pixels. Optical Data Based Index Calculation and Thresholding  
The Modified Normalized Difference Water Index (MNDWI) was developed by [PERSON] [48] and is an enhanced version of the algorithm originally proposed by [PERSON] [49]. It is calculated from the green and Shortwave-Infrared (SWIR) bands, and it is one of the most popular methods to extract water from multispectral satellite imagery. The index produces positive values for the water and negative values for built-up, soil and vegetation land cover:  
\[MNDWI=\frac{\rho_{green}-\rho_{SWIR}}{\rho_{green}+\rho_{SWIR}} \tag{5}\]  
where  
\(\rho_{gran}\) and \(\rho_{SWIR}\) are the BoA reflectance of the green and SWIR bands. The SWIR band (Sentinel-2, Band 11) originally had a spatial resolution of 20 m whilst the green band (Sentinel-2, Band 3) had a resolution of 10 m. To take full advantage of the 10 m information provided by the Sentinel-2 images, a 10 m spatial resolution MNDWI was produced through resampling the 20 m resolution band during the preprocessing phase. Water bodies were mapped by a simple slicing algorithm using a suitable threshold value. In general, the MNDWI value of a pixel larger than zero was considered as water. In practice, even though atmospherically corrected, multispectral images acquired at different regions and different times always have slightly different characteristics, thus the threshold needs to be empirically adjusted for each region and acquisition date using a multiplication factor:  
\[MNDWI_{threshold}=MNDWI_{mean}-k*MNDWI_{std} \tag{6}\]  
where  
\(MNDWI_{mean}\) is the mean index value of the training samples;  
\(MNDWI_{std}\) is the standard deviation of the training samples;  
\(k\) is a multiplication factor with a default value of 1. If, due to cloud cover, the number of pixels with reference data is less than 30,000, or if the statistics are beyond the normal range, a standard value was used for the Sentinel-2 MNDWI segmentation threshold. Based on experiences of [PERSON] et al. [50], the ideal MNDWI threshold value is between 0.2-0.35. The result of the MNDWI segmentation process is a binary map, differentiating water from non-water pixels.