Skip to content

Commit

Permalink
Merge pull request #341 from hemalimajithia/fcm
Browse files Browse the repository at this point in the history
Added folder with evalscripts for Forest Carbon Monitoring
  • Loading branch information
Guyon-Duifhuizen authored Feb 7, 2025
2 parents b23c2b5 + c15781d commit 3c468fa
Show file tree
Hide file tree
Showing 16 changed files with 432 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//VERSION=3
// To set custom max and min values, set
// defaultVis to false and choose your max and
// min values. The color map will then be scaled
// to those max and min values
const defaultVis = true;
const max = 175;
const min = 0;

function setup() {
return {
input: ["ACD", "dataMask"],
output: [
{ id: "default", bands: 4 },
{ id: "index", bands: 1, sampleType: "INT16" },
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" },
{ id: "dataMask", bands: 1 },
],
};
}

function updateMap(max, min) {
const numIntervals = map.length;
const intervalLength = (max - min) / (numIntervals - 1);
for (let i = 0; i < numIntervals; i++) {
map[i][0] = max - intervalLength * i;
}
}

const map = [
[175, 0xe5dd26],
[155, 0xced62f],
[140, 0x9ec54a],
[125, 0x63b16e],
[110, 0x38a183],
[95, 0x1b8583],
[80, 0x1e8589],
[65, 0x206378],
[50, 0x2e4c67],
[35, 0x2a3f62],
[20, 0x2d1a4e],
[5, 0x2e164c],
[0, 0x360245],
];

const visualizer = new ColorRampVisualizer(map, min, max);

function evaluatePixel(sample) {
let val = sample.ACD;
let imgVals = visualizer.process(val);

return {
default: imgVals.concat(sample.dataMask),
index: [val],
eobrowserStats: [val],
dataMask: [sample.dataMask],
};
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Aboveground Carbon Density, Forest Carbon Monitoring
parent: Forest Carbon Monitoring
grand_parent: Planetary Variables
layout: script
nav_exclude: true
scripts:
- [Visualization, script.js]
- [EO Browser, eob.js]
- [Raw Values, raw.js]
---

## Evaluate and visualize

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.

## General description

Aboveground carbon density quantifies the expected density of carbon stored in woody biomass across the
landscape, measured in mass per area (megagrams of carbon per hectare). It is not a direct estimate of the total
carbon in that pixel, as the spatial resolution of each pixel is less than one hectare. To estimate total carbon in a
pixel, users should normalize these values to account for the size of each pixel, or average the density values to 1
hectare in an equal area projection.

The data layer has four bands:

- **Aboveground Carbon Density** quantifies the density of carbon stored in woody vegetation,
primarily trees and shrubs. Grassland, herbaceous, and soil carbon stocks are not quantified.
- **Lower prediction bound (5th percentile)** of the 90% prediction interval for model predictions at each pixel.
- **Upper prediction bound (95th percentile)** of the 90% prediction interval for model predictions at each pixel.

## Description of representative images

Aboveground Carbon Density in 2024-09-21 near Novo Progresso, Brazil..

![Aboveground Carbon Density Example](fig/abovegroundcarbon.jpg)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//VERSION=3
function setup() {
return {
input: ["ACD"],
output: { bands: 1, sampleType: "INT16" },
};
}

function evaluatePixel(sample) {
return [sample.ACD];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//VERSION=3
const defaultVis = true;
const max = 175;
const min = 0;

function setup() {
return {
input: ["ACD", "dataMask"],
output: { bands: 4, sampleType: "AUTO" },
};
}

function updateMap(max, min) {
const numIntervals = map.length;
const intervalLength = (max - min) / (numIntervals - 1);
for (let i = 0; i < numIntervals; i++) {
map[i][0] = max - intervalLength * i;
}
}

const map = [
[175, 0xe5dd26],
[155, 0xced62f],
[140, 0x9ec54a],
[125, 0x63b16e],
[110, 0x38a183],
[95, 0x1b8583],
[80, 0x1e8589],
[65, 0x206378],
[50, 0x2e4c67],
[35, 0x2a3f62],
[20, 0x2d1a4e],
[5, 0x2e164c],
[0, 0x360245],
];

const visualizer = new ColorRampVisualizer(map, min, max);

function evaluatePixel(sample) {
let val = sample.ACD;
let imgVals = visualizer.process(val);

return [...imgVals, sample.dataMask];
}
56 changes: 56 additions & 0 deletions planetary-variables/forest-carbon-monitoring/canopy-cover/eob.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//VERSION=3
// To set custom max and min values, set
// defaultVis to false and choose your max and
// min values. The color map will then be scaled
// to those max and min values
const defaultVis = true;
const max = 100;
const min = 0;

function setup() {
return {
input: ["CC", "dataMask"],
output: [
{ id: "default", bands: 4 },
{ id: "index", bands: 1, sampleType: "UINT8" },
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" },
{ id: "dataMask", bands: 1 },
],
};
}

function updateMap(max, min) {
const numIntervals = map.length;
const intervalLength = (max - min) / (numIntervals - 1);
for (let i = 0; i < numIntervals; i++) {
map[i][0] = max - intervalLength * i;
}
}

const map = [
[100, 0x183d19],
[90, 0x124f24],
[80, 0x0e6327],
[70, 0x246d29],
[60, 0x498418],
[50, 0x669516],
[40, 0x859e25],
[30, 0xa4ab38],
[20, 0xd3c058],
[10, 0xddd17c],
[0, 0xf0f5d5],
];

const visualizer = new ColorRampVisualizer(map, min, max);

function evaluatePixel(sample) {
let val = sample.CC;
let imgVals = visualizer.process(val);

return {
default: imgVals.concat(sample.dataMask),
index: [val],
eobrowserStats: [val],
dataMask: [sample.dataMask],
};
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions planetary-variables/forest-carbon-monitoring/canopy-cover/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Canopy Cover, Forest Carbon Monitoring
parent: Forest Carbon Monitoring
grand_parent: Planetary Variables
layout: script
nav_exclude: true
scripts:
- [Visualization, script.js]
- [EO Browser, eob.js]
- [Raw Values, raw.js]
---

## Evaluate and visualize

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.

## General description

Canopy cover quantifies the percentage of area occupied by trees within a
pixel, where a tree is defined as vegetation 5 meters or taller. This metric will be most sensitive to tree clearing
events like timber harvest or deforestation, but is also sensitive to seasonal leaf-on variation and to drought.

The data layer has four bands:

- **Canopy Cover** quantifies the horizontal area occupied by tree canopies that are > 5m tall.
- **Lower prediction bound (5th percentile)** of the 90% prediction interval for model predictions at each pixel.
- **Upper prediction bound (95th percentile)** of the 90% prediction interval for model predictions at each pixel.

## Description of representative images

Canopy Cover in 2024-09-21 near Novo Progresso, Brazil.

![Canopy Cover Example](fig/canopycover.jpg)
11 changes: 11 additions & 0 deletions planetary-variables/forest-carbon-monitoring/canopy-cover/raw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//VERSION=3
function setup() {
return {
input: ["CC"],
output: { bands: 1, sampleType: "UINT8" },
};
}

function evaluatePixel(sample) {
return [sample.CC]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//VERSION=3
const defaultVis = true;
const max = 100;
const min = 0;

function setup() {
return {
input: ["CC", "dataMask"],
output: { bands: 4, sampleTYPE: "AUTO" },
};
}

function updateMap(max, min) {
const numIntervals = map.length;
const intervalLength = (max - min) / (numIntervals - 1);
for (let i = 0; i < numIntervals; i++) {
map[i][0] = max - intervalLength * i;
}
}

const map = [
[100, 0x183d19],
[90, 0x124f24],
[80, 0x0e6327],
[70, 0x246d29],
[60, 0x498418],
[50, 0x669516],
[40, 0x859e25],
[30, 0xa4ab38],
[20, 0xd3c058],
[10, 0xddd17c],
[0, 0xf0f5d5],
];

const visualizer = new ColorRampVisualizer(map, min, max);

function evaluatePixel(sample) {
let val = sample.CC;
let imgVals = visualizer.process(val);

return [...imgVals, sample.dataMask];
}
49 changes: 49 additions & 0 deletions planetary-variables/forest-carbon-monitoring/canopy-height/eob.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//VERSION=3
// To set custom max and min values, set
// defaultVis to false and choose your max and
// min values. The color map will then be scaled
// to those max and min values
const defaultVis = true;
const max = 30;
const min = 0;

function setup() {
return {
input: ["CH", "dataMask"],
output: [
{ id: "default", bands: 4 },
{ id: "index", bands: 1, sampleType: "UINT8" },
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" },
{ id: "dataMask", bands: 1 },
],
};
}

function updateMap(max, min) {
const numIntervals = map.length;
const intervalLength = (max - min) / (numIntervals - 1);
for (let i = 0; i < numIntervals; i++) {
map[i][0] = max - intervalLength * i;
}
}

const map = [
[30, 0x345e03],
[20, 0x6da20c],
[10, 0xbace6e],
[0, 0xf0f5d5],
];

const visualizer = new ColorRampVisualizer(map, min, max);

function evaluatePixel(sample) {
let val = sample.CH;
let imgVals = visualizer.process(val);

return {
default: imgVals.concat(sample.dataMask),
index: [val],
eobrowserStats: [val],
dataMask: [sample.dataMask],
};
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Canopy Height, Forest Carbon Monitoring
parent: Forest Carbon Monitoring
grand_parent: Planetary Variables
layout: script
nav_exclude: true
scripts:
- [Visualization, script.js]
- [EO Browser, eob.js]
- [Raw Values, raw.js]
---

## Evaluate and visualize

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.

## General description

Canopy height quantifies the average stand height of trees within each pixel. Because this is a spatial average
over a moderate resolution, the modeled height values are shorter than the tallest individual tree within a pixel.

The data layer has four bands:

- **Canopy Height** quantifies the average height of all vegetation in that pixel.
- **Lower prediction bound (5th percentile)** of the 90% prediction interval for model predictions at each pixel.
- **Upper prediction bound (95th percentile)** of the 90% prediction interval for model predictions at each pixel.

## Description of representative images

Canopy Height in 2024-09-21 near Novo Progresso, Brazil.

![Canopy Height Example](fig/canopyheight.jpg)
11 changes: 11 additions & 0 deletions planetary-variables/forest-carbon-monitoring/canopy-height/raw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//VERSION=3
function setup() {
return {
input: ["CH"],
output: { bands: 1, sampleType: "UINT8" },
};
}

function evaluatePixel(sample) {
return [sample.CH]
}
Loading

0 comments on commit 3c468fa

Please sign in to comment.