Skip to content

Commit e4ebd70

Browse files
authored
Feat/add quarterly s2 cloudless mosaic (#304)
* Add s2 quarterly cloudless mosaic markdown * Add s2 quarterly cloudless mosaic
1 parent 4a8954a commit e4ebd70

File tree

18 files changed

+463
-1
lines changed

18 files changed

+463
-1
lines changed

sentinel2-120m-mosaic/ndvi/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For Sentinel-2, the NDVI is calculated using NIR band 5 and red band 4:
2525

2626
NDVI = (B08 - B04) / (B08 + B04)
2727

28-
See also [this page](https://custom-scripts.sentinel-hub.com/sentinel-2/ndwi/#).
28+
See also [this page](https://custom-scripts.sentinel-hub.com/sentinel-2/ndvi/#).
2929

3030
## Description of representative images
3131

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Sentinel-2 L2A Quarterly Cloudless Mosaic - False Color
3+
parent: Sentinel-2 L2A Quarterly Cloudless Mosaic
4+
grand_parent: Sentinel
5+
layout: script
6+
permalink: /sentinel2-quarterly-cloudless-mosaic/false-color/
7+
nav_exclude: true
8+
examples:
9+
- zoom: '7'
10+
lat: '65.14407'
11+
lng: '-19.05763'
12+
datasetId: 5460de54-082e-473a-b6ea-d5cbe3c17cca
13+
fromTime: '2023-10-01T00:00:00.000Z'
14+
toTime: '2023-10-01T23:59:59.999Z'
15+
platform:
16+
- CDSE
17+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel2-quarterly-cloudless-mosaic/false-color/script.js
18+
---
19+
20+
## Collection Access
21+
22+
[Sentinel-2 L2A Quarterly Cloudless Mosaic](https://documentation.dataspace.copernicus.eu/Data/SentinelMissions/Sentinel2.html#sentinel-2-level-3-quarterly-mosaics) is one of the [Sentinel-2 products](https://documentation.dataspace.copernicus.eu/Data/SentinelMissions/Sentinel2.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 `5460de54-082e-473a-b6ea-d5cbe3c17cca`, and the collection type is `byoc-5460de54-082e-473a-b6ea-d5cbe3c17cca`.
23+
24+
## General description
25+
26+
False Color composite is a simple RGB composite with NIR band in the red channel, red band in the green channel and green band in the blue channel. The script is useful for plant density and health monitoring, as vegetation (displayed in red) heavily reflects NIR light while absorbing red. Vegetation is colored red, cities and exposed ground are grey or tan, and water appears blue or black. For Sentinel-2 L2A Quarterly Cloudless Mosaic, the bands (B08, B04, B03) are divided by 10000 to bring them back to reflectance and the [HighlightCompressVisualiser](https://docs.sentinel-hub.com/api/latest/evalscript/functions/#highlightcompressvisualizer) is applied with a minimum value of 0 and a maximum value of 0.5 for better visualisation.
27+
28+
## Description of representative images
29+
30+
False Color visualization of Iceland, 01.10.2023.
31+
32+
![Quarterly Cloudless Mosaic False Color](fig/fig1.png)
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//VERSION=3
2+
function setup() {
3+
return {
4+
input: ["B04", "B03", "B08", "dataMask"],
5+
output: { bands: 4 }
6+
};
7+
}
8+
let factor = 1 / 10000;
9+
let minVal = 0.0;
10+
let maxVal = 0.5;
11+
12+
const viz = new HighlightCompressVisualizer(minVal, maxVal);
13+
14+
function evaluatePixel(samples) {
15+
let val = [
16+
factor * samples.B08,
17+
factor * samples.B04,
18+
factor * samples.B03
19+
];
20+
let imgVals = viz.processList(val);
21+
return imgVals.concat(samples.dataMask);
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Sentinel-2 L2A Quarterly Cloudless Mosaic - NDVI
3+
parent: Sentinel-2 L2A Quarterly Cloudless Mosaic
4+
grand_parent: Sentinel
5+
layout: script
6+
permalink: /sentinel2-quarterly-cloudless-mosaic/ndvi/
7+
nav_exclude: true
8+
scripts:
9+
- - Visualization
10+
- script.js
11+
- - Copernicus Browser
12+
- cb.js
13+
- - Raw Values
14+
- raw.js
15+
examples:
16+
- zoom: '7'
17+
lat: '65.14407'
18+
lng: '-19.05763'
19+
datasetId: 5460de54-082e-473a-b6ea-d5cbe3c17cca
20+
fromTime: '2023-10-01T00:00:00.000Z'
21+
toTime: '2023-10-01T23:59:59.999Z'
22+
platform:
23+
- CDSE
24+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel2-quarterly-cloudless-mosaic/ndvi/cb.js
25+
---
26+
27+
## Collection Access
28+
29+
[Sentinel-2 L2A Quarterly Cloudless Mosaic](https://documentation.dataspace.copernicus.eu/Data/SentinelMissions/Sentinel2.html#sentinel-2-level-3-quarterly-mosaics) is one of the [Sentinel-2 products](https://documentation.dataspace.copernicus.eu/Data/SentinelMissions/Sentinel2.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 `5460de54-082e-473a-b6ea-d5cbe3c17cca`, and the collection type is `byoc-5460de54-082e-473a-b6ea-d5cbe3c17cca`.
30+
31+
## General description
32+
33+
The well known and widely used NDVI is a simple, but effective index for quantifying green vegetation. It normalizes green leaf scattering in Near Infra-red wavelengths with chlorophyll absorption in red wavelengths.
34+
35+
The value range of the NDVI is -1 to 1. Negative values of NDVI (values approaching -1) correspond to water. Values close to zero (-0.1 to 0.1) generally correspond to barren areas of rock, sand, or snow. Low, positive values represent shrub and grassland (approximately 0.2 to 0.4), while high values indicate temperate and tropical rainforests (values approaching 1). It is a good proxy for live green vegetation; see [1] for details.
36+
37+
The normalized difference vegetation index, abbreviated NDVI, is calculated using near infrared and red wavelengths.
38+
39+
NDVI = (NIR - RED) / (NIR + RED)
40+
41+
For Sentinel-2, the NDVI is calculated using NIR band 5 and red band 4:
42+
43+
NDVI = (B08 - B04) / (B08 + B04)
44+
45+
See also [this page](https://custom-scripts.sentinel-hub.com/sentinel-2/ndvi/).
46+
47+
## Description of representative images
48+
49+
NDVI of Iceland, 01.10.2023.
50+
51+
![Quarterly Cloudless Mosaic NDVI](fig/fig1.png)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//VERSION=3
2+
3+
function setup() {
4+
return {
5+
input: ["B04", "B08", "dataMask"],
6+
output: [
7+
{ id: "default", bands: 4 },
8+
{ id: "index", bands: 1, sampleType: "FLOAT32" },
9+
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" },
10+
{ id: "dataMask", bands: 1 }
11+
]
12+
};
13+
}
14+
15+
const ramp = [
16+
[-0.5, [0.05, 0.05, 0.05]],
17+
[-0.2, [0.75, 0.75, 0.75]],
18+
[-0.1, [0.86, 0.86, 0.86]],
19+
[0, [0.92, 0.92, 0.92]],
20+
[0.025, [1, 0.98, 0.8]],
21+
[0.05, [0.93, 0.91, 0.71]],
22+
[0.075, [0.87, 0.85, 0.61]],
23+
[0.1, [0.8, 0.78, 0.51]],
24+
[0.125, [0.74, 0.72, 0.42]],
25+
[0.15, [0.69, 0.76, 0.38]],
26+
[0.175, [0.64, 0.8, 0.35]],
27+
[0.2, [0.57, 0.75, 0.32]],
28+
[0.25, [0.5, 0.7, 0.28]],
29+
[0.3, [0.44, 0.64, 0.25]],
30+
[0.35, [0.38, 0.59, 0.21]],
31+
[0.4, [0.31, 0.54, 0.18]],
32+
[0.45, [0.25, 0.49, 0.14]],
33+
[0.5, [0.19, 0.43, 0.11]],
34+
[0.55, [0.13, 0.38, 0.07]],
35+
[0.6, [0.06, 0.33, 0.04]],
36+
[1, 0, 0.27, 0],
37+
];
38+
39+
const visualizer = new ColorRampVisualizer(ramp);
40+
41+
function evaluatePixel(samples) {
42+
let val = index(samples.B08, samples.B04);
43+
const imgVals = visualizer.process(val);
44+
// The library for tiffs works well only if there is only one channel returned.
45+
// So we encode the "no data" as NaN here and ignore NaNs on frontend.
46+
const indexVal = samples.dataMask === 1 ? val : NaN;
47+
48+
return {
49+
default: imgVals.concat(samples.dataMask),
50+
index: [indexVal],
51+
eobrowserStats: [val],
52+
dataMask: [samples.dataMask]
53+
};
54+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//VERSION=3
2+
3+
function setup() {
4+
return {
5+
input: ["B04", "B08"],
6+
output: {
7+
bands: 1,
8+
sampleType: "FLOAT32"
9+
}
10+
};
11+
}
12+
13+
function evaluatePixel(samples) {
14+
return [index(samples.B08, samples.B04)]
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//VERSION=3
2+
3+
function setup() {
4+
return {
5+
input: ["B04", "B08", "dataMask"],
6+
output: { bands: 4 },
7+
};
8+
}
9+
10+
const ramp = [
11+
[-0.5, [0.05, 0.05, 0.05]],
12+
[-0.2, [0.75, 0.75, 0.75]],
13+
[-0.1, [0.86, 0.86, 0.86]],
14+
[0, [0.92, 0.92, 0.92]],
15+
[0.025, [1, 0.98, 0.8]],
16+
[0.05, [0.93, 0.91, 0.71]],
17+
[0.075, [0.87, 0.85, 0.61]],
18+
[0.1, [0.8, 0.78, 0.51]],
19+
[0.125, [0.74, 0.72, 0.42]],
20+
[0.15, [0.69, 0.76, 0.38]],
21+
[0.175, [0.64, 0.8, 0.35]],
22+
[0.2, [0.57, 0.75, 0.32]],
23+
[0.25, [0.5, 0.7, 0.28]],
24+
[0.3, [0.44, 0.64, 0.25]],
25+
[0.35, [0.38, 0.59, 0.21]],
26+
[0.4, [0.31, 0.54, 0.18]],
27+
[0.45, [0.25, 0.49, 0.14]],
28+
[0.5, [0.19, 0.43, 0.11]],
29+
[0.55, [0.13, 0.38, 0.07]],
30+
[0.6, [0.06, 0.33, 0.04]],
31+
[1, 0, 0.27, 0],
32+
];
33+
34+
const visualizer = new ColorRampVisualizer(ramp);
35+
36+
function evaluatePixel(samples) {
37+
let val = index(samples.B08, samples.B04);
38+
let imgVals = visualizer.process(val);
39+
return imgVals.concat(samples.dataMask)
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Sentinel-2 L2A Quarterly Cloudless Mosaic - NDWI
3+
parent: Sentinel-2 L2A Quarterly Cloudless Mosaic
4+
grand_parent: Sentinel
5+
layout: script
6+
permalink: /sentinel2-quarterly-cloudless-mosaic/ndwi/
7+
nav_exclude: true
8+
scripts:
9+
- - Visualization
10+
- script.js
11+
- - Copernicus Browser
12+
- cb.js
13+
- - Raw Values
14+
- raw.js
15+
examples:
16+
- zoom: '7'
17+
lat: '65.14407'
18+
lng: '-19.05763'
19+
datasetId: 5460de54-082e-473a-b6ea-d5cbe3c17cca
20+
fromTime: '2023-10-01T00:00:00.000Z'
21+
toTime: '2023-10-01T23:59:59.999Z'
22+
platform:
23+
- CDSE
24+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel2-quarterly-cloudless-mosaic/ndwi/cb.js
25+
---
26+
27+
## Collection Access
28+
29+
[Sentinel-2 L2A Quarterly Cloudless Mosaic](https://documentation.dataspace.copernicus.eu/Data/SentinelMissions/Sentinel2.html#sentinel-2-level-3-quarterly-mosaics) is one of the [Sentinel-2 products](https://documentation.dataspace.copernicus.eu/Data/SentinelMissions/Sentinel2.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 `5460de54-082e-473a-b6ea-d5cbe3c17cca`, and the collection type is `byoc-5460de54-082e-473a-b6ea-d5cbe3c17cca`.
30+
31+
## General description
32+
33+
The NDWI is used to monitor changes related to water content in water bodies. As water bodies strongly absorb light in visible to infrared electromagnetic spectrum, NDWI uses green and near infrared bands to highlight water bodies. It is sensitive to built-up land and can result in over-estimation of water bodies.
34+
35+
NDWI = (GREEN - NIR) / (GREEN + NIR)
36+
37+
For Sentinel-2, the index calculates as:
38+
39+
NDWI = (B03 - B08) / (B03 + B08)
40+
41+
See also [this page](https://custom-scripts.sentinel-hub.com/sentinel-2/ndwi/).
42+
43+
## Description of representative images
44+
45+
NDWI of Iceland, 01.10.2023.
46+
47+
![Quarterly Cloudless Mosaic NDWI](fig/fig1.png)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//VERSION=3
2+
3+
function setup() {
4+
return {
5+
input: ["B03", "B08", "dataMask"],
6+
output: [
7+
{ id: "default", bands: 4 },
8+
{ id: "index", bands: 1, sampleType: "FLOAT32" },
9+
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" },
10+
{ id: "dataMask", bands: 1 }
11+
]
12+
};
13+
}
14+
15+
const colorRamp1 = [
16+
[0, 0xFFFFFF],
17+
[1, 0x008000]
18+
];
19+
const colorRamp2 = [
20+
[0, 0xFFFFFF],
21+
[1, 0x0000CC]
22+
];
23+
24+
const viz1 = new ColorRampVisualizer(colorRamp1);
25+
const viz2 = new ColorRampVisualizer(colorRamp2);
26+
27+
function evaluatePixel(samples) {
28+
let val = index(samples.B03, samples.B08);
29+
if (val < 0) {
30+
imgVals = viz1.process(-val)
31+
} else {
32+
imgVals = viz2.process(Math.sqrt(Math.sqrt(val)))
33+
}
34+
// The library for tiffs works well only if there is only one channel returned.
35+
// So we encode the "no data" as NaN here and ignore NaNs on frontend.
36+
const indexVal = samples.dataMask === 1 ? val : NaN;
37+
38+
return {
39+
default: imgVals.concat(samples.dataMask),
40+
index: [indexVal],
41+
eobrowserStats: [val],
42+
dataMask: [samples.dataMask]
43+
};
44+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//VERSION=3
2+
3+
function setup() {
4+
return {
5+
input: ["B03", "B08"],
6+
output: {
7+
bands: 1,
8+
sampleType: "FLOAT32"
9+
}
10+
};
11+
}
12+
13+
function evaluatePixel(samples) {
14+
return [index(samples.B03, samples.B08)]
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//VERSION=3
2+
3+
function setup() {
4+
return {
5+
input: ["B03", "B08", "dataMask"],
6+
output: { bands: 4 }
7+
};
8+
}
9+
10+
11+
const colorRamp1 = [
12+
[0, 0xFFFFFF],
13+
[1, 0x008000]
14+
];
15+
const colorRamp2 = [
16+
[0, 0xFFFFFF],
17+
[1, 0x0000CC]
18+
];
19+
20+
const viz1 = new ColorRampVisualizer(colorRamp1);
21+
const viz2 = new ColorRampVisualizer(colorRamp2);
22+
23+
function evaluatePixel(samples) {
24+
let val = index(samples.B03, samples.B08);
25+
if (val < 0) {
26+
imgVals = viz1.process(-val)
27+
} else {
28+
imgVals = viz2.process(Math.sqrt(Math.sqrt(val)))
29+
}
30+
return imgVals.concat(samples.dataMask);
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
layout: default
3+
title: Sentinel-2 L2A Quarterly Cloudless Mosaic
4+
nav_order: 5
5+
parent: Sentinel
6+
permalink: /sentinel/sentinel2-quarterly-cloudless-mosaic/
7+
---
8+
9+
# Sentinel-2 Quarterly Cloudless Mosaic
10+
11+
Sentinel-2 Quarterly Mosaics are mosaics generated from three months of Sentinel-2 level 2A, offering a cloudless mosaic of the whole world for 4 spectral Sentinel-2 bands (Blue, Green, Red, and NIR) and an ancillary band of observaions. The resolution of the collection is 10 meters.
12+
13+
The algorithm used to derive the product was run independently at pixel level. For each pixel, a 3-month stack of Sentinel-2 L2A `B02`, `B03`, `B04`, `B08`, and `SCL` observations was taken. The observations were marked `invalid` if the value of the Sentinel-2 L2A scene classification band (`SCL`) is one of the following values:
14+
- 1 (SATURATED_DEFECTIVE)
15+
- 3 (CLOUD_SHADOW)
16+
- 7 (CLOUD_LOW_PROBA / UNCLASSIFIED)
17+
- 8 (CLOUD_MEDIUM_PROBA)
18+
- 9 (CLOUD_HIGH_PROBA)
19+
- 10 (THIN_CIRRUS)
20+
21+
The invalid observations were removed from the stack. The number of valid observations was recorded for each pixel as the output of `observations` band. After the removal of invalid observations, each band was sorted separately and the value of the first quartile was taken as the output value in digital number (DN; `DN = reflectance * 10000`). If there is no valid observation, the output value will be `-32768` which represents no data. In this case, the `observations` band should has the value `0`.
22+
23+
24+
Please find related resources and more information about the collection [here](https://documentation.dataspace.copernicus.eu/Data/SentinelMissions/Sentinel2.html#sentinel-2-level-3-quarterly-mosaics).
25+
26+
- [True Color](/sentinel2-quarterly-cloudless-mosaic/true-color)
27+
- [False Color](/sentinel2-quarterly-cloudless-mosaic/false-color)
28+
- [NDVI](/sentinel2-quarterly-cloudless-mosaic/ndvi)
29+
- [NDWI](/sentinel2-quarterly-cloudless-mosaic/ndwi)

0 commit comments

Comments
 (0)