-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #288 from thomas-maschler/planet/forest-carbon
Add forest carbon diligence scripts
- Loading branch information
Showing
17 changed files
with
449 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
planetary-variables/forest-carbon-diligence/aboveground-carbon-density/README.md
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,39 @@ | ||
--- | ||
title: Aboveground Carbon Density, Forest Carbon Diligence | ||
parent: Forest Carbon Diligence | ||
grand_parent: Planetary Variables | ||
layout: script | ||
permalink: /forest-carbon-diligence/aboveground-carbon-density/ | ||
nav_exclude: true | ||
scripts: | ||
- [Visualization, script.js] | ||
- [EO Browser, eob.js] | ||
- [Raw Values, raw.js] | ||
--- | ||
|
||
|
||
## Evaluate and visualize | ||
|
||
As Forest Carbon Diligence is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playground 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. | ||
- **Quality Assurance Flags** describing the expected quality of satellite data measurements, and | ||
whether any temporal gap-filling was applied. | ||
|
||
## Description of representative images | ||
|
||
Aboveground Carbon Density in 2022 near Apui, Brazil. | ||
|
||
![Aboveground Carbon Density Example](fig/abovegroundcarbon.jpg) |
55 changes: 55 additions & 0 deletions
55
planetary-variables/forest-carbon-diligence/aboveground-carbon-density/eob.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,55 @@ | ||
//VERSION=3 | ||
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], | ||
]; | ||
|
||
if (!defaultVis) updateMap(max, min); | ||
const visualizer = new ColorRampVisualizer(map); | ||
|
||
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] | ||
}; | ||
} |
Binary file added
BIN
+323 KB
...es/forest-carbon-diligence/aboveground-carbon-density/fig/abovegroundcarbon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions
11
planetary-variables/forest-carbon-diligence/aboveground-carbon-density/raw.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,11 @@ | ||
//VERSION=3 | ||
function setup() { | ||
return { | ||
input: ["ACD"], | ||
output: { bands: 1, sampleType: "INT16" }, | ||
}; | ||
} | ||
|
||
function evaluatePixel(sample) { | ||
return [sample.ACD] | ||
} |
46 changes: 46 additions & 0 deletions
46
planetary-variables/forest-carbon-diligence/aboveground-carbon-density/script.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,46 @@ | ||
//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], | ||
]; | ||
|
||
if (!defaultVis) updateMap(max, min); | ||
const visualizer = new ColorRampVisualizer(map); | ||
|
||
function evaluatePixel(sample) { | ||
let val = sample.ACD; | ||
let imgVals = visualizer.process(val) | ||
|
||
return [...imgVals, sample.dataMask] | ||
} |
36 changes: 36 additions & 0 deletions
36
planetary-variables/forest-carbon-diligence/canopy-cover/README.md
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 @@ | ||
--- | ||
title: Canopy Cover, Forest Carbon Diligence | ||
parent: Forest Carbon Diligence | ||
grand_parent: Planetary Variables | ||
layout: script | ||
permalink: /forest-carbon-diligence/canopy-cover/ | ||
nav_exclude: true | ||
scripts: | ||
- [Visualization, script.js] | ||
- [EO Browser, eob.js] | ||
- [Raw Values, raw.js] | ||
--- | ||
|
||
|
||
## Evaluate and visualize | ||
|
||
As Forest Carbon Diligence is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playground 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. | ||
- **Quality Assurance Flags** describing the expected quality of satellite data measurements, and | ||
whether any temporal gap-filling was applied. | ||
|
||
## Description of representative images | ||
|
||
Canopy Cover in 2022 near Apui, Brazil. | ||
|
||
![Canopy Cover Example](fig/canopycover.jpg) |
53 changes: 53 additions & 0 deletions
53
planetary-variables/forest-carbon-diligence/canopy-cover/eob.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,53 @@ | ||
//VERSION=3 | ||
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], | ||
]; | ||
|
||
if (!defaultVis) updateMap(max, min); | ||
const visualizer = new ColorRampVisualizer(map); | ||
|
||
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] | ||
}; | ||
} |
Binary file added
BIN
+344 KB
planetary-variables/forest-carbon-diligence/canopy-cover/fig/canopycover.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions
11
planetary-variables/forest-carbon-diligence/canopy-cover/raw.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,11 @@ | ||
//VERSION=3 | ||
function setup() { | ||
return { | ||
input: ["CC"], | ||
output: { bands: 1, sampleType: "UINT8" }, | ||
}; | ||
} | ||
|
||
function evaluatePixel(sample) { | ||
return [sample.CC] | ||
} |
43 changes: 43 additions & 0 deletions
43
planetary-variables/forest-carbon-diligence/canopy-cover/script.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,43 @@ | ||
//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], | ||
]; | ||
|
||
if (!defaultVis) updateMap(max, min); | ||
const visualizer = new ColorRampVisualizer(map); | ||
|
||
function evaluatePixel(sample) { | ||
let val = sample.CC; | ||
let imgVals = visualizer.process(val) | ||
|
||
return [...imgVals, sample.dataMask] | ||
} |
36 changes: 36 additions & 0 deletions
36
planetary-variables/forest-carbon-diligence/canopy-height/README.md
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 @@ | ||
--- | ||
title: Canopy Height, Forest Carbon Diligence | ||
parent: Forest Carbon Diligence | ||
grand_parent: Planetary Variables | ||
layout: script | ||
permalink: /forest-carbon-diligence/canopy-height/ | ||
nav_exclude: true | ||
scripts: | ||
- [Visualization, script.js] | ||
- [EO Browser, eob.js] | ||
- [Raw Values, raw.js] | ||
--- | ||
|
||
|
||
## Evaluate and visualize | ||
|
||
As Forest Carbon Diligence is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playground 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. | ||
- **Quality Assurance Flags** describing the expected quality of satellite data measurements, and | ||
whether any temporal gap-filling was applied. | ||
|
||
|
||
## Description of representative images | ||
|
||
Canopy Height in 2022 near Apui, Brazil. | ||
|
||
![Canopy Height Example](fig/canopyheight.jpg) |
46 changes: 46 additions & 0 deletions
46
planetary-variables/forest-carbon-diligence/canopy-height/eob.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,46 @@ | ||
//VERSION=3 | ||
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], | ||
]; | ||
|
||
if (!defaultVis) updateMap(max, min); | ||
const visualizer = new ColorRampVisualizer(map); | ||
|
||
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] | ||
}; | ||
} |
Binary file added
BIN
+293 KB
planetary-variables/forest-carbon-diligence/canopy-height/fig/canopyheight.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.