Water Quality¶
Module to compute water quality parameters from atmospherically corrected images.
Overview¶
The gee_acolite.water_quality module provides functions to calculate various water quality parameters using atmospherically corrected remote sensing reflectance bands. Includes:
- SPM: Suspended Particulate Matter
- Turbidity: Water turbidity
- Chlorophyll-a: Chlorophyll-a concentration
- pSDB: Pseudo-Satellite Derived Bathymetry
- Quality masks: To filter invalid pixels
Flow Diagram¶
Available Products¶
Main Functions¶
compute_water_mask
¶
Create a comprehensive water mask for quality control.
Combines multiple masking criteria to identify valid water pixels: - Water/land classification - Cirrus cloud contamination - High TOA reflectance (clouds, bright targets) - Optional cloud probability mask
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Image
|
Atmospherically corrected image with TOA and surface reflectance bands. |
required |
settings
|
dict
|
Processing settings including mask thresholds. |
required |
Returns:
| Type | Description |
|---|---|
Image
|
Binary mask where valid water pixels = 1. |
Source code in gee_acolite/water_quality.py
compute_water_bands
¶
Compute water quality parameters and add them as bands.
Applies water mask and computes selected water quality parameters based on settings configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Image
|
Atmospherically corrected image with surface reflectance bands. |
required |
settings
|
dict
|
Processing settings including 'l2w_parameters' list. |
required |
Returns:
| Type | Description |
|---|---|
Image
|
Input image with added water quality parameter bands. |
Source code in gee_acolite/water_quality.py
Individual Products¶
SPM (Suspended Particulate Matter)¶
spm_nechad2016_665
¶
Compute suspended particulate matter using Nechad et al. (2016) algorithm at 665nm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Image
|
Image with surface reflectance band 'rhos_B4' (red band at 665nm). |
required |
Returns:
| Type | Description |
|---|---|
Image
|
SPM concentration in mg/L. |
References
Nechad et al. (2016). Calibration and validation of a generic multisensor algorithm for mapping of total suspended matter in turbid waters. Remote Sensing of Environment, 159, 139-152.
Turbidity¶
tur_nechad2016_665
¶
Compute turbidity using Nechad et al. (2016) algorithm at 665nm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Image
|
Image with surface reflectance band 'rhos_B4' (red band at 665nm). |
required |
Returns:
| Type | Description |
|---|---|
Image
|
Turbidity in FNU (Formazin Nephelometric Units). |
Chlorophyll-a¶
chl_oc3
¶
Compute chlorophyll-a concentration using OC3 algorithm.
Three-band ratio algorithm using maximum of blue bands vs green. More robust than OC2 for varying water types.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Image
|
Image with surface reflectance bands 'rhos_B1', 'rhos_B2' (blue), and 'rhos_B3' (green). |
required |
Returns:
| Type | Description |
|---|---|
Image
|
Chlorophyll-a concentration in mg/m³. |
Notes
TODO: Interpolate B1 to B2 dimensions for improved accuracy.
pSDB (Pseudo-Satellite Derived Bathymetry)¶
pSDB_green
¶
Compute pseudo-Satellite Derived Bathymetry using blue-green ratio.
Implements log-ratio bathymetry algorithm using blue and green bands. Generally more sensitive in clearer waters compared to blue-red ratio.
A median filter is applied to the Rrs bands before the ratio to reduce radiometric noise, following Caballero & Stumpf (2019).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Image
|
Image with remote sensing reflectance bands 'Rrs_B2' (blue) and 'Rrs_B3' (green). |
required |
median_radius
|
int
|
Radius in pixels for the circular median kernel (default: 1 → 3×3). Set to 0 to disable smoothing. |
1
|
Returns:
| Type | Description |
|---|---|
Image
|
Pseudo-bathymetry index (higher values = shallower water). |
References
Caballero, I., & Stumpf, R. P. (2019). Retrieval of nearshore bathymetry from Sentinel-2A and 2B satellites in South Florida coastal waters. Estuarine, Coastal and Shelf Science, 226, 106277. https://doi.org/10.1016/j.ecss.2019.106277
Product Catalog¶
PRODUCTS
module-attribute
¶
PRODUCTS = {'spm_nechad2016': spm_nechad2016_665, 'spm_nechad2016_704': spm_nechad2016_704, 'spm_nechad2016_740': spm_nechad2016_740, 'tur_nechad2016': tur_nechad2016_665, 'tur_nechad2016_704': tur_nechad2016_704, 'tur_nechad2016_740': tur_nechad2016_740, 'chl_oc2': chl_oc2, 'chl_oc3': chl_oc3, 'chl_re_mishra': chl_re_mishra, 'pSDB_red': pSDB_red, 'pSDB_green': pSDB_green, 'Rrs_*': rrs}
Usage Example¶
import ee
from gee_acolite.water_quality import compute_water_bands, compute_water_mask, PRODUCTS
# Atmospherically corrected image
corrected_image = corrected_images.first()
# Create water mask
water_mask = compute_water_mask(corrected_image, settings)
# Compute all water products
water_params = compute_water_bands(
corrected_image,
settings,
products=list(PRODUCTS.keys())
)
# Apply mask
water_params_masked = water_params.updateMask(water_mask)
# Example: get only SPM and Turbidity
selected_products = compute_water_bands(
corrected_image,
settings,
products=['spm_nechad_R665', 'turbidity_dogliotti_R665']
)
# Visualize on map
Map = geemap.Map()
Map.centerObject(roi, 10)
Map.addLayer(water_params_masked.select('spm_nechad_R665'),
{'min': 0, 'max': 50, 'palette': ['blue', 'green', 'yellow', 'red']},
'SPM')
Implemented Algorithms¶
Nechad et al. (2010) - SPM¶
Empirical algorithm calibrated for optical sensors:
Where: - \(\rho_w(\lambda)\) = water reflectance - \(A_\lambda\), \(C_\lambda\) = band-specific coefficients
Dogliotti et al. (2015) - Turbidity¶
Switching algorithm for clear and turbid waters:
OC3 - Chlorophyll-a¶
Empirical algorithm based on band ratio:
Where: $$ R = \log_{10}\left(\frac{\max(Rrs_{443}, Rrs_{492})}{Rrs_{560}}\right) $$
Stumpf et al. (2003) - pSDB¶
Relative bathymetry using logarithmic ratio:
References¶
- Nechad, B., Ruddick, K. G., & Park, Y. (2010). Calibration and validation of a generic multisensor algorithm for mapping of total suspended matter in turbid waters. Remote Sensing of Environment, 114(4), 854-866.
- Dogliotti, A. I., Ruddick, K. G., Nechad, B., Doxaran, D., & Knaeps, E. (2015). A single algorithm to retrieve turbidity from remotely-sensed data in all coastal and estuarine waters. Remote Sensing of Environment, 156, 157-168.
- Stumpf, R. P., Holderied, K., & Sinclair, M. (2003). Determination of water depth with high‐resolution satellite imagery over variable bottom types. Limnology and Oceanography, 48(1part2), 547-556.