I am trying to map small surface water bodies in a desert. The code and methodology attached. My issue is , water pixels don't cover full extent water bodies (screen shot attached) . ? What threshold values I will need so that water bodies are mapped according to their shapes/full contours/full extent? Is it possible to play with thresholds with a slider or using some other method such as histogram?
Gond Method: Gond and colleagues  developed a simple decision tree method using the VEGETATION instrument for identifying water bodies in the Sahel. This method was developed speciﬁcally to address the wide range of water body types and the variation in the surrounding landscape associated with seasonal changes in the region. First, the dierence between NDVI and the normalized dierence moisture index (NDMI) is calculated and the average is computed using a moving window of 45 pixels-squared. Next, the dierence between this average and the original dierence is calculated and pixels with a value greater than 0.08 are kept as potential water bodies. Then, a moving average of 45 pixels-squared is calculated for SWIR1 and the dierence between the average and the original SWIR1 band is calculated. Pixels with a value of 0.05 or greater are kept as potential water bodies. Finally, the two outputs are combined using an “AND” function, and any pixels that satisfy both are classiﬁed as water. One potential source of error identiﬁed in the original paper is confusion of clouds for water; the authors suggest using a separate cloud mask to address this issue. Additionally, they suggest that this method may not work on water bodies that are large enough to impact the regional average of the moving window average. The Gond  simple decision tree does not perform well in areas with dense or moist vegetation because the contrast with water is diminished. This method was developed explicitly for dryland surface water detection. https://code.earthengine.google.com/ef2360f583ae62c80be9ce2212806fbe