diff --git a/_layouts/script.html b/_layouts/script.html index 36fb480d..53d71727 100644 --- a/_layouts/script.html +++ b/_layouts/script.html @@ -15,6 +15,7 @@ S5_O3: S5_O3_CDAS S5_SO2: S5_SO2_CDAS S1_AWS_EW_HHHV: S1_CDAS_EW_HHHV + S1_MOSAIC: 3c662330-108b-4378-8899-525fd5a225cb ---

{{page.title}}

diff --git a/data-fusion/s1_flooding_visualisation/README.md b/data-fusion/s1_flooding_visualisation/README.md index fd26e45f..6cb8908b 100644 --- a/data-fusion/s1_flooding_visualisation/README.md +++ b/data-fusion/s1_flooding_visualisation/README.md @@ -4,6 +4,25 @@ parent: Data Fusion layout: script permalink: /data-fusion/s1_flooding_visualisation/ nav_exclude: true +scripts: + - [EO Browser, script.js] + - [Copernicus Browser, copernicus_browser.js] + - [Sentinel-2 mosaic, mosaic.js] +examples: +- zoom: '12' + lat: '51.98266' + lng: '-2.21409' + datasetId: S1GRD + fromTime: '2021-01-28T00:00:00.000Z' + toTime: '2021-01-28T23:59:59.999Z' + datasetId: S2L2A + fromTime: '2021-02-28T00:00:00.000Z' + toTime: '2021-02-28T23:59:59.999Z' + platform: + - CDSE + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/data-fusion/s1_flooding_visualisation/copernicus_browser.js + --- @@ -14,12 +33,31 @@ nav_exclude: true ## Evaluate and visualize - [EO Browser](https://sentinelshare.page.link/i2yk) + - [Copernicus Browser](https://link.dataspace.copernicus.eu/2ufw) ## General description of the script -This script can be used to visualise flood events using Sentinel-1 GRD imagery. This is especially useful for areas of interest that are affected by cloud cover (common during flood events caused by excessive rainfall). The script uses a threshold of -15 decibels to classify flooded pixels. This value can be adjusted to suit your area of interest. In addition, to help the viewer orientate themselves, a clear Sentinel-2 image is used as the basemap for this visualisation so that it can be easily interpreted where the flood extent reaches for those unfamiliar with interpreting SAR images. +This script can be used to visualise flood events using Sentinel-1 GRD imagery. This is especially useful for areas of interest that are affected by cloud cover (common during flood events caused by excessive rainfall). The script uses a threshold of -15 decibels to classify flooded pixels. This value can be adjusted to suit your area of interest using the `lim` parameter. In addition, to help the viewer orientate themselves, a clear Sentinel-2 image is used as the basemap for this visualisation so that it can be easily interpreted where the flood extent reaches for those unfamiliar with interpreting SAR images. + +### How to use + +- Select your area of interest +- From Data Collections, select `Sentinel-2 Mosaic` or `Sentinel-2 L2A`. You can choose the most recent mosaic or the one from the same season as your time of interest; if you are selecting a single image, make sure it is cloud free. +- From Layers, select Custom Script. Click the Custom Script tab, and check the `Use additional datasets (advanced)` box. Under `Additional datasets`, you will see `S-1 GRD`. Click the `+` Sign to add it. Make sure you enable orthorectification. Optionally, you can also use a speckle filter. +- Check the `Customize timespan` box and select the timeframe you are interested in (the timeframe of your flood) +- Now paste the script in the code field. Take care to use the right one, `Copernicus Browser` if you are using a single Sentinel-2 image as a background and `Sentinel-2 Mosaic` if you want the mosaic background. Then click `Refresh Evalscript`. +- If you want to adjust the brightness of the background image, change the `f` constant. It is typically around 2.5 for Sentinel-2 images and 0.0008 for Sentinel-2 mosaics, increasing the gain makes the image brighter. + +### Interpretation of results + +Flooded areas will be marked in blue. Since this is a SAR dataset, the resulting map is affected by SAR speckle. In some cases, wet vegetation fields, steep slopes facing away from the sensor, or large flat surfaces such as airports can also create low backscatter and can thus be mistaken for flooded areas. Therefore, the 3D view can also be helpful for interpreting results: flooded areas are usually in the valley bottoms. + +**Verification of flooding on a 3D image** +![Verification of flooding](fig/fig2.jpg) ## Description of representative images - + +In late 2023 and early 2024, north-western Europe experienced very high levels of rainfall, which led to widespread river flooding. This scene shows the Severn River upstream of Gloucester on 01 January 2024, with a Sentinel-2 image from 28 February 2024 as a background. + **Flooding in the UK 28th January 2021** ![flooding](fig/fig1.jpg) diff --git a/data-fusion/s1_flooding_visualisation/copernicus_browser.js b/data-fusion/s1_flooding_visualisation/copernicus_browser.js new file mode 100644 index 00000000..125566ab --- /dev/null +++ b/data-fusion/s1_flooding_visualisation/copernicus_browser.js @@ -0,0 +1,36 @@ +//VERSION=3 +function setup() { + return { + input: [ + { + datasource: "S2L2A", + bands: ["B08"], + }, + { + datasource: "S1GRD", + bands: ["VV", "dataMask"], + }, + ], + output: { bands: 4 }, + mosaicking: "SIMPLE", + }; +} + +function toDB(input) { + return (10 * Math.log(input)) / Math.LN10; +} + +//threshold value for water detection, reduce for more water, increase for less water +const lim = 15; +//gain value for image brightness (increase for brighter image) +const f = 2.5; + +function evaluatePixel(sample) { + var S1 = sample.S1GRD[0]; + var S2 = sample.S2L2A[0]; + if (toDB(S1.VV) <= -1 * lim) { + return [S1.VV * 10, S1.VV * 10, S1.VV * 50, 1]; + } else { + return [f * S2.B08, f * S2.B08, f * S2.B08, 1]; + } +} diff --git a/data-fusion/s1_flooding_visualisation/fig/fig2.jpg b/data-fusion/s1_flooding_visualisation/fig/fig2.jpg new file mode 100644 index 00000000..4b6faef5 Binary files /dev/null and b/data-fusion/s1_flooding_visualisation/fig/fig2.jpg differ diff --git a/data-fusion/s1_flooding_visualisation/mosaic.js b/data-fusion/s1_flooding_visualisation/mosaic.js new file mode 100644 index 00000000..52429fc4 --- /dev/null +++ b/data-fusion/s1_flooding_visualisation/mosaic.js @@ -0,0 +1,35 @@ +//VERSION=3 +function setup() { + return { + input: [ + { + datasource: "CUSTOM", + bands: ["B02", "B03", "B04"], + }, + { + datasource: "S1GRD", + bands: ["VV", "VH", "dataMask"], + }, + ], + output: { bands: 4 }, + mosaicking: "SIMPLE", + }; +} + +function toDB(input) { + return (10 * Math.log(input)) / Math.LN10; +} +//threshold value for water detection, reduce for more water, increase for less water +const lim = 15; +//gain value for image brightness (increase for brighter image) +const f = 0.0008; + +function evaluatePixel(sample) { + var S1 = sample.S1GRD[0]; + var S2 = sample.CUSTOM[0]; + if (toDB(S1.VV) <= -1 * lim) { + return [S1.VV * 10, S1.VV * 10, S1.VV * 50, 1]; + } else { + return [f * S2.B04, f * S2.B03, f * S2.B02, 1]; + } +} diff --git a/sentinel1-monthly-mosaic/rgb_ratio/readme.md b/sentinel1-monthly-mosaic/rgb_ratio/readme.md new file mode 100644 index 00000000..92dd42d0 --- /dev/null +++ b/sentinel1-monthly-mosaic/rgb_ratio/readme.md @@ -0,0 +1,30 @@ +--- +title: RGB Ratio Script +parent: Sentinel-1 +grand_parent: Sentinel +layout: script +permalink: /sentinel1-monthly-mosaic/rgb_ratio/ +nav_exclude: true +examples: +- zoom: '11' + lat: '53.62774' + lng: '9.61716' + datasetId: S1_MOSAIC + fromTime: '2023-09-01T00:00:00.000Z' + toTime: '2023-09-01T23:59:59.999Z' + platform: + - CDSE + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel1-monthly-mosaic/rgb_ratio/script.js +--- + +## Collection Access + +[Sentinel-1 Monthly Mosaic](https://documentation.dataspace.copernicus.eu/APIs/SentinelHub/Data/S1GRD.html) is one of the [Sentinel-1 products](https://documentation.dataspace.copernicus.eu/Data/SentinelMissions/Sentinel1.html), that is offered in [Copernicus Data Space Ecosystem](https://dataspace.copernicus.eu/). The data is accessible via [Copernicus Browser](https://browser.dataspace.copernicus.eu/). To access the data, you need a [Copernicus Data Space Ecosystem account](https://documentation.dataspace.copernicus.eu/Registration.html), and then either create a [Sentinel Hub Process API request](https://documentation.dataspace.copernicus.eu/APIs/SentinelHub/Process.html) to the collection or to visualise the data via [Copernicus Browser](https://link.dataspace.copernicus.eu/h9t). The collection ID is `3c662330-108b-4378-8899-525fd5a225cb`. + +[comment]: (and the collection type is `byoc-5460de54-082e-473a-b6ea-d5cbe3c17cca`.: # ) + +## General description of the script + +This script combines the gamma0 of the VV and VH polarizations into a false color visualization. It uses the VV polarization in the red channel, the VH polarization in the green channel, and a ratio of VH/VV in the blue channel. It shows water areas in dark red (black), urban areas in yellow, vegetated areas in turquoise, and bare ground in dark purple. + +For snowy and icy areas, the visualization can vary from light yellow to blue to red. In order not to confuse cryogenic features with non-cryogenic ones, some general information about the location is helpful in interpreting the image. \ No newline at end of file diff --git a/sentinel1-monthly-mosaic/rgb_ratio/script.js b/sentinel1-monthly-mosaic/rgb_ratio/script.js new file mode 100644 index 00000000..256a6285 --- /dev/null +++ b/sentinel1-monthly-mosaic/rgb_ratio/script.js @@ -0,0 +1,24 @@ +//VERSION=3 +function setup() { + return { + input: ["VV", "VH", "dataMask"], + output: { bands: 3 }, + }; +} + +var viz = new HighlightCompressVisualizer(0, 0.8); +var gain = 0.8; + +function evaluatePixel(sample) { + if (sample.dataMask == 0) { + return [0, 0, 0]; + } + + let vals = [ + (gain * sample.VV) / 0.28, + (gain * sample.VH) / 0.06, + (gain * sample.VH) / sample.VV / 0.49, + ]; + + return viz.processList(vals); +} diff --git a/sentinel1-monthly-mosaic/sentinel1-monthly-mosaic.md b/sentinel1-monthly-mosaic/sentinel1-monthly-mosaic.md new file mode 100644 index 00000000..1751a1c7 --- /dev/null +++ b/sentinel1-monthly-mosaic/sentinel1-monthly-mosaic.md @@ -0,0 +1,21 @@ +--- +layout: default +title: Sentinel-1 Monthly Mosaic +nav_order: 5 +parent: Sentinel +permalink: /sentinel/sentinel1-monthly-mosaic/ +--- + +# Sentinel-1 Monthly Mosaic + +Sentinel-1 Monthly mosaics are an analysis-ready product of individual Sentinel-1 acquisitions. The dataset is prepared for most populated areas of the world. Two separate data products are available: Sentinel-1 IW Monthly Mosaics for the temperate zone and the tropics with VV and VH polarization, and Sentinel-1 DH Monthly Mosaics with HH and HV polarization for the polar regions. The resolution of the collection is 20 meters. + +The algorithm used to derive the product was run independently at pixel level. For each pixel and each band, a weighted average of the pixel values was calculated. The weights were calculated based on the local resolution (the inverse of the imaged area) that particular pixel. The imaged area is a function of the sensor configuration (look angle and azimuth) and the local terrain aspect and slope. If the slope is facing towards the sensor, the imaged area is small and returned intensity will be high, while if it is facing away from the sensor, the the imaged area is large and the returned intensity will be low or even zero for radar shadows. +For more details of this correction process, visit [(Small 2012)](https://ieeexplore.ieee.org/abstract/document/6350465). + +Please find related resources and more information about the collection [here](https://documentation.dataspace.copernicus.eu/APIs/SentinelHub/Data/S1GRD.html#processing-chain). + +- [RGB ratio](/sentinel1-monthly-mosaic/rgb_ratio) +- [False Color](/sentinel2-quarterly-cloudless-mosaic/false-color) +- [NDVI](/sentinel2-quarterly-cloudless-mosaic/ndvi) +- [NDWI](/sentinel2-quarterly-cloudless-mosaic/ndwi)