-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #320 from willrayeo/sen-1-flood-vis
Sentinel-1 flood visualisation script to add
- Loading branch information
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
} | ||
} |