-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added details to the s-1 flood visualization script, making it compat…
…ible with CDSE and adding explanation (#324) * added copernicus browser and mosaic to s1 flood visualization * additional text and image explaining use * corrected evalscripturl * added new figure * requested changes implemented * started page for S1 mosaics * started editing custom sripts for Sentinel-1 mosaics * Add s1 mosaic collection id to layout * Automatic formatting of scripts --------- Co-authored-by: chorng <[email protected]> Co-authored-by: Jonas Viehweger <[email protected]>
- Loading branch information
1 parent
5822ea0
commit e367a11
Showing
8 changed files
with
187 additions
and
2 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
36 changes: 36 additions & 0 deletions
36
data-fusion/s1_flooding_visualisation/copernicus_browser.js
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,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]; | ||
} | ||
} |
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,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]; | ||
} | ||
} |
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,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. |
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,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); | ||
} |
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,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) |