From 7b7f85ea36f7940d213a83f3a063afd256be5a5c Mon Sep 17 00:00:00 2001 From: Charalambos Chrysostomou Date: Mon, 25 May 2026 14:08:43 +0300 Subject: [PATCH 1/4] Create srvi script.js --- sentinel-2/srvi/script.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sentinel-2/srvi/script.js diff --git a/sentinel-2/srvi/script.js b/sentinel-2/srvi/script.js new file mode 100644 index 00000000..7c71a841 --- /dev/null +++ b/sentinel-2/srvi/script.js @@ -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]; +} From c02468f29934572b5eb06968d0166e91d90213f0 Mon Sep 17 00:00:00 2001 From: Charalambos Chrysostomou Date: Mon, 25 May 2026 14:10:01 +0300 Subject: [PATCH 2/4] Create README.md --- sentinel-2/srvi/README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sentinel-2/srvi/README.md diff --git a/sentinel-2/srvi/README.md b/sentinel-2/srvi/README.md new file mode 100644 index 00000000..d7311603 --- /dev/null +++ b/sentinel-2/srvi/README.md @@ -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 From 457531c64d1f112fe84b17d775876a90afaa64be Mon Sep 17 00:00:00 2001 From: Charalambos Chrysostomou Date: Mon, 25 May 2026 14:10:45 +0300 Subject: [PATCH 3/4] Create srwi script.js --- sentinel-2/srwi/script.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sentinel-2/srwi/script.js diff --git a/sentinel-2/srwi/script.js b/sentinel-2/srwi/script.js new file mode 100644 index 00000000..e0cc6c9b --- /dev/null +++ b/sentinel-2/srwi/script.js @@ -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]; +} From 1410248123d6157591a26fe535819e71a89819de Mon Sep 17 00:00:00 2001 From: Charalambos Chrysostomou Date: Mon, 25 May 2026 14:15:50 +0300 Subject: [PATCH 4/4] Create README.md --- sentinel-2/srwi/README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sentinel-2/srwi/README.md diff --git a/sentinel-2/srwi/README.md b/sentinel-2/srwi/README.md new file mode 100644 index 00000000..b11e1837 --- /dev/null +++ b/sentinel-2/srwi/README.md @@ -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