Skip to content

Commit 3c468fa

Browse files
Merge pull request #341 from hemalimajithia/fcm
Added folder with evalscripts for Forest Carbon Monitoring
2 parents b23c2b5 + c15781d commit 3c468fa

File tree

16 files changed

+432
-0
lines changed

16 files changed

+432
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
//VERSION=3
2+
// To set custom max and min values, set
3+
// defaultVis to false and choose your max and
4+
// min values. The color map will then be scaled
5+
// to those max and min values
6+
const defaultVis = true;
7+
const max = 175;
8+
const min = 0;
9+
10+
function setup() {
11+
return {
12+
input: ["ACD", "dataMask"],
13+
output: [
14+
{ id: "default", bands: 4 },
15+
{ id: "index", bands: 1, sampleType: "INT16" },
16+
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" },
17+
{ id: "dataMask", bands: 1 },
18+
],
19+
};
20+
}
21+
22+
function updateMap(max, min) {
23+
const numIntervals = map.length;
24+
const intervalLength = (max - min) / (numIntervals - 1);
25+
for (let i = 0; i < numIntervals; i++) {
26+
map[i][0] = max - intervalLength * i;
27+
}
28+
}
29+
30+
const map = [
31+
[175, 0xe5dd26],
32+
[155, 0xced62f],
33+
[140, 0x9ec54a],
34+
[125, 0x63b16e],
35+
[110, 0x38a183],
36+
[95, 0x1b8583],
37+
[80, 0x1e8589],
38+
[65, 0x206378],
39+
[50, 0x2e4c67],
40+
[35, 0x2a3f62],
41+
[20, 0x2d1a4e],
42+
[5, 0x2e164c],
43+
[0, 0x360245],
44+
];
45+
46+
const visualizer = new ColorRampVisualizer(map, min, max);
47+
48+
function evaluatePixel(sample) {
49+
let val = sample.ACD;
50+
let imgVals = visualizer.process(val);
51+
52+
return {
53+
default: imgVals.concat(sample.dataMask),
54+
index: [val],
55+
eobrowserStats: [val],
56+
dataMask: [sample.dataMask],
57+
};
58+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Aboveground Carbon Density, Forest Carbon Monitoring
3+
parent: Forest Carbon Monitoring
4+
grand_parent: Planetary Variables
5+
layout: script
6+
nav_exclude: true
7+
scripts:
8+
- [Visualization, script.js]
9+
- [EO Browser, eob.js]
10+
- [Raw Values, raw.js]
11+
---
12+
13+
## Evaluate and visualize
14+
15+
As Forest Carbon Monitoring is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser links are not possible due to the personalized data credentials.
16+
17+
## General description
18+
19+
Aboveground carbon density quantifies the expected density of carbon stored in woody biomass across the
20+
landscape, measured in mass per area (megagrams of carbon per hectare). It is not a direct estimate of the total
21+
carbon in that pixel, as the spatial resolution of each pixel is less than one hectare. To estimate total carbon in a
22+
pixel, users should normalize these values to account for the size of each pixel, or average the density values to 1
23+
hectare in an equal area projection.
24+
25+
The data layer has four bands:
26+
27+
- **Aboveground Carbon Density** quantifies the density of carbon stored in woody vegetation,
28+
primarily trees and shrubs. Grassland, herbaceous, and soil carbon stocks are not quantified.
29+
- **Lower prediction bound (5th percentile)** of the 90% prediction interval for model predictions at each pixel.
30+
- **Upper prediction bound (95th percentile)** of the 90% prediction interval for model predictions at each pixel.
31+
32+
## Description of representative images
33+
34+
Aboveground Carbon Density in 2024-09-21 near Novo Progresso, Brazil..
35+
36+
![Aboveground Carbon Density Example](fig/abovegroundcarbon.jpg)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//VERSION=3
2+
function setup() {
3+
return {
4+
input: ["ACD"],
5+
output: { bands: 1, sampleType: "INT16" },
6+
};
7+
}
8+
9+
function evaluatePixel(sample) {
10+
return [sample.ACD];
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//VERSION=3
2+
const defaultVis = true;
3+
const max = 175;
4+
const min = 0;
5+
6+
function setup() {
7+
return {
8+
input: ["ACD", "dataMask"],
9+
output: { bands: 4, sampleType: "AUTO" },
10+
};
11+
}
12+
13+
function updateMap(max, min) {
14+
const numIntervals = map.length;
15+
const intervalLength = (max - min) / (numIntervals - 1);
16+
for (let i = 0; i < numIntervals; i++) {
17+
map[i][0] = max - intervalLength * i;
18+
}
19+
}
20+
21+
const map = [
22+
[175, 0xe5dd26],
23+
[155, 0xced62f],
24+
[140, 0x9ec54a],
25+
[125, 0x63b16e],
26+
[110, 0x38a183],
27+
[95, 0x1b8583],
28+
[80, 0x1e8589],
29+
[65, 0x206378],
30+
[50, 0x2e4c67],
31+
[35, 0x2a3f62],
32+
[20, 0x2d1a4e],
33+
[5, 0x2e164c],
34+
[0, 0x360245],
35+
];
36+
37+
const visualizer = new ColorRampVisualizer(map, min, max);
38+
39+
function evaluatePixel(sample) {
40+
let val = sample.ACD;
41+
let imgVals = visualizer.process(val);
42+
43+
return [...imgVals, sample.dataMask];
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//VERSION=3
2+
// To set custom max and min values, set
3+
// defaultVis to false and choose your max and
4+
// min values. The color map will then be scaled
5+
// to those max and min values
6+
const defaultVis = true;
7+
const max = 100;
8+
const min = 0;
9+
10+
function setup() {
11+
return {
12+
input: ["CC", "dataMask"],
13+
output: [
14+
{ id: "default", bands: 4 },
15+
{ id: "index", bands: 1, sampleType: "UINT8" },
16+
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" },
17+
{ id: "dataMask", bands: 1 },
18+
],
19+
};
20+
}
21+
22+
function updateMap(max, min) {
23+
const numIntervals = map.length;
24+
const intervalLength = (max - min) / (numIntervals - 1);
25+
for (let i = 0; i < numIntervals; i++) {
26+
map[i][0] = max - intervalLength * i;
27+
}
28+
}
29+
30+
const map = [
31+
[100, 0x183d19],
32+
[90, 0x124f24],
33+
[80, 0x0e6327],
34+
[70, 0x246d29],
35+
[60, 0x498418],
36+
[50, 0x669516],
37+
[40, 0x859e25],
38+
[30, 0xa4ab38],
39+
[20, 0xd3c058],
40+
[10, 0xddd17c],
41+
[0, 0xf0f5d5],
42+
];
43+
44+
const visualizer = new ColorRampVisualizer(map, min, max);
45+
46+
function evaluatePixel(sample) {
47+
let val = sample.CC;
48+
let imgVals = visualizer.process(val);
49+
50+
return {
51+
default: imgVals.concat(sample.dataMask),
52+
index: [val],
53+
eobrowserStats: [val],
54+
dataMask: [sample.dataMask],
55+
};
56+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Canopy Cover, Forest Carbon Monitoring
3+
parent: Forest Carbon Monitoring
4+
grand_parent: Planetary Variables
5+
layout: script
6+
nav_exclude: true
7+
scripts:
8+
- [Visualization, script.js]
9+
- [EO Browser, eob.js]
10+
- [Raw Values, raw.js]
11+
---
12+
13+
## Evaluate and visualize
14+
15+
As Forest Carbon Monitoring is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser links are not possible due to the personalized data credentials.
16+
17+
## General description
18+
19+
Canopy cover quantifies the percentage of area occupied by trees within a
20+
pixel, where a tree is defined as vegetation 5 meters or taller. This metric will be most sensitive to tree clearing
21+
events like timber harvest or deforestation, but is also sensitive to seasonal leaf-on variation and to drought.
22+
23+
The data layer has four bands:
24+
25+
- **Canopy Cover** quantifies the horizontal area occupied by tree canopies that are > 5m tall.
26+
- **Lower prediction bound (5th percentile)** of the 90% prediction interval for model predictions at each pixel.
27+
- **Upper prediction bound (95th percentile)** of the 90% prediction interval for model predictions at each pixel.
28+
29+
## Description of representative images
30+
31+
Canopy Cover in 2024-09-21 near Novo Progresso, Brazil.
32+
33+
![Canopy Cover Example](fig/canopycover.jpg)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//VERSION=3
2+
function setup() {
3+
return {
4+
input: ["CC"],
5+
output: { bands: 1, sampleType: "UINT8" },
6+
};
7+
}
8+
9+
function evaluatePixel(sample) {
10+
return [sample.CC]
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//VERSION=3
2+
const defaultVis = true;
3+
const max = 100;
4+
const min = 0;
5+
6+
function setup() {
7+
return {
8+
input: ["CC", "dataMask"],
9+
output: { bands: 4, sampleTYPE: "AUTO" },
10+
};
11+
}
12+
13+
function updateMap(max, min) {
14+
const numIntervals = map.length;
15+
const intervalLength = (max - min) / (numIntervals - 1);
16+
for (let i = 0; i < numIntervals; i++) {
17+
map[i][0] = max - intervalLength * i;
18+
}
19+
}
20+
21+
const map = [
22+
[100, 0x183d19],
23+
[90, 0x124f24],
24+
[80, 0x0e6327],
25+
[70, 0x246d29],
26+
[60, 0x498418],
27+
[50, 0x669516],
28+
[40, 0x859e25],
29+
[30, 0xa4ab38],
30+
[20, 0xd3c058],
31+
[10, 0xddd17c],
32+
[0, 0xf0f5d5],
33+
];
34+
35+
const visualizer = new ColorRampVisualizer(map, min, max);
36+
37+
function evaluatePixel(sample) {
38+
let val = sample.CC;
39+
let imgVals = visualizer.process(val);
40+
41+
return [...imgVals, sample.dataMask];
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
//VERSION=3
2+
// To set custom max and min values, set
3+
// defaultVis to false and choose your max and
4+
// min values. The color map will then be scaled
5+
// to those max and min values
6+
const defaultVis = true;
7+
const max = 30;
8+
const min = 0;
9+
10+
function setup() {
11+
return {
12+
input: ["CH", "dataMask"],
13+
output: [
14+
{ id: "default", bands: 4 },
15+
{ id: "index", bands: 1, sampleType: "UINT8" },
16+
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" },
17+
{ id: "dataMask", bands: 1 },
18+
],
19+
};
20+
}
21+
22+
function updateMap(max, min) {
23+
const numIntervals = map.length;
24+
const intervalLength = (max - min) / (numIntervals - 1);
25+
for (let i = 0; i < numIntervals; i++) {
26+
map[i][0] = max - intervalLength * i;
27+
}
28+
}
29+
30+
const map = [
31+
[30, 0x345e03],
32+
[20, 0x6da20c],
33+
[10, 0xbace6e],
34+
[0, 0xf0f5d5],
35+
];
36+
37+
const visualizer = new ColorRampVisualizer(map, min, max);
38+
39+
function evaluatePixel(sample) {
40+
let val = sample.CH;
41+
let imgVals = visualizer.process(val);
42+
43+
return {
44+
default: imgVals.concat(sample.dataMask),
45+
index: [val],
46+
eobrowserStats: [val],
47+
dataMask: [sample.dataMask],
48+
};
49+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Canopy Height, Forest Carbon Monitoring
3+
parent: Forest Carbon Monitoring
4+
grand_parent: Planetary Variables
5+
layout: script
6+
nav_exclude: true
7+
scripts:
8+
- [Visualization, script.js]
9+
- [EO Browser, eob.js]
10+
- [Raw Values, raw.js]
11+
---
12+
13+
## Evaluate and visualize
14+
15+
As Forest Carbon Monitoring is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser links are not possible due to the personalized data credentials.
16+
17+
## General description
18+
19+
Canopy height quantifies the average stand height of trees within each pixel. Because this is a spatial average
20+
over a moderate resolution, the modeled height values are shorter than the tallest individual tree within a pixel.
21+
22+
The data layer has four bands:
23+
24+
- **Canopy Height** quantifies the average height of all vegetation in that pixel.
25+
- **Lower prediction bound (5th percentile)** of the 90% prediction interval for model predictions at each pixel.
26+
- **Upper prediction bound (95th percentile)** of the 90% prediction interval for model predictions at each pixel.
27+
28+
## Description of representative images
29+
30+
Canopy Height in 2024-09-21 near Novo Progresso, Brazil.
31+
32+
![Canopy Height Example](fig/canopyheight.jpg)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//VERSION=3
2+
function setup() {
3+
return {
4+
input: ["CH"],
5+
output: { bands: 1, sampleType: "UINT8" },
6+
};
7+
}
8+
9+
function evaluatePixel(sample) {
10+
return [sample.CH]
11+
}

0 commit comments

Comments
 (0)