Skip to content

Commit 05d1995

Browse files
authored
Merge pull request #353 from azlinszkysinergise/mangrove_radar
New Mangrove Radar script
2 parents 51bc3ed + d0617c0 commit 05d1995

File tree

5 files changed

+105
-2
lines changed

5 files changed

+105
-2
lines changed
Loading
Loading
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Mangrove Radar
3+
parent: sentinel1-monthly-mosaic
4+
layout: script
5+
nav_exclude: true
6+
examples:
7+
- zoom: '9'
8+
lat: '-0.6523'
9+
lng: '-45.93109'
10+
datasetId: S1_MOSAIC
11+
fromTime: '2025-04-01T00:00:00.000Z'
12+
toTime: '2025-04-01T23:59:59.999Z'
13+
platform:
14+
- CDSE
15+
evalscripturl: https://custom-scripts.sentinel-hub.com/sentinel1-monthly-mosaic/mangrove_radar/script.js
16+
---
17+
18+
19+
## General description of the script
20+
21+
Mangrove vegetation is essential for shore protection, carbon sequestration and the maintenance of biodiversity and human livelyhoods. Tracking changes in mangrove with satellite imagery can be particularly difficult due to frequent cloud cover. Here we exploit the regular and consistent radar data provided by Sentinel-1 monthly mosaics as a source for mangrove monitoring. It seems from empirical observation that mangrove vegetation can have a slightly higher reflectivity in VV polarization than many other vegetation types. Therefore, by visualizing VV decibel gamma0 on a colour ramp, it is possible to create a color scheme where potential mangrove vegetation stands out. Of course, this visualization can also be used as a generic tool for understanding radar reflectivity of various surface types.
22+
We chose a color ramp similar to the atlas shader that is regularly used to visualize elevation - therefore it is easy to understand where high and low reflectivity is observed (and the sea is more or less blue)
23+
24+
## How to use
25+
26+
In order to set the minimum and maximum values, load a Sentinel-1 Quarterly Mosaic VV scene, apply this custom script, and create an area of interest. Use the Histogram tool to understand the distribution of backscatter values, and set min and max parameter accordingly. If necessary, you can then tweak the values in the palette - the first two categories with white color should represent mangrove.
27+
28+
## Descriptive images
29+
30+
![Mangrove area in the Sundarbans with Sentinel-1 VV db gamma0 default visualization](fig/sundarbans_vv.jpg)
31+
*Mangrove area in the Sundarbans with Sentinel-1 VV db gamma0 default visualization*
32+
33+
![Mangrove area in the Sundarbans with Mangrove Radar visualization (slightly adjusted max value)](fig/sundarbans_mangrove_radar.jpg)
34+
*Mangrove area in the Sundarbans with Mangrove Radar visualization (slightly adjusted max value)*
35+
36+
## What to do if you are concerned about protecting mangrove but don't live in an area with mangrove forests
37+
38+
- Only buy responsibly sourced seafood, especially shrimp. Shrimp farming is one of the main drivers of mangrove loss worldwide.
39+
- Reduce your carbon footprint (fly less, use a bike, use less fossil fuel based energy). The other main driver of mangrove loss is climate change and the associated sea level rise.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
//VERSION=3
2+
// Mangrove Radar Index by András Zlinszky, Sinergise Solutions
3+
// enables color palette visualization of Sentinel-1 VV backscatter
4+
// Mangrove often has a slightly higher reflectivity in Sentinel-1 VV than other vegetation. You can tune palette min and max values and individual color thresholds to find mangrove.
5+
// Note that other vegetation (eg banana plantations) and other land cover classes (eg cities) may also reflect strongly in VV, so the visualization is not selective for mangrove.
6+
7+
// set constants for the color map minimum and maximum here. These will override the values in the colormap variable, with the individual color steps scaling proportionally to their value, within the interval set by the min and max.
8+
const max = 0.87;
9+
const min = -0.05;
10+
11+
12+
// adding input data bands, defining outputs
13+
function setup() {
14+
return {
15+
input: ["VV", "dataMask"],
16+
output: [
17+
{ id: "default", bands: 4 },
18+
{ id: "eobrowserStats", bands: 1 },
19+
{ id: "dataMask", bands: 1 },
20+
{ id: "index", bands: 1, sampleType: "FLOAT32" },
21+
],
22+
};
23+
}
24+
25+
//defining the color map https://documentation.dataspace.copernicus.eu/APIs/SentinelHub/Evalscript/Functions.html#colormapvisualizer
26+
27+
const map = [
28+
[0.9, 0xf7eafd], //very light lavender
29+
[0.73, 0xebebeb], //very light grey
30+
[0.7, 0xa76b18], //brown ochre
31+
[0.65, 0xdca620], //golden yellow
32+
[0.6, 0xA2AE32], //olive green
33+
[0.4, 0x18a722], //bright green
34+
[0.3, 0x018643], //deep green
35+
[0.2, 0x15965], //teal green
36+
[0.1, 0x01471c], //very dark green
37+
[0.075, 0x0d5854], //dark turquoise
38+
[0.05, 0x7102c], //blue
39+
[0.04, 0x0d027e], //dark blue
40+
[0.01, 0x08014c], //very dark blue
41+
[0.005, 0x4a4a4a], //dark grey
42+
];
43+
44+
const visualizer = new ColorRampVisualizer(map, min, max);
45+
46+
function evaluatePixel(samples) {
47+
const value = Math.max(0, Math.log(samples.VV) * 0.21714724095 + 1);
48+
const imgVals = visualizer.process(value)
49+
return {
50+
default: [...imgVals, samples.dataMask],
51+
eobrowserStats: [value],
52+
dataMask: [samples.dataMask],
53+
index: [value],
54+
};
55+
}
56+
// This section is copied from the regular Sentinel-1 mosaics VV decibel gamma evalscript
57+
// ---
58+
/*
59+
// displays VV in decibels from -20 to 0
60+
// the following is simplified below
61+
// var log = 10 * Math.log(VV) / Math.LN10;
62+
// var val = Math.max(0, (log + 20) / 20);
63+
64+
return [Math.max(0, Math.log(VV) * 0.21714724095 + 1)];
65+
*/

sentinel1-monthly-mosaic/sentinel1-monthly-mosaic.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ Please find related resources and more information about the collection [here](h
1717

1818
- [RGB ratio](/sentinel1-monthly-mosaic/rgb_ratio)
1919
- [False Color](/sentinel2-quarterly-cloudless-mosaic/false-color)
20-
- [NDVI](/sentinel2-quarterly-cloudless-mosaic/ndvi)
21-
- [NDWI](/sentinel2-quarterly-cloudless-mosaic/ndwi)
20+
- [Mangrove Radar](/sentinel1-monthly-mosaic/mangrove_radar)

0 commit comments

Comments
 (0)