Skip to content

Commit

Permalink
Merge pull request #320 from willrayeo/sen-1-flood-vis
Browse files Browse the repository at this point in the history
Sentinel-1 flood visualisation script to add
  • Loading branch information
chorng authored Jun 20, 2024
2 parents 2264802 + e1a5799 commit 853af9d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions data-fusion/data-fusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ The combination of multiple remote sensing data sources can provide invaluable i
- [Sand-Oriented Land Cover Classification with Sentinel-1 and Sentinel-2](/data-fusion/sand-oriented_land_cover_classification_s1_s2)
- [Thermal visualization and water in wetlands with Landsat 8 L1 & L2](/data-fusion/thermal_visualization_and_water_in_wetlands)
- [Land Surface Temperature with S3 SLSTR and OLCI](/sentinel-3/land_surface_temperature)
- [Visualising floods using Sentinel-1 overlaid on Sentinel-2 imagery](/data-fusion/s1_flooding_visualisation/)
25 changes: 25 additions & 0 deletions data-fusion/s1_flooding_visualisation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Visualising floods using Sentinel-1 overlaid on Sentinel-2 imagery
parent: Data Fusion
layout: script
permalink: /data-fusion/s1_flooding_visualisation/
nav_exclude: true
---


## Authors

**Author of the datafusion script:**
- William Ray & Maxim Lamare

## Evaluate and visualize
- [EO Browser](https://sentinelshare.page.link/i2yk)

## 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.

## Description of representative images

**Flooding in the UK 28th January 2021**
![flooding](fig/fig1.jpg)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions data-fusion/s1_flooding_visualisation/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//VERSION=3
function setup() {
return {
input: [{
datasource: "S2L2A",
bands: ["B08", "B03", "B04", "CLM", "CLP"]
},
{
datasource: "S1GRD",
bands: ["VV", "VH", "dataMask"]
}
],
output: { bands: 4 },
mosaicking: "SIMPLE"
};
}

function toDB(input){
return 10 * Math.log(input)/Math.LN10;
}

function evaluatePixel(sample) {
var S1 = sample.S1GRD[0];
var S2 = sample.S2L2A[0];
if (toDB(S1.VV) <= -15){
return [S1.VV * 10, S1.VV * 10 , S1.VV * 50, 1];
} else {
const f = 2.5;
return [f*S2.B08,f*S2.B08, f*S2.B08,1]
}
}

0 comments on commit 853af9d

Please sign in to comment.