Skip to content

Commit

Permalink
Merge pull request #305 from sentinel-hub/feat/rename_bands_planet
Browse files Browse the repository at this point in the history
renaming of planet scope and sky sat bands
  • Loading branch information
msterk authored Mar 19, 2024
2 parents e4ebd70 + 7ab34b3 commit 815604d
Show file tree
Hide file tree
Showing 20 changed files with 70 additions and 70 deletions.
16 changes: 8 additions & 8 deletions planet_scope/cloud_classification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ nav_exclude: true

## Evaluate and visualize

As PlanetScope is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
As PlanetScope 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

PlanetScope has several usable data mask (UDM2) bands. The `UDM2_Clear` band gives information on whether the pixel is clear, meaning that the surface is clearly visible. If it's not clear, that means it's classified as either shadow, snow, light haze, heavy haze or cloud. Each of these is a separate UDM2 mask band:
PlanetScope has several usable data mask (UDM2) bands. The `clear` band gives information on whether the pixel is clear, meaning that the surface is clearly visible. If it's not clear, that means it's classified as either shadow, snow, light haze, heavy haze or cloud. Each of these is a separate UDM2 mask band:

- UDM2_Snow
- UDM2_Shadow
- UDM2_LightHaze
- UDM2_HeavyHaze
- UDM2_Cloud
- snow
- shadow
- haze_light
- haze_heavy
- cloud

When the mask band == 1, the pixel belongs to the mask (for example, when UDM2_Snow == 1, the pixel was recognized as snow). The bands are mutually exclusive - if a pixel belongs to one mask class, it cannot belong to any other.
When the mask band == 1, the pixel belongs to the mask (for example, when `snow` == 1, the pixel was recognized as snow). The bands are mutually exclusive - if a pixel belongs to one mask class, it cannot belong to any other.

In the script, each of the UDM2 mask bands is classified with a unique color, and the pixels that do not belong to any class, are returned transparent.

Expand Down
22 changes: 11 additions & 11 deletions planet_scope/cloud_classification/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ function setup() {
return {
input: [{
bands: [
"UDM2_Clear",
"UDM2_Snow",
"UDM2_Shadow",
"UDM2_LightHaze",
"UDM2_HeavyHaze",
"UDM2_Cloud"
"clear",
"snow",
"shadow",
"haze_light",
"haze_heavy",
"cloud"
]
}],
output: {
Expand All @@ -20,19 +20,19 @@ function setup() {
}

function evaluatePixel(samples) {
if (samples.UDM2_Snow == 1) {
if (samples.snow == 1) {
return [0, 0.5, 1, 1] // blue
}
if (samples.UDM2_Shadow == 1) {
if (samples.shadow == 1) {
return [0.4, 0.4, 0.4, 1] //grey
}
if (samples.UDM2_LightHaze == 1) {
if (samples.haze_light == 1) {
return [0, 0.9, 1, 1] //sky blue
}
if (samples.UDM2_HeavyHaze == 1) {
if (samples.haze_heavy == 1) {
return [1, 0.7, 1, 1] //light pink
}
if (samples.UDM2_Cloud == 1) {
if (samples.cloud == 1) {
return [0.7, 0.7, 0.7, 1] //white
}
else {
Expand Down
4 changes: 2 additions & 2 deletions planet_scope/false_color/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ nav_exclude: true

## Evaluate and visualize

As PlanetScope is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
As PlanetScope 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

The [False color](https://en.wikipedia.org/wiki/False_color) infrared composite maps near-infrared spectral band B4 with red and green bands, B3 and B2, to [sRGB](https://en.wikipedia.org/wiki/SRGB) components directly. It is most commonly used to assess plant density and healht, as plants reflect near infrared and green light, while absorbing red. Since they reflect more near infrared than green, plant-covered land appears deep red. Denser plant growth is darker red. Cities and exposed ground are gray or tan, and water appears blue or black.
The [False color](https://en.wikipedia.org/wiki/False_color) infrared composite maps near-infrared spectral band `nir` with `red` and `green` bands to [sRGB](https://en.wikipedia.org/wiki/SRGB) components directly. It is most commonly used to assess plant density and healht, as plants reflect near infrared and green light, while absorbing red. Since they reflect more near infrared than green, plant-covered land appears deep red. Denser plant growth is darker red. Cities and exposed ground are gray or tan, and water appears blue or black.

## Description of representative images

Expand Down
4 changes: 2 additions & 2 deletions planet_scope/false_color/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

function setup() {
return {
input: ["NIR", "Green", "Blue"],
input: ["nir", "green", "blue"],
output: { bands: 3 }
};
}

function evaluatePixel(sample) {
return [sample.NIR / 3000, sample.Green / 3000, sample.Blue / 3000];
return [sample.nir / 3000, sample.green / 3000, sample.blue / 3000];
}
2 changes: 1 addition & 1 deletion planet_scope/green_city/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nav_exclude: true

## Evaluate and visualize

As PlanetScope is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
As PlanetScope 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 of the script

Expand Down
8 changes: 4 additions & 4 deletions planet_scope/green_city/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Author of the script: Carlos Bentes
*/

// Normalized Difference Vegetation Index
var ndvi = (NIR - Red) / (NIR + Red);
var ndvi = (nir - red) / (nir + red);

// Threshold for vegetation
var veg_th = 0.4;

// Simple RGB
var R = Red / 3000;
var G = Green / 3000;
var B = Blue / 3000;
var R = red / 3000;
var G = green / 3000;
var B = blue / 3000;

// Transform to Black and White
var Y = 0.2 * R + 0.7 * G + 0.1 * B;
Expand Down
4 changes: 2 additions & 2 deletions planet_scope/ndvi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ scripts:

## Evaluate and visualize

As PlanetScope is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
As PlanetScope 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

Expand All @@ -22,7 +22,7 @@ The value range of the NDVI is -1 to 1. Negative values of NDVI (values approach

The normalized difference vegetation index, abbreviated NDVI, is defined as

$$NDVI := \mathtt{Index}(NIR,RED) = \frac{NIR-RED}{NIR+RED}.$$
$$NDVI := \mathtt{Index}(nir,red) = \frac{nir-red}{nir+red}.$$

This is an example script which can be used with EO Browser and is configured to return statistics in a format which can be used with the statistical info chart. For more information, see <a href = "https://www.sentinel-hub.com/faq/how-configure-your-layers-statistical-info-eo-browser/"> How Can I Configure My Layers For Statistical Information In EO Browser?</a>

Expand Down
12 changes: 6 additions & 6 deletions planet_scope/ndvi/eob.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ function setup() {
return {
input: [{
bands: [
"Red",
"NIR",
"red",
"nir",
"dataMask",
"UDM2_Clear"
"clear"
]
}],
output: [
Expand All @@ -21,9 +21,9 @@ function setup() {
}

function evaluatePixel(samples) {
let ndvi = (samples.NIR - samples.Red) / (samples.NIR + samples.Red);
let ndvi = (samples.nir - samples.red) / (samples.nir + samples.red);
const indexVal = samples.dataMask === 1 ? ndvi : NaN;
const clear = samples.dataMask * samples.UDM2_Clear;
const clear = samples.dataMask * samples.clear;

let id_default = colorBlend(ndvi, [0.0, 0.5, 1.0],
[
Expand All @@ -35,7 +35,7 @@ function evaluatePixel(samples) {
return {
default: id_default,
index: [indexVal],
eobrowserStats: [indexVal, samples.UDM2_Clear],
eobrowserStats: [indexVal, samples.clear],
dataMask: [samples.dataMask],
};
}
2 changes: 1 addition & 1 deletion planet_scope/ndvi/script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//NDVI
var val = (NIR - Red) / (NIR + Red);
var val = (nir - red) / (nir + red);

return colorBlend(val,
[0.0, 0.5, 1.0],
Expand Down
4 changes: 2 additions & 2 deletions planet_scope/ndwi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ nav_exclude: true

## Evaluate and visualize

As PlanetScope is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
As PlanetScope 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 of the script

The NDWI is useful for water body mapping, as water bodies strongly absorb light in visible to infrared electromagnetic spectrum. NDWI uses green and near infrared bands to highlight water bodies. It is sensitive to built-up land and can result in over-estimation of water bodies.

$$NDWI = \frac{Green-NIR}{Green+NIR}.$$
$$NDWI = \frac{green-nir}{green+nir}.$$

Values description: Index values greater than 0.5 usually correspond to water bodies. Vegetation usually corresponds to much smaller values and built-up areas to values between zero and 0.2.

Expand Down
2 changes: 1 addition & 1 deletion planet_scope/ndwi/script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//NDWI

var val = (Green / 3000 - NIR / 3000) / (Green / 3000 + NIR / 3000);
var val = (green / 3000 - nir / 3000) / (green / 3000 + nir / 3000);

return colorBlend(val,
[-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0],
Expand Down
24 changes: 12 additions & 12 deletions planet_scope/planet_scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@ permalink: /planet/planetscope/

The spectral bands of PlanetScope data are the following if you order a 4-band <a href = "https://docs.sentinel-hub.com/api/latest/data/planet/planet-scope/#productbundle-parameter">product bundle</a>:

- *B1 - Blue, resolution 3m*
- *blue - Blue, resolution 3m*

- *B2 - Green, resolution 3m*
- *green - Green, resolution 3m*

- *B3 - Red, resolution 3m*
- *red - Red, resolution 3m*

- *B4 - Near Infrared, resolution 3m*
- *nir - Near Infrared, resolution 3m*

The spectral bands of PlanetScope data are the following if you order a 8-band product bundle:

- *B1 - Coastal Blue, resolution 3m*
- *coastal_blue - Coastal Blue, resolution 3m*

- *B2 - Blue, resolution 3m*
- *blue - Blue, resolution 3m*

- *B3 - Green I, resolution 3m*
- *green_i - Green I, resolution 3m*

- *B4 - Green, resolution 3m*
- *green - Green, resolution 3m*

- *B5 - Yellow, resolution 3m*
- *yellow - Yellow, resolution 3m*

- *B6 - Red, resolution 3m*
- *red - Red, resolution 3m*

- *B7 - Red Edge, resolution 3m*
- *rededge - Red Edge, resolution 3m*

- *B8 - Near-infrared, resolution 3m*
- *nir - Near-infrared, resolution 3m*

</details>

Expand Down
4 changes: 2 additions & 2 deletions planet_scope/true_color/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ nav_exclude: true

## Evaluate and visualize

As PlanetScope is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
As PlanetScope 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

The true color product maps PlanetScope band values B3, B2, and B1 which roughly correspond to red, green, and blue part of the spectrum, respectively, to R, G, and B components.
The true color product maps PlanetScope band values `red`, `green`, and `blue` which roughly correspond to red, green, and blue part of the spectrum, respectively, to R, G, and B components.

## Description of representative images

Expand Down
4 changes: 2 additions & 2 deletions planet_scope/true_color/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

function setup() {
return {
input: ["Blue", "Green", "Red"],
input: ["blue", "green", "red"],
output: { bands: 3 }
};
}

function evaluatePixel(sample) {
return [sample.Red / 3000, sample.Green / 3000, sample.Blue / 3000];
return [sample.red / 3000, sample.green / 3000, sample.blue / 3000];
}
4 changes: 2 additions & 2 deletions skysat/ndvi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nav_exclude: true

## Evaluate and visualize

As SkySat is commercial data, brought into Sentinel Hub as Bring Your Own Data, direct EO Browser and Sentinel Playgorund links are not possible due to the personalized data credentials.
As SkySat 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

Expand All @@ -20,7 +20,7 @@ The value range of the NDVI is -1 to 1. Negative values of NDVI (values approach

The normalized difference vegetation index, abbreviated NDVI, is defined as

$$NDVI := \mathtt{Index}(NIR,Red) = \frac{NIR-RED}{NIR+Red}.$$
$$NDVI := \mathtt{Index}(nir,red) = \frac{nir-red}{nir+red}.$$

The result is visualized using the `valueInterpolate` function. It maps the values of the
NDVI in certain intervals to RGBA (RGB+Alpha) values for visualization.
Expand Down
4 changes: 2 additions & 2 deletions skysat/ndvi/script.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//VERSION=3
function setup() {
return {
input: ["Red", "NIR", "dataMask"],
input: ["red", "nir", "dataMask"],
output: { bands: 4 }
}
}
var f = 10000
function evaluatePixel(sample) {
var NDVI = index(sample.NIR, sample.Red)
var NDVI = index(sample.nir, sample.red)
return valueInterpolate(NDVI,
[0, 0.2, 0.3, 0.4, 0.5, 1.0],
[
Expand Down
4 changes: 2 additions & 2 deletions skysat/panchromatic/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

function setup() {
return {
input: ["PAN", "dataMask"],
input: ["pan", "dataMask"],
output: { bands: 4 }
}
}
var f = 10000
function evaluatePixel(sample) {
return [sample.PAN / f, sample.PAN / f, sample.PAN / f, sample.dataMask]
return [sample.pan / f, sample.pan / f, sample.pan / f, sample.dataMask]
}
10 changes: 5 additions & 5 deletions skysat/skysat.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ permalink: /planet/skysat/

The spectral bands of SkySat data are the following:

*Blue - 450-515 nm, resolution 0.5m*
*blue - 450-515 nm, resolution 0.5m*

*Green - 515-595 nm, resolution 0.5m*
*green - 515-595 nm, resolution 0.5m*

*Red - 605-695 nm, resolution 0.5m*
*red - 605-695 nm, resolution 0.5m*

*NIR - 740-900 nm Near Infrared, resolution 0.5m*
*nir - 740-900 nm Near Infrared, resolution 0.5m*

*Pan - 450-900nm Panchromatic, resolution 0.5*
*pan - 450-900nm Panchromatic, resolution 0.5*

- [True Color](/skysat/true_color)
- [Panchromatic](/skysat/panchromatic)
Expand Down
2 changes: 1 addition & 1 deletion skysat/true_color/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ As SkySat is commercial data, brought into Sentinel Hub as Bring Your Own Data,

## General description

The true color product combines Skysat band values Red, Blue, and Green to create a true color image.
The true color product combines Skysat band values `red`, `blue`, and `green` to create a true color image.

## Description of representative images

Expand Down
4 changes: 2 additions & 2 deletions skysat/true_color/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

function setup() {
return {
input: ["Blue", "Red", "Green", "dataMask"],
input: ["blue", "red", "green", "dataMask"],
output: { bands: 4 }
}
}
var f = 2.5 / 10000
function evaluatePixel(sample) {
return [sample.Red * f, sample.Green * f, sample.Blue * f, sample.dataMask]
return [sample.red * f, sample.green * f, sample.blue * f, sample.dataMask]
}

0 comments on commit 815604d

Please sign in to comment.