Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions sentinel-2/srvi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Symbolic Regression Vegetation Index
parent: Sentinel-2
grand_parent: Sentinel
layout: script
permalink: /sentinel-2/srvi/
nav_exclude: true
examples:
- zoom: 11
lat: 34.7
lng: 33.0
datasetId: S2L2A
fromTime: '2026-03-01'
toTime: '2026-03-15'
platform: CDSE
evalscripturl: https://raw.githubusercontent.com/c-chrysostomou/custom-scripts/master/sentinel-2/srvi/script.js
---

# Symbolic Regression Vegetation Index (SRVI)

## General description of the script
The Symbolic Regression Vegetation Index (SRVI) is a 4-band index optimized for global vegetation mapping. It was discovered using a data-driven symbolic regression framework designed to improve vegetation separability across diverse biomes and preserve sensitivity in high-biomass, saturated regions.

The index formula utilizes Green (B03), Red (B04), NIR (B08), and SWIR1 (B11) bands:

$$SRVI = \frac{2.0 \cdot N - 3.0 \cdot R}{N + R + 0.5 \cdot (G + S1)}$$

## References
[1] Chrysostomou, C., Neophytides, S.P., Mavrovouniotis, M. et al. Optimized spectral indices for global vegetation and water mapping using Sentinel-2. Sci Rep 16, 4491 (2026). https://doi.org/10.1038/s41598-025-34720-x
28 changes: 28 additions & 0 deletions sentinel-2/srvi/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// //info
// VERSION: 3
// Name: Symbolic Regression Vegetation Index (SRVI)
// Description: Optimized spectral index for global vegetation mapping discovered via symbolic regression.
// Reference: Chrysostomou, C., Neophytides, S.P., Mavrovouniotis, M. et al. Optimized spectral indices for global vegetation and water mapping using Sentinel-2. Sci Rep 16, 4491 (2026).
// DOI: https://doi.org/10.1038/s41598-025-34720-x

function setup() {
return {
input: ["B03", "B04", "B08", "B11", "dataMask"],
output: { bands: 4 }
};
}

function evaluatePixel(samples) {
let G = samples.B03; // Green
let R = samples.B04; // Red
let N = samples.B08; // NIR
let S1 = samples.B11; // SWIR1

let denominator = N + R + 0.5 * (G + S1);
let srvi = (denominator !== 0) ? (2.0 * N - 3.0 * R) / denominator : 0;

let visual = (srvi + 1.5) / 3.5;
visual = Math.max(0, Math.min(1, visual));

return [0, visual, 0, samples.dataMask];
}
29 changes: 29 additions & 0 deletions sentinel-2/srwi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Symbolic Regression Water Index
parent: Sentinel-2
grand_parent: Sentinel
layout: script
permalink: /sentinel-2/srwi/
nav_exclude: true
examples:
- zoom: 11
lat: 34.7
lng: 33.0
datasetId: S2L2A
fromTime: '2026-03-01'
toTime: '2026-03-15'
platform: CDSE
evalscripturl: https://raw.githubusercontent.com/c-chrysostomou/custom-scripts/master/sentinel-2/srwi/script.js
---

# Symbolic Regression Water Index (SRWI)

## General description of the script
The Symbolic Regression Water Index (SRWI) is a 4-band spectral index optimized for accurate and consistent surface water mapping. Discovered via symbolic regression, it effectively addresses common classification challenges, reducing false positives caused by mountain shadows and complex urban surfaces.

The index formula utilizes Blue (B02), Green (B03), NIR (B08), and SWIR1 (B11) bands:

$$SRWI = \frac{(G + B) - (N + S1)}{(G + B) + (N + S1)}$$

## References
[1] Chrysostomou, C., Neophytides, S.P., Mavrovouniotis, M. et al. Optimized spectral indices for global vegetation and water mapping using Sentinel-2. Sci Rep 16, 4491 (2026). https://doi.org/10.1038/s41598-025-34720-x
29 changes: 29 additions & 0 deletions sentinel-2/srwi/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// //info
// VERSION: 3
// Name: Symbolic Regression Water Index (SRWI)
// Description: Optimized spectral index for consistent surface water delineation discovered via symbolic regression.
// Reference: Chrysostomou, C., Neophytides, S.P., Mavrovouniotis, M. et al. Optimized spectral indices for global vegetation and water mapping using Sentinel-2. Sci Rep 16, 4491 (2026).
// DOI: https://doi.org/10.1038/s41598-025-34720-x

function setup() {
return {
input: ["B02", "B03", "B08", "B11", "dataMask"],
output: { bands: 4 }
};
}

function evaluatePixel(samples) {
let B = samples.B02; // Blue
let G = samples.B03; // Green
let N = samples.B08; // NIR
let S1 = samples.B11; // SWIR1

let numerator = (G + B) - (N + S1);
let denominator = (G + B) + (N + S1);
let srwi = (denominator !== 0) ? numerator / denominator : 0;

let visual = (srwi + 1.0) / 2.0;
visual = Math.max(0, Math.min(1, visual));

return [0, 0, visual, samples.dataMask];
}