Methodology
How AquaLens reads water from space.
Two parts work in turn. A deterministic core takes a Sentinel-2 image of the area, finds the water in it, measures chlorophyll, turbidity and plants on the water, and turns them into a 0–100 score. The same image always gives the same score, and it is unit-tested. Then five Gemini agents add context and write the brief and the public summary. They never change the score. Every step is recorded.
In short
- 1 Find the newest satellite photo that sees the water clearly.
- 2 Find the water in it, leaving out land, cloud and the shoreline.
- 3 Read its colour: green means algae, brown means mud, leaves mean plants.
- 4 Place the algae on the WHO alert levels: Low, Medium or High, as a 0–100 score.
- 5 AI agents add history and write the summary; they cannot change the result.
The image
AquaLens searches the Microsoft Planetary Computer for sentinel-2-l2a scenes that cover the area within the chosen dates and have under 30% cloud over the whole scene (you can change the limit). A scene is about 110 km across, so its cloud figure says little about one lake: AquaLens reads the scene's own cloud map (the SCL band) over the area and takes the newest scene with a clear view of it. When every scene is cloud over the area, there is no score, and the page says so.
Pixels the SCL marks as cloud, cloud shadow or thin cirrus (classes 3, 8, 9, 10) are removed. How much of the water that leaves is reported as confidence, not added to the score. Bands B02, B03, B04, B05, B08 and B11 are read as Cloud-Optimized GeoTIFFs, clipped to the area, with the 20 m bands aligned to the 10 m grid.
The monthly trend on a water body's page works differently: for each month it takes the scene with the least cloud that sees the water.
Finding the water
A pixel is water when NDWI > 0 and MNDWI > 0. Each test alone mistakes some land for water (NDWI some roofs and shadow, MNDWI some bright soils); together they keep open water. A water pixel next to land mixes both, which reads as extra chlorophyll at every shore, so those pixels are left out unless fewer than 50 would remain (a river reach or a small pond). Each index is then the median over the scored pixels, which a few glinting or mixed pixels cannot move. A pixel where one of an index's bands reads at or below zero (very dark water, under the sensor's floor) is left out of that index, because the ratio there is exactly +1 or −1 whatever the water holds.
Fewer than 50 scored water pixels (0.5 ha) is too little to score: the assessment says so, and no alert or sampling advice is based on it.
The six indices
Each is a normalised ratio of two or more bands, computed per pixel. Three enter the score; two decide where the water is; one is shown for reference.
Normalized Difference Water Index
NDWIWater test · B03 · B08 · McFeeters (1996)
(Green − NIR) / (Green + NIR)
Where the water is: water reflects more green than near-infrared light. Half of the water test.
Modified NDWI
MNDWIWater test · B03 · B11 · Xu (2006)
(Green − SWIR) / (Green + SWIR)
Where the water is, using short-wave infrared, so roofs and roads are not taken for water. The other half of the water test.
Normalized Difference Chlorophyll Index
NDCIIn the score · B05 · B04 · Mishra & Mishra (2012)
(Red edge − Red) / (Red edge + Red)
Chlorophyll-a, the sign of algae. Converted to µg/L and placed on the WHO alert levels.
Normalized Difference Turbidity Index
NDTIIn the score · B04 · B03 · Lacaux et al. (2007)
(Red − Green) / (Red + Green)
Turbidity: murky water reflects more red, often from suspended sediment.
Normalized Difference Vegetation Index
NDVIIn the score · B08 · B04 · Rouse et al. (1974)
(NIR − Red) / (NIR + Red)
Plants on the water: floating biomass or weed growing into the lake, read over the water only.
Water Ratio Index
WRIShown only · B03 · B04 · B08 · B11
(Green + Red) / (NIR + SWIR)
A further water signal, shown for reference; above about 2.5 usually means open water. Not in the score.
The score
The score is the larger of two readings of the same water, so either can raise it and neither can hide the other.
1. Chlorophyll on the WHO alert levels
Chlorophyll-a is estimated from NDCI with Mishra & Mishra (2012):
Chl-a (µg/L) = 14.039 + 86.115·NDCI + 194.325·NDCI²
It is placed on the WHO (2021) recreational alert levels: 12 µg/L (alert level 1) is where medium starts, 24 µg/L (alert level 2) where high starts, and 48 µg/L the top of the scale. This is the part a laboratory can check; the Verified page shows how it compares with lab samples.
2. Weighted indices
Each index is scaled from 0 to 1 across its range, then weighted. Turbidity or plants can raise the score above the chlorophyll reading; they never lower it.
- NDCI (chlorophyll-a)
- 0.533 · range -0.1 to 0.5
- NDTI (turbidity)
- 0.333 · range -0.2 to 0.6
- NDVI over the water (plants)
- 0.133 · range 0 to 0.6
Verified field observations (from the operator or an organisation's API key) add up to 50 points. On a public service, anonymous ones are kept but do not move the score until the operator confirms them. The result is clamped to 0–100. Below 33 is low, below 66 medium, the rest high. Urgency follows the level and the latest observation: algae seen, 5 or more dead fish or 3 or more complaints raise it.
Confidence
Confidence says how well the satellite saw the water. It never changes the score. It starts at high and drops one step for each of: more than 30% of the area under cloud; short-wave infrared over the water above 0.03 (sun glint, haze or a surface film); only shoreline pixels to score; and a 90% interval on the score wider than 10 points (from resampling the pixels). One problem gives medium, two or more low.
That pixel interval is narrow because neighbouring pixels are alike. Lab tests are the real check: on 174 lab samples from western Lake Erie, the algae part of the score was within 24 points of the lab on 64% of them and read 11 points low on average, so each result shows that figure as its lab-checked accuracy. The level says where to sample first; it is not a lab result.
What the agents may do
Once the score is set, five Gemini agents take the result: they choose which specialists run, name the place, add history and local reporting, and write the brief and the public summary. Each works under a written brief and a structured output that forbids overclaiming. None can change the score, level or urgency.
Every step is kept in the assessment's trace (Agent decisions). When an agent fails, the failure stays in the trace and a deterministic text takes its place, so every assessment still has a brief and a summary.