Skip to content

Commit

Permalink
Merge pull request #291 from cpaulik/add-crop-biomass
Browse files Browse the repository at this point in the history
Add Crop Biomass Evalscripts
  • Loading branch information
jonasViehweger authored Dec 15, 2023
2 parents 8f3f6f0 + 218211c commit 27b2cab
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 0 deletions.
35 changes: 35 additions & 0 deletions planetary-variables/crop-biomass/crop-biomass.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Crop Biomass
nav_order: 2
parent: Planetary Variables
layout: script
permalink: /planetary-variables/crop-biomass/
scripts:
- [Visualization, script.js]
- [EO Browser, eob.js]
- [Raw Values, raw.js]
---

## Evaluate and visualize

As Crop Biomass 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

Biomass Proxy is a fusion of microwave and optical satellite imagery, using the advantages of each to accurately estimate relative above-ground crop biomass regardless of cloud cover and at a high spatial resolution (10 m x 10 m).

It integrates microwave data from the European Space Agency (ESA) Sentinel-1 satellites and optical images from its Sentinel-2 satellites.

Planetary Variables then fuses the output from these combined data sources in an algorithm designed to provide a reliable measurement of crop biomass over agricultural areas under all circumstances.

This is a relative measure of biomass, so each pixel value has a value of 0 (low biomass) to 1 (high biomass).

It should be computed over agricultural fields.


## Description of representative images

Crop Biomass of agriculture fields in Uruguay.

![Various fields over Uruguay](fig/fig1.png)

42 changes: 42 additions & 0 deletions planetary-variables/crop-biomass/eob.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//VERSION=3
function setup() {
return {
input: ["CB", "dataMask"],
output: [
{ id: "default", bands: 4 },
{ id: "index", bands: 1, sampleType: 'FLOAT32' },
{ id: "eobrowserStats", bands: 1, sampleType: 'FLOAT32' },
{ id: "dataMask", bands: 1 }
]
};
}


const bp_ramp = [
[0, 0xfff7ea],
[0.100, 0xf3e3c8],
[0.200, 0xdad0a4],
[0.300, 0xbdc082],
[0.400, 0x99b160],
[0.500, 0x6da242],
[0.600, 0x2c952e],
[0.7000, 0x008729],
[0.800, 0x007932],
[0.9000, 0x006640],
[1.000, 0x005444],
];

const visualizer = new ColorRampVisualizer(bp_ramp);

let factor = 1 / 1000;
function evaluatePixel(sample) {
let val = sample.CB * factor;
let imgVals = visualizer.process(val);
return {
default: [...imgVals, sample.dataMask],
index: [val],
eobrowserStats: [val],
dataMask: [sample.dataMask]
};
}

Binary file added planetary-variables/crop-biomass/fig/fig1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions planetary-variables/crop-biomass/raw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//VERSION=3
function setup() {
return {
input: ["CB"],
output: { bands: 1, sampleType: 'FLOAT32' }
};
}

let factor = 1 / 1000;
function evaluatePixel(sample) {
return [sample.CH * factor]
};

32 changes: 32 additions & 0 deletions planetary-variables/crop-biomass/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//VERSION=3
function setup() {
return {
input: ["CB", "dataMask"],
output: { bands: 4, sampleTYPE: "AUTO" },
};
}


const bp_ramp = [
[0, 0xfff7ea],
[0.100, 0xf3e3c8],
[0.200, 0xdad0a4],
[0.300, 0xbdc082],
[0.400, 0x99b160],
[0.500, 0x6da242],
[0.600, 0x2c952e],
[0.7000, 0x008729],
[0.800, 0x007932],
[0.9000, 0x006640],
[1.000, 0x005444],
];

const visualizer = new ColorRampVisualizer(bp_ramp);

let factor = 1 / 1000;
function evaluatePixel(sample) {
let val = sample.CB * factor;
let imgVals = visualizer.process(val);
return [...imgVals, sample.dataMask]
}

0 comments on commit 27b2cab

Please sign in to comment.