Skip to content

Commit b23c2b5

Browse files
Merge pull request #340 from azlinszkysinergise/andras-experimenting
Andras experimenting
2 parents 7ad44c1 + c22a3c2 commit b23c2b5

File tree

8 files changed

+269
-1
lines changed

8 files changed

+269
-1
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
source 'https://rubygems.org'
2+
23
gem "github-pages", "232", group: :jekyll_plugins
34
gem "just-the-docs", "0.9.0"
45
gem "webrick"

_layouts/script.html

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
S1_AWS_EW_HHHV: S1_CDAS_EW_HHHV
1818
S1_MOSAIC: 3c662330-108b-4378-8899-525fd5a225cb
1919
DEM_MAPZEN: DEM_COPERNICUS_30_CDAS
20+
2021
---
2122

2223
<h1 class="d-inline" id={{page.slug}}> {{page.title}} </h1>

dem/dem-central-europe/index.md

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
title: DEM colormap for Central Europe
3+
parent: dem
4+
layout: script
5+
nav_exclude: true
6+
examples:
7+
- zoom: '7'
8+
lat: '47.2233'
9+
lng: '21.57715'
10+
datasetId: DEM
11+
fromTime: '2020-07-12T00:00:00.000Z'
12+
toTime: '2020-07-12T23:59:59.999Z'
13+
platform:
14+
- CDSE
15+
- EOB
16+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/dem/dem-central-europe/script.js
17+
---
18+
19+
This color ramp is defined to make interpreting topography on the Copernicus 30 DEM in Central Europe easy. Therefore, it runs between -200 and 3500 m above sea level. It uses classical colours typical for elevation maps: brown and white for high mountains and greens for lowland areas. Note that since the Copernicus 30 DEM does not include a seafloor model, the elevations below 0 m ASL are not used.
20+
21+
## Example location
22+
23+
The example is a site near Kosice, Slovakia, showing an elevation gradient between the Zemplín mountains and the Ondava river floodplain
24+
25+
```yaml
26+
examples:
27+
- zoom: '11'
28+
lat: '48.81432'
29+
lng: '21.52702'
30+
datasetId: DEM
31+
fromTime: '2020-07-12T00:00:00.000Z'
32+
toTime: '2020-07-12T23:59:59.999Z'
33+
platform:
34+
- CDSE
35+
- EOB
36+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/dem/dem-central-europe/script.js
37+
```
38+
39+
40+
## General description of the script
41+
42+
43+
44+
## Color Table
45+
46+
<table>
47+
<tr>
48+
<th>Value</th>
49+
<th>Color Code</th>
50+
<th>Color Patch</th>
51+
</tr>
52+
<tr>
53+
<td>3500</td>
54+
<td>#f7eafd</td>
55+
<td style="background-color: #f7eafd;"></td>
56+
</tr>
57+
<tr>
58+
<td>3000</td>
59+
<td>#ebebeb</td>
60+
<td style="background-color: #ebebeb;"></td>
61+
</tr>
62+
<tr>
63+
<td>1000</td>
64+
<td>#a76b18</td>
65+
<td style="background-color: #a76b18;"></td>
66+
</tr>
67+
<tr>
68+
<td>500</td>
69+
<td>#dca620</td>
70+
<td style="background-color: #dca620;"></td>
71+
</tr>
72+
<tr>
73+
<td>200</td>
74+
<td>#A2AE32</td>
75+
<td style="background-color: #A2AE32;"></td>
76+
</tr>
77+
<tr>
78+
<td>100</td>
79+
<td>#18a722</td>
80+
<td style="background-color: #18a722;"></td>
81+
</tr>
82+
<tr>
83+
<td>50</td>
84+
<td>#018643</td>
85+
<td style="background-color: #018643;"></td>
86+
</tr>
87+
<tr>
88+
<td>30</td>
89+
<td>#015965</td>
90+
<td style="background-color: #015965;"></td>
91+
</tr>
92+
<tr>
93+
<td>10</td>
94+
<td>#01471c</td>
95+
<td style="background-color: #01471c;"></td>
96+
</tr>
97+
<tr>
98+
<td>0</td>
99+
<td>#bbbcbc</td>
100+
<td style="background-color: #bbbcbc;"></td>
101+
</tr>
102+
<tr>
103+
<td>-10</td>
104+
<td>#2754de</td>
105+
<td style="background-color: #2754de;"></td>
106+
</tr>
107+
<tr>
108+
<td>-20</td>
109+
<td>#0d027e</td>
110+
<td style="background-color: #0d027e;"></td>
111+
</tr>
112+
<tr>
113+
<td>-50</td>
114+
<td>#08014c</td>
115+
<td style="background-color: #08014c;"></td>
116+
</tr>
117+
<tr>
118+
<td>-200</td>
119+
<td>#4a4a4a</td>
120+
<td style="background-color: #4a4a4a;"></td>
121+
</tr>
122+
</table>
123+
124+
## Author of the script
125+
126+
András Zlinszky, Sinergise

dem/dem-central-europe/script.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//VERSION=3
2+
// To set custom max and min values, set
3+
// choose your max and min values.
4+
// The color map will then be scaled
5+
// to those max and min values
6+
const max = 3500;
7+
const min = -200;
8+
9+
function setup() {
10+
return {
11+
input: ["DEM", "dataMask"],
12+
output: [
13+
{ id: "default", bands: 4, sampleType: "AUTO" },
14+
{ id: "index", bands: 1, sampleType: "FLOAT32" },
15+
{ id: "dataMask", bands: 1 },
16+
],
17+
};
18+
}
19+
20+
const map = [
21+
[3500, 0xf7eafd],
22+
[3000, 0xebebeb],
23+
[1000, 0xa76b18],
24+
[500, 0xdca620],
25+
[200, 0xA2AE32],
26+
[100, 0x18a722],
27+
[50, 0x018643],
28+
[30, 0x15965],
29+
[10, 0x01471c],
30+
[0, 0xbbbcbc],
31+
[-10, 0x2754de],
32+
[-20, 0x0d027e],
33+
[-50, 0x08014c],
34+
[-200, 0x4a4a4a],
35+
];
36+
37+
const visualizer = new ColorRampVisualizer(map, min, max);
38+
39+
function evaluatePixel(samples) {
40+
const imgVals = visualizer.process(samples.DEM)
41+
42+
// Return the 4 inputs and define content for each one
43+
return {
44+
default: [...imgVals, samples.dataMask],
45+
index: [samples.DEM],
46+
dataMask: [samples.dataMask],
47+
}
48+
}
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: NO2 Monthly mean
3+
parent: Sentinel-5p
4+
grandparent: Sentinel
5+
layout: script
6+
permalink: /sentinel-5p/no2_monthly_mean/
7+
nav_exclude: true
8+
examples:
9+
- zoom: '8'
10+
lat: '46.60228'
11+
lng: '15.17212'
12+
datasetId: S5_NO2
13+
fromTime: '2024-12-28T00:00:00.000Z'
14+
toTime: '2025-01-28T23:59:59.999Z'
15+
platform:
16+
- CDSE
17+
- EOB
18+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel/sentinel-5p/no2_monthly_mean/script.js
19+
---
20+
21+
## General description of the script
22+
23+
This script calculates the mean values of NO<sub>2</sub> over the time period you select. It is useful for visualizing large-scale patterns of air pollution.
24+
In order to comply with the SI unit definitions, the TROPOMI NO2 data product gives trace gas concentrations in mol/m<sup>2</sup>.
25+
26+
Cloud-affected pixels are masked from Sentinel-5P air pollution imagery, you will see them as empty pixels on the map. Due to the relatively low resolution of Sentinel-5P TROPOMI, these datasets work best at regional to continental scale, however, at such scales it is extremely rare to encounter an image that is not influenced by clouds. Therefore, similar to [Sentinel-2 quarterly mosaics](https://dataspace.copernicus.eu/news/2024-2-27-exploring-new-frontier-sentinel-cloudless-mosaics-copernicus-data-space-ecosystem), creating longer-term mean mosaics of Sentinel-5P data enables exploring pollution patterns across regions.
27+
28+
The script is written to work for NO2, but can be used for other Sentinel-5P data layers as well by manually changing the variable "NO2" in the setup function and in the sum(array) function.
29+
30+
## Representative image
31+
32+
This image shows the monthly mean NO2 concentration for January 2024 over Central Europe. You can see the major urban centers of Northern Germany, Belgieum and the Netherlands, the Rhine valley, the Czech basin, and the high pollutant concentration in the Po valley.
33+
34+
View in Copernicus Browser [here](https://tinyurl.com/europesen5p)
35+
36+
!['Sentinel-5 N02 monthly mean over Central Europe, January 2024, ](.\img\sentinel_5p_monthly_NO2_europe_2024_jan.jpg)
37+
38+
## References
39+
40+
- [Sentinel-5P TROPOMI NO2 data products Algorithm Theoretical Basis Document](https://sentiwiki.copernicus.eu/__attachments/1673595/S5P-KNMI-L2-0005-RP%20-%20Sentinel-5P%20TROPOMI%20ATBD%20NO2%20data%20products%202022%20-%202.4.0.pdf?inst-v=9aab56a9-2b0f-4066-9dbe-4985b055a039)
Loading
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//VERSION=3
2+
// By Jonas Viehweger, Sinergise
3+
4+
var minVal = 0.0;
5+
var maxVal = 0.0001;
6+
const map = [
7+
[0, 0x00007f],
8+
[1, 0x0000ff],
9+
[2, 0x00ffff],
10+
[3, 0xffff00],
11+
[4, 0xff0000],
12+
[5, 0x7f0000]
13+
];
14+
const visualizer = new ColorRampVisualizer(map, minVal, maxVal)
15+
function setup() {
16+
return {
17+
input: ["NO2","dataMask"],
18+
output: [
19+
{ id: "default", bands: 4 },
20+
{ id: "index", bands: 1, sampleType: "FLOAT32" },
21+
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32"},
22+
{ id: "dataMask", bands: 1 },
23+
],
24+
mosaicking: "ORBIT"
25+
};
26+
}
27+
function isClear(sample) {
28+
return sample.dataMask == 1;
29+
}
30+
function sum(array) {
31+
let sum = 0;
32+
for (let i = 0; i < array.length; i++) {
33+
sum += array[i].NO2;
34+
}
35+
return sum;
36+
}
37+
function evaluatePixel(samples) {
38+
const clearTs = samples.filter(isClear)
39+
const mean = sum(clearTs) / clearTs.length
40+
const [r, g, b] = visualizer.process(mean);
41+
const dataMask = clearTs.length > 0;
42+
return {
43+
default: [r, g, b, dataMask],
44+
index: [mean],
45+
eobrowserStats: [mean],
46+
dataMask: [dataMask],
47+
};
48+
}

sentinel-5p/sentinel-5p.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,8 @@ Sentinel-5P provides atmospheric measurements, relating to air quality, climate
3939
- [Cloud Top Pressure](/sentinel-5p/cloud-top-pressure)
4040
- [Cloud Base Pressure](/sentinel-5p/cloud-base-pressure)
4141
- [Cloud Optical Thickness](/sentinel-5p/cloud-optical-thickness)
42-
- [Cloud Effective Radiometric Fraction](/sentinel-5p/cloud-radiometric-fraction)
42+
- [Cloud Effective Radiometric Fraction](/sentinel-5p/cloud-radiometric-fraction)
43+
44+
### Additional Products
45+
46+
- [Nitrogen Dioxide monthly mean](/sentinel-5p/no2_monthly_mean)

0 commit comments

Comments
 (0)