From 6d5493d849219ba0c5e2bca601576de3ae2f3ad0 Mon Sep 17 00:00:00 2001 From: Jonas Viehweger Date: Wed, 27 Nov 2024 09:54:37 +0100 Subject: [PATCH] Organized Planet structure, added examples, updated a bunch of planetscope scripts --- analysis_ready_planetscope/ndvi/raw.js | 15 - .../true_color/README.md | 19 -- .../cloud_mask_classification/fig/fig1.png | Bin .../cloud_mask_classification/index.md | 16 +- .../cloud_mask_classification/raw.js | 0 .../cloud_mask_classification/script.js | 0 .../false_color/fig/fig1.png | Bin .../false_color/index.md | 16 +- .../false_color/script.js | 0 .../analysis_ready_planetscope/index.md | 11 +- .../analysis_ready_planetscope}/ndvi/eob.js | 0 .../ndvi/fig/fig1.png | Bin .../analysis_ready_planetscope/ndvi/index.md | 16 +- planet/analysis_ready_planetscope/ndvi/raw.js | 15 + .../ndvi/script.js | 2 +- .../true_color/fig/fig1.png | Bin .../true_color/index.md | 33 ++ .../true_color/script.js | 0 .../true_color_cloud_masked/fig/fig1.png | Bin .../true_color_cloud_masked/index.md | 16 +- .../true_color_cloud_masked/script.js | 0 .../cloud_classification/fig/fig1.png | Bin .../planetscope/cloud_classification/index.md | 1 - .../cloud_classification/script.js | 35 ++ .../cloudless_mosaic/fig/fig1.png | Bin .../planetscope/cloudless_mosaic/index.md | 1 - .../planetscope}/cloudless_mosaic/script.js | 0 .../planetscope}/false_color/fig/fig1.jpg | Bin .../planetscope/false_color/index.md | 3 +- .../planetscope}/false_color/script.js | 0 .../planetscope}/green_city/fig/fig1.jpg | Bin .../planetscope/green_city/index.md | 3 +- .../planetscope}/green_city/script.js | 0 .../planetscope/index.md | 22 +- .../planetscope}/max_ndvi/eob.js | 0 .../planetscope}/max_ndvi/fig/fig1.png | Bin .../planetscope/max_ndvi/index.md | 1 - .../planetscope}/max_ndvi/raw.js | 0 .../planetscope}/max_ndvi/script.js | 0 .../planetscope}/ndci/eob.js | 0 .../planetscope}/ndci/fig/fig1.png | Bin .../planetscope/ndci/index.md | 3 +- planet/planetscope/ndci/raw.js | 18 ++ planet/planetscope/ndci/script.js | 32 ++ .../planetscope}/ndre/eob.js | 0 .../planetscope}/ndre/fig/fig1.png | Bin .../planetscope/ndre/index.md | 4 +- planet/planetscope/ndre/raw.js | 18 ++ planet/planetscope/ndre/script.js | 29 ++ planet/planetscope/ndvi/eob.js | 298 ++++++++++++++++++ .../planetscope}/ndvi/fig/fig1.png | Bin planet/planetscope/ndvi/index.md | 47 +++ planet/planetscope/ndvi/raw.js | 15 + planet/planetscope/ndvi/script.js | 288 +++++++++++++++++ .../planetscope}/ndvi_difference/eob.js | 0 .../planetscope/ndvi_difference/fig/fig1.png | Bin planet/planetscope/ndvi_difference/index.md | 42 +++ .../planetscope}/ndvi_difference/raw.js | 0 .../planetscope}/ndvi_difference/script.js | 0 .../planetscope}/ndwi/eob.js | 0 .../planetscope}/ndwi/fig/fig1.jpg | Bin .../planetscope/ndwi/index.md | 3 +- .../planetscope}/ndwi/raw.js | 0 planet/planetscope/ndwi/script.js | 30 ++ .../planetscope}/true_color/fig/fig1.jpg | Bin .../planetscope/true_color/index.md | 3 +- .../planetscope}/true_color/script.js | 0 skysat/skysat.md => planet/skysat/index.md | 8 +- {skysat => planet/skysat}/ndvi/eob.js | 0 .../skysat}/ndvi/fig/skysat_ndvi.jpeg | Bin .../README.md => planet/skysat/ndvi/index.md | 16 +- {skysat => planet/skysat}/ndvi/raw.js | 0 {skysat => planet/skysat}/ndvi/script.js | 0 .../panchromatic/fig/skysat_panchromatic.jpg | Bin planet/skysat/panchromatic/index.md | 37 +++ .../skysat}/panchromatic/script.js | 0 .../true_color/fig/skysat_true_color.jpeg | Bin .../skysat/true_color/index.md | 16 +- .../skysat}/true_color/script.js | 0 planet_scope/cloud_classification/script.js | 41 --- planet_scope/ndci/script.js | 12 - planet_scope/ndre/script.js | 12 - planet_scope/ndvi/eob.js | 40 --- planet_scope/ndvi/script.js | 12 - skysat/panchromatic/README.md | 23 -- 85 files changed, 1055 insertions(+), 217 deletions(-) delete mode 100644 analysis_ready_planetscope/ndvi/raw.js delete mode 100644 analysis_ready_planetscope/true_color/README.md rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/cloud_mask_classification/fig/fig1.png (100%) rename analysis_ready_planetscope/cloud_mask_classification/README.md => planet/analysis_ready_planetscope/cloud_mask_classification/index.md (53%) rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/cloud_mask_classification/raw.js (100%) rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/cloud_mask_classification/script.js (100%) rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/false_color/fig/fig1.png (100%) rename analysis_ready_planetscope/false_color/README.md => planet/analysis_ready_planetscope/false_color/index.md (53%) rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/false_color/script.js (100%) rename analysis_ready_planetscope/analysis_ready_planetscope.md => planet/analysis_ready_planetscope/index.md (72%) rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/ndvi/eob.js (100%) rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/ndvi/fig/fig1.png (100%) rename analysis_ready_planetscope/ndvi/README.md => planet/analysis_ready_planetscope/ndvi/index.md (58%) create mode 100644 planet/analysis_ready_planetscope/ndvi/raw.js rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/ndvi/script.js (99%) rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/true_color/fig/fig1.png (100%) create mode 100644 planet/analysis_ready_planetscope/true_color/index.md rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/true_color/script.js (100%) rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/true_color_cloud_masked/fig/fig1.png (100%) rename analysis_ready_planetscope/true_color_cloud_masked/README.md => planet/analysis_ready_planetscope/true_color_cloud_masked/index.md (57%) rename {analysis_ready_planetscope => planet/analysis_ready_planetscope}/true_color_cloud_masked/script.js (100%) rename {planet_scope => planet/planetscope}/cloud_classification/fig/fig1.png (100%) rename planet_scope/cloud_classification/README.md => planet/planetscope/cloud_classification/index.md (97%) create mode 100644 planet/planetscope/cloud_classification/script.js rename {planet_scope => planet/planetscope}/cloudless_mosaic/fig/fig1.png (100%) rename planet_scope/cloudless_mosaic/README.md => planet/planetscope/cloudless_mosaic/index.md (95%) rename {planet_scope => planet/planetscope}/cloudless_mosaic/script.js (100%) rename {planet_scope => planet/planetscope}/false_color/fig/fig1.jpg (100%) rename planet_scope/false_color/README.md => planet/planetscope/false_color/index.md (95%) rename {planet_scope => planet/planetscope}/false_color/script.js (100%) rename {planet_scope => planet/planetscope}/green_city/fig/fig1.jpg (100%) rename planet_scope/green_city/README.md => planet/planetscope/green_city/index.md (95%) rename {planet_scope => planet/planetscope}/green_city/script.js (100%) rename planet_scope/planet_scope.md => planet/planetscope/index.md (65%) rename {planet_scope => planet/planetscope}/max_ndvi/eob.js (100%) rename {planet_scope => planet/planetscope}/max_ndvi/fig/fig1.png (100%) rename planet_scope/max_ndvi/README.md => planet/planetscope/max_ndvi/index.md (97%) rename {planet_scope => planet/planetscope}/max_ndvi/raw.js (100%) rename {planet_scope => planet/planetscope}/max_ndvi/script.js (100%) rename {planet_scope => planet/planetscope}/ndci/eob.js (100%) rename {planet_scope => planet/planetscope}/ndci/fig/fig1.png (100%) rename planet_scope/ndci/README.md => planet/planetscope/ndci/index.md (96%) create mode 100644 planet/planetscope/ndci/raw.js create mode 100644 planet/planetscope/ndci/script.js rename {planet_scope => planet/planetscope}/ndre/eob.js (100%) rename {planet_scope => planet/planetscope}/ndre/fig/fig1.png (100%) rename planet_scope/ndre/README.md => planet/planetscope/ndre/index.md (96%) create mode 100644 planet/planetscope/ndre/raw.js create mode 100644 planet/planetscope/ndre/script.js create mode 100644 planet/planetscope/ndvi/eob.js rename {planet_scope => planet/planetscope}/ndvi/fig/fig1.png (100%) create mode 100644 planet/planetscope/ndvi/index.md create mode 100644 planet/planetscope/ndvi/raw.js create mode 100644 planet/planetscope/ndvi/script.js rename {planet_scope => planet/planetscope}/ndvi_difference/eob.js (100%) rename planet_scope/ndvi_difference/fig/fig1..png => planet/planetscope/ndvi_difference/fig/fig1.png (100%) create mode 100644 planet/planetscope/ndvi_difference/index.md rename {planet_scope => planet/planetscope}/ndvi_difference/raw.js (100%) rename {planet_scope => planet/planetscope}/ndvi_difference/script.js (100%) rename {planet_scope => planet/planetscope}/ndwi/eob.js (100%) rename {planet_scope => planet/planetscope}/ndwi/fig/fig1.jpg (100%) rename planet_scope/ndwi/README.md => planet/planetscope/ndwi/index.md (96%) rename {planet_scope => planet/planetscope}/ndwi/raw.js (100%) create mode 100644 planet/planetscope/ndwi/script.js rename {planet_scope => planet/planetscope}/true_color/fig/fig1.jpg (100%) rename planet_scope/true_color/README.md => planet/planetscope/true_color/index.md (94%) rename {planet_scope => planet/planetscope}/true_color/script.js (100%) rename skysat/skysat.md => planet/skysat/index.md (83%) rename {skysat => planet/skysat}/ndvi/eob.js (100%) rename {skysat => planet/skysat}/ndvi/fig/skysat_ndvi.jpeg (100%) rename skysat/ndvi/README.md => planet/skysat/ndvi/index.md (72%) rename {skysat => planet/skysat}/ndvi/raw.js (100%) rename {skysat => planet/skysat}/ndvi/script.js (100%) rename {skysat => planet/skysat}/panchromatic/fig/skysat_panchromatic.jpg (100%) create mode 100644 planet/skysat/panchromatic/index.md rename {skysat => planet/skysat}/panchromatic/script.js (100%) rename {skysat => planet/skysat}/true_color/fig/skysat_true_color.jpeg (100%) rename skysat/true_color/README.md => planet/skysat/true_color/index.md (52%) rename {skysat => planet/skysat}/true_color/script.js (100%) delete mode 100644 planet_scope/cloud_classification/script.js delete mode 100644 planet_scope/ndci/script.js delete mode 100644 planet_scope/ndre/script.js delete mode 100644 planet_scope/ndvi/eob.js delete mode 100644 planet_scope/ndvi/script.js delete mode 100644 skysat/panchromatic/README.md diff --git a/analysis_ready_planetscope/ndvi/raw.js b/analysis_ready_planetscope/ndvi/raw.js deleted file mode 100644 index e6af0b45..00000000 --- a/analysis_ready_planetscope/ndvi/raw.js +++ /dev/null @@ -1,15 +0,0 @@ -//VERSION=3 -// ndvi - -function setup() { - return { - input: ["nir", "red", "cloud_mask", "dataMask"], - output: { - bands: 4 - } - }; - } - -function evaluatePixel(sample) { - return [(sample.nir - sample.red) / (sample.nir + sample.red)]; -} \ No newline at end of file diff --git a/analysis_ready_planetscope/true_color/README.md b/analysis_ready_planetscope/true_color/README.md deleted file mode 100644 index 9627983c..00000000 --- a/analysis_ready_planetscope/true_color/README.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: True Color, Analysis Ready Planetscope -parent: Analysis Ready Planetscope -grand_parent: Planet -layout: script -nav_exclude: true -permalink: /analysis_ready_planetscope/true_color/ -scripts: - - [Visualization, script.js] ---- - -## General description -The true color product maps Analysis-Ready 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 image - -A true color visualization of Des Moines, United States (April 2023) - -![True Color of Des Moines](fig/fig1.png) \ No newline at end of file diff --git a/analysis_ready_planetscope/cloud_mask_classification/fig/fig1.png b/planet/analysis_ready_planetscope/cloud_mask_classification/fig/fig1.png similarity index 100% rename from analysis_ready_planetscope/cloud_mask_classification/fig/fig1.png rename to planet/analysis_ready_planetscope/cloud_mask_classification/fig/fig1.png diff --git a/analysis_ready_planetscope/cloud_mask_classification/README.md b/planet/analysis_ready_planetscope/cloud_mask_classification/index.md similarity index 53% rename from analysis_ready_planetscope/cloud_mask_classification/README.md rename to planet/analysis_ready_planetscope/cloud_mask_classification/index.md index 81aa4df3..bff988e7 100644 --- a/analysis_ready_planetscope/cloud_mask_classification/README.md +++ b/planet/analysis_ready_planetscope/cloud_mask_classification/index.md @@ -4,12 +4,26 @@ parent: Analysis Ready Planetscope grand_parent: Planet layout: script nav_exclude: true -permalink: /analysis_ready_planetscope/cloud_mask_classification/ scripts: - [Visualization, script.js] - [Raw Value, raw.js] +examples: +- zoom: '16' + lat: '-31.95291' + lng: '116.17321' + datasetId: '3f605f75-86c4-411a-b4ae-01c896f0e54e' + fromTime: '2023-04-29T00:00:00.000Z' + toTime: '2023-04-29T23:59:59.999Z' + platform: + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/analysis_ready_planetscope/cloud_mask_classification/script.js + additionalQueryParams: + - - themeId + - PLANET_SANDBOX --- +The example data is using Planet Sandox data. This data is restricted to Sentinel Hub users with active paid plans. If you are already a Planet Customer, see [here](https://community.planet.com/sentinel-hub-81/access-new-tools-for-analyzing-your-planet-data-on-sentinel-hub-732) on how to get access. + ## General description Analysis-Ready PlanetScope has several classifications within QA Band 1, “Cloud and shadow mask”. A value of 1 is clear, meaning that the surface is clearly visible. If it’s not clear, that means it’s classified as having some other type of contamination. In the script, each of the non-clear pixels in QA Band 1 are classified with a unique color, and the pixels that are clear are returned transparent. diff --git a/analysis_ready_planetscope/cloud_mask_classification/raw.js b/planet/analysis_ready_planetscope/cloud_mask_classification/raw.js similarity index 100% rename from analysis_ready_planetscope/cloud_mask_classification/raw.js rename to planet/analysis_ready_planetscope/cloud_mask_classification/raw.js diff --git a/analysis_ready_planetscope/cloud_mask_classification/script.js b/planet/analysis_ready_planetscope/cloud_mask_classification/script.js similarity index 100% rename from analysis_ready_planetscope/cloud_mask_classification/script.js rename to planet/analysis_ready_planetscope/cloud_mask_classification/script.js diff --git a/analysis_ready_planetscope/false_color/fig/fig1.png b/planet/analysis_ready_planetscope/false_color/fig/fig1.png similarity index 100% rename from analysis_ready_planetscope/false_color/fig/fig1.png rename to planet/analysis_ready_planetscope/false_color/fig/fig1.png diff --git a/analysis_ready_planetscope/false_color/README.md b/planet/analysis_ready_planetscope/false_color/index.md similarity index 53% rename from analysis_ready_planetscope/false_color/README.md rename to planet/analysis_ready_planetscope/false_color/index.md index 44840eb6..e3801ac5 100644 --- a/analysis_ready_planetscope/false_color/README.md +++ b/planet/analysis_ready_planetscope/false_color/index.md @@ -4,11 +4,25 @@ parent: Analysis Ready Planetscope grand_parent: Planet layout: script nav_exclude: true -permalink: /analysis_ready_planetscope/false_color/ scripts: - [Visualization, script.js] +examples: +- zoom: '16' + lat: '-31.95291' + lng: '116.17321' + datasetId: '3f605f75-86c4-411a-b4ae-01c896f0e54e' + fromTime: '2023-04-29T00:00:00.000Z' + toTime: '2023-04-29T23:59:59.999Z' + platform: + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/analysis_ready_planetscope/false_color/script.js + additionalQueryParams: + - - themeId + - PLANET_SANDBOX --- +The example data is using Planet Sandox data. This data is restricted to Sentinel Hub users with active paid plans. If you are already a Planet Customer, see [here](https://community.planet.com/sentinel-hub-81/access-new-tools-for-analyzing-your-planet-data-on-sentinel-hub-732) on how to get access. + ## General description The False color infrared composite maps near-infrared spectral band nir with red and green bands to sRGB components directly. It is most commonly used to assess plant density and health, 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. diff --git a/analysis_ready_planetscope/false_color/script.js b/planet/analysis_ready_planetscope/false_color/script.js similarity index 100% rename from analysis_ready_planetscope/false_color/script.js rename to planet/analysis_ready_planetscope/false_color/script.js diff --git a/analysis_ready_planetscope/analysis_ready_planetscope.md b/planet/analysis_ready_planetscope/index.md similarity index 72% rename from analysis_ready_planetscope/analysis_ready_planetscope.md rename to planet/analysis_ready_planetscope/index.md index ff191450..ca214d1d 100644 --- a/analysis_ready_planetscope/analysis_ready_planetscope.md +++ b/planet/analysis_ready_planetscope/index.md @@ -3,7 +3,6 @@ layout: default title: Analysis Ready PlanetScope nav_order: 2 parent: Planet -permalink: /planet/analysis_ready_planetscope/ --- # Analysis Ready PlanetScope @@ -11,8 +10,8 @@ Analysis-Ready PlanetScope combines the monitoring benefits of daily 3 m spatial ### Indices - - [True Color](/analysis_ready_planetscope/true_color) - - [False Color](/analysis_ready_planetscope/false_color) - - [NDVI](/analysis_ready_planetscope/ndvi) - - [Cloud Classification](/analysis_ready_planetscope/cloud_mask_classification) - - [Cloud Masked True Color](/analysis_ready_planetscope/true_color_cloud_masked) + - [True Color]({% link planet/analysis_ready_planetscope/true_color/index.md %}) + - [False Color]({% link planet/analysis_ready_planetscope/false_color/index.md %}) + - [NDVI]({% link planet/analysis_ready_planetscope/ndvi/index.md %}) + - [Cloud Classification]({% link planet/analysis_ready_planetscope/cloud_mask_classification/index.md %}) + - [Cloud Masked True Color]({% link planet/analysis_ready_planetscope/true_color_cloud_masked/index.md %}) diff --git a/analysis_ready_planetscope/ndvi/eob.js b/planet/analysis_ready_planetscope/ndvi/eob.js similarity index 100% rename from analysis_ready_planetscope/ndvi/eob.js rename to planet/analysis_ready_planetscope/ndvi/eob.js diff --git a/analysis_ready_planetscope/ndvi/fig/fig1.png b/planet/analysis_ready_planetscope/ndvi/fig/fig1.png similarity index 100% rename from analysis_ready_planetscope/ndvi/fig/fig1.png rename to planet/analysis_ready_planetscope/ndvi/fig/fig1.png diff --git a/analysis_ready_planetscope/ndvi/README.md b/planet/analysis_ready_planetscope/ndvi/index.md similarity index 58% rename from analysis_ready_planetscope/ndvi/README.md rename to planet/analysis_ready_planetscope/ndvi/index.md index 52163e11..6cb4d2b3 100644 --- a/analysis_ready_planetscope/ndvi/README.md +++ b/planet/analysis_ready_planetscope/ndvi/index.md @@ -4,13 +4,27 @@ parent: Analysis Ready Planetscope grand_parent: Planet layout: script nav_exclude: true -permalink: /analysis_ready_planetscope/ndvi/ scripts: - [Visualization, script.js] - [EO Browser, eob.js] - [Raw Values, raw.js] +examples: +- zoom: '16' + lat: '-31.95291' + lng: '116.17321' + datasetId: '3f605f75-86c4-411a-b4ae-01c896f0e54e' + fromTime: '2023-04-29T00:00:00.000Z' + toTime: '2023-04-29T23:59:59.999Z' + platform: + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/analysis_ready_planetscope/nvdi/eob.js + additionalQueryParams: + - - themeId + - PLANET_SANDBOX --- +The example data is using Planet Sandox data. This data is restricted to Sentinel Hub users with active paid plans. If you are already a Planet Customer, see [here](https://community.planet.com/sentinel-hub-81/access-new-tools-for-analyzing-your-planet-data-on-sentinel-hub-732) on how to get access. + ## General description The well known and widely used NDVI is a simple, but effective index for quantifying green vegetation. It normalizes green leaf scattering in Near Infra-red wavelengths with chlorophyll absorption in red wavelengths. The value range of the NDVI is -1 to 1. Negative values of NDVI (values approaching -1) correspond to water. Values close to zero (-0.1 to 0.1) generally correspond to barren areas of rock, sand, or snow. Low, positive values represent shrub and grassland (approximately 0.2 to 0.4), while high values indicate temperate and tropical rainforests (values approaching 1). diff --git a/planet/analysis_ready_planetscope/ndvi/raw.js b/planet/analysis_ready_planetscope/ndvi/raw.js new file mode 100644 index 00000000..335543ca --- /dev/null +++ b/planet/analysis_ready_planetscope/ndvi/raw.js @@ -0,0 +1,15 @@ +//VERSION=3 +// ndvi + +function setup() { + return { + input: ["nir", "red", "dataMask"], + output: { + bands: 4, + }, + }; +} + +function evaluatePixel(sample) { + return [(sample.nir - sample.red) / (sample.nir + sample.red)]; +} diff --git a/analysis_ready_planetscope/ndvi/script.js b/planet/analysis_ready_planetscope/ndvi/script.js similarity index 99% rename from analysis_ready_planetscope/ndvi/script.js rename to planet/analysis_ready_planetscope/ndvi/script.js index fa41f6c7..d267e18f 100644 --- a/analysis_ready_planetscope/ndvi/script.js +++ b/planet/analysis_ready_planetscope/ndvi/script.js @@ -3,7 +3,7 @@ function setup() { return { - input: ["nir", "red", "cloud_mask", "dataMask"], + input: ["nir", "red", "dataMask"], output: { bands: 4 } diff --git a/analysis_ready_planetscope/true_color/fig/fig1.png b/planet/analysis_ready_planetscope/true_color/fig/fig1.png similarity index 100% rename from analysis_ready_planetscope/true_color/fig/fig1.png rename to planet/analysis_ready_planetscope/true_color/fig/fig1.png diff --git a/planet/analysis_ready_planetscope/true_color/index.md b/planet/analysis_ready_planetscope/true_color/index.md new file mode 100644 index 00000000..cb6187d6 --- /dev/null +++ b/planet/analysis_ready_planetscope/true_color/index.md @@ -0,0 +1,33 @@ +--- +title: True Color, Analysis Ready Planetscope +parent: Analysis Ready Planetscope +grand_parent: Planet +layout: script +nav_exclude: true +scripts: + - [Visualization, script.js] +examples: +- zoom: '16' + lat: '-31.95291' + lng: '116.17321' + datasetId: '3f605f75-86c4-411a-b4ae-01c896f0e54e' + fromTime: '2023-04-29T00:00:00.000Z' + toTime: '2023-04-29T23:59:59.999Z' + platform: + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/analysis_ready_planetscope/true_color/script.js + additionalQueryParams: + - - themeId + - PLANET_SANDBOX +--- + +The example data is using Planet Sandox data. This data is restricted to Sentinel Hub users with active paid plans. If you are already a Planet Customer, see [here](https://community.planet.com/sentinel-hub-81/access-new-tools-for-analyzing-your-planet-data-on-sentinel-hub-732) on how to get access. + +## General description +The true color product maps Analysis-Ready 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 image + +A true color visualization of Des Moines, United States (April 2023) + +![True Color of Des Moines](fig/fig1.png) \ No newline at end of file diff --git a/analysis_ready_planetscope/true_color/script.js b/planet/analysis_ready_planetscope/true_color/script.js similarity index 100% rename from analysis_ready_planetscope/true_color/script.js rename to planet/analysis_ready_planetscope/true_color/script.js diff --git a/analysis_ready_planetscope/true_color_cloud_masked/fig/fig1.png b/planet/analysis_ready_planetscope/true_color_cloud_masked/fig/fig1.png similarity index 100% rename from analysis_ready_planetscope/true_color_cloud_masked/fig/fig1.png rename to planet/analysis_ready_planetscope/true_color_cloud_masked/fig/fig1.png diff --git a/analysis_ready_planetscope/true_color_cloud_masked/README.md b/planet/analysis_ready_planetscope/true_color_cloud_masked/index.md similarity index 57% rename from analysis_ready_planetscope/true_color_cloud_masked/README.md rename to planet/analysis_ready_planetscope/true_color_cloud_masked/index.md index 7d40de2d..8a09ae31 100644 --- a/analysis_ready_planetscope/true_color_cloud_masked/README.md +++ b/planet/analysis_ready_planetscope/true_color_cloud_masked/index.md @@ -4,11 +4,25 @@ parent: Analysis Ready Planetscope grand_parent: Planet layout: script nav_exclude: true -permalink: /analysis_ready_planetscope/true_color_cloud_masked/ scripts: - [Visualization, script.js] +examples: +- zoom: '16' + lat: '-31.95291' + lng: '116.17321' + datasetId: '3f605f75-86c4-411a-b4ae-01c896f0e54e' + fromTime: '2023-04-29T00:00:00.000Z' + toTime: '2023-04-29T23:59:59.999Z' + platform: + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/analysis_ready_planetscope/true_color_cloud_masked/script.js + additionalQueryParams: + - - themeId + - PLANET_SANDBOX --- +The example data is using Planet Sandox data. This data is restricted to Sentinel Hub users with active paid plans. If you are already a Planet Customer, see [here](https://community.planet.com/sentinel-hub-81/access-new-tools-for-analyzing-your-planet-data-on-sentinel-hub-732) on how to get access. + ## General description The first QA Band, Cloud and shadow mask 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 bright cloud, shadow, haze, adjacent clouds, additional cloud shadow or haze, or other. The script masks out all pixels where band QA1 does not have a value of 1 or “clear”. The resulting image has values of zero set for all four surface reflectance bands where clouds, cloud contamination, shadows, snow, etc. have been detected. diff --git a/analysis_ready_planetscope/true_color_cloud_masked/script.js b/planet/analysis_ready_planetscope/true_color_cloud_masked/script.js similarity index 100% rename from analysis_ready_planetscope/true_color_cloud_masked/script.js rename to planet/analysis_ready_planetscope/true_color_cloud_masked/script.js diff --git a/planet_scope/cloud_classification/fig/fig1.png b/planet/planetscope/cloud_classification/fig/fig1.png similarity index 100% rename from planet_scope/cloud_classification/fig/fig1.png rename to planet/planetscope/cloud_classification/fig/fig1.png diff --git a/planet_scope/cloud_classification/README.md b/planet/planetscope/cloud_classification/index.md similarity index 97% rename from planet_scope/cloud_classification/README.md rename to planet/planetscope/cloud_classification/index.md index 852a1ccb..7f90a253 100644 --- a/planet_scope/cloud_classification/README.md +++ b/planet/planetscope/cloud_classification/index.md @@ -3,7 +3,6 @@ title: UDM2 Mask Classification, PlanetScope parent: PlanetScope grand_parent: Planet layout: script -permalink: /planet_scope/cloud_classification/ nav_exclude: true --- diff --git a/planet/planetscope/cloud_classification/script.js b/planet/planetscope/cloud_classification/script.js new file mode 100644 index 00000000..6b137f32 --- /dev/null +++ b/planet/planetscope/cloud_classification/script.js @@ -0,0 +1,35 @@ +//VERSION=3 +//UDM2 Classification + +function setup() { + return { + input: [ + { + bands: ["clear", "snow", "shadow", "haze_light", "haze_heavy", "cloud"], + }, + ], + output: { + bands: 4, + }, + }; +} + +function evaluatePixel(samples) { + if (samples.snow == 1) { + return [0, 0.5, 1, 1]; // blue + } + if (samples.shadow == 1) { + return [0.4, 0.4, 0.4, 1]; //grey + } + if (samples.haze_light == 1) { + return [0, 0.9, 1, 1]; //sky blue + } + if (samples.haze_heavy == 1) { + return [1, 0.7, 1, 1]; //light pink + } + if (samples.cloud == 1) { + return [0.7, 0.7, 0.7, 1]; //white + } else { + return [0, 0, 0, 0]; + } +} diff --git a/planet_scope/cloudless_mosaic/fig/fig1.png b/planet/planetscope/cloudless_mosaic/fig/fig1.png similarity index 100% rename from planet_scope/cloudless_mosaic/fig/fig1.png rename to planet/planetscope/cloudless_mosaic/fig/fig1.png diff --git a/planet_scope/cloudless_mosaic/README.md b/planet/planetscope/cloudless_mosaic/index.md similarity index 95% rename from planet_scope/cloudless_mosaic/README.md rename to planet/planetscope/cloudless_mosaic/index.md index 6f65629a..20ece1ab 100644 --- a/planet_scope/cloudless_mosaic/README.md +++ b/planet/planetscope/cloudless_mosaic/index.md @@ -3,7 +3,6 @@ title: Cloudless Mosaic, PlanetScope parent: PlanetScope grand_parent: Planet layout: script -permalink: /planet_scope/cloudless_mosaic/ nav_exclude: true scripts: - [Visualization, script.js] diff --git a/planet_scope/cloudless_mosaic/script.js b/planet/planetscope/cloudless_mosaic/script.js similarity index 100% rename from planet_scope/cloudless_mosaic/script.js rename to planet/planetscope/cloudless_mosaic/script.js diff --git a/planet_scope/false_color/fig/fig1.jpg b/planet/planetscope/false_color/fig/fig1.jpg similarity index 100% rename from planet_scope/false_color/fig/fig1.jpg rename to planet/planetscope/false_color/fig/fig1.jpg diff --git a/planet_scope/false_color/README.md b/planet/planetscope/false_color/index.md similarity index 95% rename from planet_scope/false_color/README.md rename to planet/planetscope/false_color/index.md index a2692474..0f0b478b 100644 --- a/planet_scope/false_color/README.md +++ b/planet/planetscope/false_color/index.md @@ -3,7 +3,6 @@ title: False color infrared product, PlanetScope parent: PlanetScope grand_parent: Planet layout: script -permalink: /planet_scope/false_color/ nav_exclude: true examples: - zoom: '16' @@ -14,7 +13,7 @@ examples: toTime: '2023-04-19T23:59:59.999Z' platform: - EOB - evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet_scope/false_color/script.js + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/planetscope/false_color/script.js additionalQueryParams: - - themeId - PLANET_SANDBOX diff --git a/planet_scope/false_color/script.js b/planet/planetscope/false_color/script.js similarity index 100% rename from planet_scope/false_color/script.js rename to planet/planetscope/false_color/script.js diff --git a/planet_scope/green_city/fig/fig1.jpg b/planet/planetscope/green_city/fig/fig1.jpg similarity index 100% rename from planet_scope/green_city/fig/fig1.jpg rename to planet/planetscope/green_city/fig/fig1.jpg diff --git a/planet_scope/green_city/README.md b/planet/planetscope/green_city/index.md similarity index 95% rename from planet_scope/green_city/README.md rename to planet/planetscope/green_city/index.md index da2b699b..48e9dada 100644 --- a/planet_scope/green_city/README.md +++ b/planet/planetscope/green_city/index.md @@ -3,7 +3,6 @@ title: Green City Script, PlanetScope parent: PlanetScope grand_parent: Planet layout: script -permalink: /planet_scope/green_city/ nav_exclude: true examples: - zoom: '16' @@ -14,7 +13,7 @@ examples: toTime: '2023-04-19T23:59:59.999Z' platform: - EOB - evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet_scope/green_city/script.js + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/planetscope/green_city/script.js additionalQueryParams: - - themeId - PLANET_SANDBOX diff --git a/planet_scope/green_city/script.js b/planet/planetscope/green_city/script.js similarity index 100% rename from planet_scope/green_city/script.js rename to planet/planetscope/green_city/script.js diff --git a/planet_scope/planet_scope.md b/planet/planetscope/index.md similarity index 65% rename from planet_scope/planet_scope.md rename to planet/planetscope/index.md index 399f7c60..18745473 100644 --- a/planet_scope/planet_scope.md +++ b/planet/planetscope/index.md @@ -45,14 +45,14 @@ The spectral bands of PlanetScope data are the following if you order a 8-band p ### Indices - - [True Color](/planet_scope/true_color) - - [False Color](/planet_scope/false_color) - - [Cloudless Mosaic](/planet_scope/cloudless_mosaic) - - [NDVI](/planet_scope/ndvi) - - [Maximum NDVI](/planet_scope/max_ndvi) - - [NDVI Difference](/planet_scope/ndvi_difference) - - [NDWI](/planet_scope/ndwi) - - [NDCI - Normalized Difference Chlorophyll Index](/planet_scope/ndci) - - [NDRE - Normalized Difference Red Edge Index](/planet_scope/ndre) - - [Green City](/planet_scope/green_city) - - [UDM2 Cloud/Snow Classification](/planet_scope/cloud_classification) + - [True Color]({% link planet/planetscope/true_color/index.md %}) + - [False Color]({% link planet/planetscope/false_color/index.md %}) + - [Cloudless Mosaic]({% link planet/planetscope/cloudless_mosaic/index.md %}) + - [NDVI]({% link planet/planetscope/ndvi/index.md %}) + - [Maximum NDVI]({% link planet/planetscope/max_ndvi/index.md %}) + - [NDVI Difference]({% link planet/planetscope/ndvi_difference/index.md %}) + - [NDWI]({% link planet/planetscope/ndwi/index.md %}) + - [NDCI - Normalized Difference Chlorophyll Index]({% link planet/planetscope/ndci/index.md %}) + - [NDRE - Normalized Difference Red Edge Index]({% link planet/planetscope/ndre/index.md %}) + - [Green City]({% link planet/planetscope/green_city/index.md %}) + - [UDM2 Cloud/Snow Classification]({% link planet/planetscope/cloud_classification/index.md %}) diff --git a/planet_scope/max_ndvi/eob.js b/planet/planetscope/max_ndvi/eob.js similarity index 100% rename from planet_scope/max_ndvi/eob.js rename to planet/planetscope/max_ndvi/eob.js diff --git a/planet_scope/max_ndvi/fig/fig1.png b/planet/planetscope/max_ndvi/fig/fig1.png similarity index 100% rename from planet_scope/max_ndvi/fig/fig1.png rename to planet/planetscope/max_ndvi/fig/fig1.png diff --git a/planet_scope/max_ndvi/README.md b/planet/planetscope/max_ndvi/index.md similarity index 97% rename from planet_scope/max_ndvi/README.md rename to planet/planetscope/max_ndvi/index.md index 2f18ae83..ce179b47 100644 --- a/planet_scope/max_ndvi/README.md +++ b/planet/planetscope/max_ndvi/index.md @@ -3,7 +3,6 @@ title: 'Max Multitemporal NDVI' parent: Planetscope grand_parent: Planet layout: script -permalink: /planet_scope/max_ndvi/ nav_exclude: true scripts: - - Visualization diff --git a/planet_scope/max_ndvi/raw.js b/planet/planetscope/max_ndvi/raw.js similarity index 100% rename from planet_scope/max_ndvi/raw.js rename to planet/planetscope/max_ndvi/raw.js diff --git a/planet_scope/max_ndvi/script.js b/planet/planetscope/max_ndvi/script.js similarity index 100% rename from planet_scope/max_ndvi/script.js rename to planet/planetscope/max_ndvi/script.js diff --git a/planet_scope/ndci/eob.js b/planet/planetscope/ndci/eob.js similarity index 100% rename from planet_scope/ndci/eob.js rename to planet/planetscope/ndci/eob.js diff --git a/planet_scope/ndci/fig/fig1.png b/planet/planetscope/ndci/fig/fig1.png similarity index 100% rename from planet_scope/ndci/fig/fig1.png rename to planet/planetscope/ndci/fig/fig1.png diff --git a/planet_scope/ndci/README.md b/planet/planetscope/ndci/index.md similarity index 96% rename from planet_scope/ndci/README.md rename to planet/planetscope/ndci/index.md index 8c02cac3..47b7d20b 100644 --- a/planet_scope/ndci/README.md +++ b/planet/planetscope/ndci/index.md @@ -3,7 +3,6 @@ title: Normalized difference chlorophyll index, PlanetScope parent: PlanetScope grand_parent: Planet layout: script -permalink: /planet_scope/ndci/ nav_exclude: true scripts: - [Visualization, script.js] @@ -17,7 +16,7 @@ examples: toTime: '2023-04-19T23:59:59.999Z' platform: - EOB - evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet_scope/ndci/eob.js + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/planetscope/ndci/eob.js additionalQueryParams: - - themeId - PLANET_SANDBOX diff --git a/planet/planetscope/ndci/raw.js b/planet/planetscope/ndci/raw.js new file mode 100644 index 00000000..033361ab --- /dev/null +++ b/planet/planetscope/ndci/raw.js @@ -0,0 +1,18 @@ +//VERSION=3 +//PlanetScope NDRE + +function setup() { + return { + input: [ + { + bands: ["red", "rededge", "dataMask"], + }, + ], + output: { id: "default", bands: 1, sampleType: "FLOAT32" }, + }; +} + +function evaluatePixel(sample) { + let ndci = index(sample.rededge, sample.red); + return [ndci]; +} diff --git a/planet/planetscope/ndci/script.js b/planet/planetscope/ndci/script.js new file mode 100644 index 00000000..ba357718 --- /dev/null +++ b/planet/planetscope/ndci/script.js @@ -0,0 +1,32 @@ +//VERSION=3 +//PlanetScope NDRE + +function setup() { + return { + input: [ + { + bands: ["red", "rededge", "dataMask"], + }, + ], + output: { id: "default", bands: 4 }, + }; +} + +function evaluatePixel(sample) { + let ndci = index(sample.rededge, sample.red); + + let ndci_colored = colorBlend( + ndci, + [0.0, 0.2, 0.4, 0.6, 0.8, 1.0], + [ + [0, 0, 1], // Blue + [0, 0, 1], // Blue + [0, 1, 0], // Green + [0, 0.8, 0], // Yellow-green + [0, 0.6, 0], // Darker green + [0, 0.4, 0], // Even darker green + ] + ); + + return [...ndci_colored, sample.dataMask]; +} diff --git a/planet_scope/ndre/eob.js b/planet/planetscope/ndre/eob.js similarity index 100% rename from planet_scope/ndre/eob.js rename to planet/planetscope/ndre/eob.js diff --git a/planet_scope/ndre/fig/fig1.png b/planet/planetscope/ndre/fig/fig1.png similarity index 100% rename from planet_scope/ndre/fig/fig1.png rename to planet/planetscope/ndre/fig/fig1.png diff --git a/planet_scope/ndre/README.md b/planet/planetscope/ndre/index.md similarity index 96% rename from planet_scope/ndre/README.md rename to planet/planetscope/ndre/index.md index d0bf398d..79d09a92 100644 --- a/planet_scope/ndre/README.md +++ b/planet/planetscope/ndre/index.md @@ -3,11 +3,11 @@ title: Normalized difference red edge index, PlanetScope parent: PlanetScope grand_parent: Planet layout: script -permalink: /planet_scope/ndre/ nav_exclude: true scripts: - [Visualization, script.js] - [EO Browser, eob.js] + - [Raw Values, raw.js] examples: - zoom: '16' lat: '-32.10671' @@ -17,7 +17,7 @@ examples: toTime: '2023-04-19T23:59:59.999Z' platform: - EOB - evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet_scope/ndre/eob.js + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/planetscope/ndre/eob.js additionalQueryParams: - - themeId - PLANET_SANDBOX diff --git a/planet/planetscope/ndre/raw.js b/planet/planetscope/ndre/raw.js new file mode 100644 index 00000000..78325379 --- /dev/null +++ b/planet/planetscope/ndre/raw.js @@ -0,0 +1,18 @@ +//VERSION=3 +//PlanetScope NDRE + +function setup() { + return { + input: [ + { + bands: ["nir", "rededge", "dataMask"], + }, + ], + output: { id: "default", bands: 1, sampleType: "FLOAT32" }, + }; +} + +function evaluatePixel(sample) { + let ndre = index(sample.nir, sample.rededge); + return [ndre]; +} diff --git a/planet/planetscope/ndre/script.js b/planet/planetscope/ndre/script.js new file mode 100644 index 00000000..7dd19897 --- /dev/null +++ b/planet/planetscope/ndre/script.js @@ -0,0 +1,29 @@ +//VERSION=3 +//PlanetScope NDRE + +function setup() { + return { + input: [ + { + bands: ["nir", "rededge", "dataMask"], + }, + ], + output: { id: "default", bands: 4 }, + }; +} + +function evaluatePixel(sample) { + let ndre = index(sample.nir, sample.rededge); + + let ndre_colored = colorBlend( + ndre, + [0.0, 0.5, 1.0], + [ + [1, 0, 0], + [1, 1, 0], + [0.1, 0.31, 0], + ] + ); + + return [...ndre_colored, sample.dataMask]; +} diff --git a/planet/planetscope/ndvi/eob.js b/planet/planetscope/ndvi/eob.js new file mode 100644 index 00000000..124198f0 --- /dev/null +++ b/planet/planetscope/ndvi/eob.js @@ -0,0 +1,298 @@ +//VERSION=3 +// ndvi + +function setup() { + return { + input: ["NIR", "red", "clear", "dataMask"], + output: [ + { id: "default", bands: 4 }, + { id: "index", bands: 1, sampleType: "FLOAT32" }, + { id: "eobrowserStats", bands: 2, sampleType: "FLOAT32" }, + { id: "dataMask", bands: 1 }, + ], + }; +} + +const colorRamp = [ + [0, 0xfffdea], + [0.00390625, 0xfefce7], + [0.0078125, 0xfefbe5], + [0.01171875, 0xfdfae3], + [0.015625, 0xfcf9e0], + [0.01953125, 0xfbf8de], + [0.0234375, 0xfaf7dc], + [0.02734375, 0xfaf6d9], + [0.03125, 0xf9f5d7], + [0.03515625, 0xf8f4d5], + [0.0390625, 0xf7f3d2], + [0.04296875, 0xf6f2d0], + [0.046875, 0xf6f1ce], + [0.05078125, 0xf5f0cb], + [0.0546875, 0xf4efc9], + [0.05859375, 0xf3eec7], + [0.0625, 0xf3edc4], + [0.06640625, 0xf2ecc2], + [0.0703125, 0xf1ebbf], + [0.07421875, 0xf0eabd], + [0.078125, 0xf0e9ba], + [0.08203125, 0xefe8b8], + [0.0859375, 0xeee7b6], + [0.08984375, 0xeee6b3], + [0.09375, 0xede4b1], + [0.09765625, 0xece3ae], + [0.1015625, 0xebe2ac], + [0.10546875, 0xebe1a9], + [0.109375, 0xeae0a7], + [0.11328125, 0xe9dfa4], + [0.1171875, 0xe9dea2], + [0.12109375, 0xe8dd9f], + [0.125, 0xe7dc9c], + [0.12890625, 0xe6db9a], + [0.1328125, 0xe6da97], + [0.13671875, 0xe5d995], + [0.140625, 0xe4d892], + [0.14453125, 0xe4d78f], + [0.1484375, 0xe3d68d], + [0.15234375, 0xe2d58a], + [0.15625, 0xe2d487], + [0.16015625, 0xe1d384], + [0.1640625, 0xe0d281], + [0.16796875, 0xe0d17f], + [0.171875, 0xdfd07d], + [0.17578125, 0xdecf7a], + [0.1796875, 0xdece77], + [0.18359375, 0xddcd74], + [0.1875, 0xdccc71], + [0.19140625, 0xdccb6e], + [0.1953125, 0xdbca6a], + [0.19921875, 0xdac967], + [0.203125, 0xdac864], + [0.20703125, 0xd9c660], + [0.2109375, 0xd8c55d], + [0.21484375, 0xd8c459], + [0.21875, 0xd8c458], + [0.22265625, 0xd6c456], + [0.2265625, 0xd5c354], + [0.23046875, 0xd3c252], + [0.234375, 0xd2c250], + [0.23828125, 0xd0c14e], + [0.2421875, 0xcec04c], + [0.24609375, 0xcdc04a], + [0.25, 0xccbf48], + [0.25390625, 0xcabe46], + [0.2578125, 0xc9be44], + [0.26171875, 0xc7bd41], + [0.265625, 0xc5bc3f], + [0.26953125, 0xc4bb3d], + [0.2734375, 0xc2bb3a], + [0.27734375, 0xc0ba38], + [0.28125, 0xbfb935], + [0.28515625, 0xbdb932], + [0.2890625, 0xbbb82f], + [0.29296875, 0xbab72d], + [0.296875, 0xb8b729], + [0.30078125, 0xb6b626], + [0.3046875, 0xb5b523], + [0.30859375, 0xb3b51f], + [0.3125, 0xb1b41b], + [0.31640625, 0xb0b317], + [0.3203125, 0xaeb311], + [0.32421875, 0xacb20a], + [0.328125, 0xaab103], + [0.33203125, 0xa9b100], + [0.3359375, 0xa7b000], + [0.33984375, 0xa5af00], + [0.34375, 0xa3af00], + [0.34765625, 0xa2ae00], + [0.3515625, 0xa0ad00], + [0.35546875, 0x9ead00], + [0.359375, 0x9cac00], + [0.36328125, 0x9bac00], + [0.3671875, 0x99ab00], + [0.37109375, 0x97aa00], + [0.375, 0x95a900], + [0.37890625, 0x93a900], + [0.3828125, 0x92a800], + [0.38671875, 0x90a700], + [0.390625, 0x8ea700], + [0.39453125, 0x8ca600], + [0.3984375, 0x8aa500], + [0.40234375, 0x89a400], + [0.40625, 0x87a400], + [0.41015625, 0x85a300], + [0.4140625, 0x83a200], + [0.41796875, 0x82a200], + [0.421875, 0x80a100], + [0.42578125, 0x7ea000], + [0.4296875, 0x7c9f00], + [0.43359375, 0x7a9f00], + [0.4375, 0x799e00], + [0.44140625, 0x779d00], + [0.4453125, 0x759c00], + [0.44921875, 0x739c00], + [0.453125, 0x729b00], + [0.45703125, 0x709a00], + [0.4609375, 0x6e9900], + [0.46484375, 0x6c9900], + [0.46875, 0x6a9800], + [0.47265625, 0x699700], + [0.4765625, 0x679600], + [0.48046875, 0x659600], + [0.484375, 0x639500], + [0.48828125, 0x619400], + [0.4921875, 0x609300], + [0.49609375, 0x5e9300], + [0.5, 0x5c9300], + [0.50390625, 0x5a9200], + [0.5078125, 0x589100], + [0.51171875, 0x579000], + [0.515625, 0x558f00], + [0.51953125, 0x538f01], + [0.5234375, 0x518e03], + [0.52734375, 0x4f8d05], + [0.53125, 0x4d8c07], + [0.53515625, 0x4b8c09], + [0.5390625, 0x498b0b], + [0.54296875, 0x478a0d], + [0.546875, 0x45890f], + [0.55078125, 0x438810], + [0.5546875, 0x418812], + [0.55859375, 0x3f8713], + [0.5625, 0x3d8614], + [0.56640625, 0x3b8516], + [0.5703125, 0x398517], + [0.57421875, 0x378418], + [0.578125, 0x358319], + [0.58203125, 0x33821a], + [0.5859375, 0x31811b], + [0.58984375, 0x2e811c], + [0.59375, 0x2c801d], + [0.59765625, 0x2a7f1d], + [0.6015625, 0x277e1e], + [0.60546875, 0x257d1f], + [0.609375, 0x227d20], + [0.61328125, 0x1f7c20], + [0.6171875, 0x1c7b21], + [0.62109375, 0x197a22], + [0.625, 0x157922], + [0.62890625, 0x117923], + [0.6328125, 0x0c7824], + [0.63671875, 0x067724], + [0.640625, 0x027625], + [0.64453125, 0x007525], + [0.6484375, 0x007526], + [0.65234375, 0x007426], + [0.65625, 0x007327], + [0.66015625, 0x007227], + [0.6640625, 0x007128], + [0.66796875, 0x007028], + [0.671875, 0x007029], + [0.67578125, 0x006f29], + [0.6796875, 0x006e29], + [0.68359375, 0x006d2a], + [0.6875, 0x006c2a], + [0.69140625, 0x006c2a], + [0.6953125, 0x006b2b], + [0.69921875, 0x006a2b], + [0.703125, 0x00692b], + [0.70703125, 0x00682c], + [0.7109375, 0x00672c], + [0.71484375, 0x00672c], + [0.71875, 0x00662c], + [0.72265625, 0x00652d], + [0.7265625, 0x00642d], + [0.73046875, 0x00632d], + [0.734375, 0x00622d], + [0.73828125, 0x00622d], + [0.7421875, 0x00612e], + [0.74609375, 0x00602e], + [0.75, 0x005f2e], + [0.75390625, 0x005e2e], + [0.7578125, 0x005d2e], + [0.76171875, 0x005d2e], + [0.765625, 0x005c2e], + [0.76953125, 0x005b2e], + [0.7734375, 0x005a2e], + [0.77734375, 0x00592f], + [0.78125, 0x00582f], + [0.78515625, 0x00582f], + [0.7890625, 0x00572f], + [0.79296875, 0x00562f], + [0.796875, 0x00552f], + [0.80078125, 0x00542f], + [0.8046875, 0x00532f], + [0.80859375, 0x00532f], + [0.8125, 0x00522f], + [0.81640625, 0x00512f], + [0.8203125, 0x00502f], + [0.82421875, 0x004f2f], + [0.828125, 0x004e2e], + [0.83203125, 0x004d2e], + [0.8359375, 0x004d2e], + [0.83984375, 0x004c2e], + [0.84375, 0x004b2e], + [0.84765625, 0x004a2e], + [0.8515625, 0x00492e], + [0.85546875, 0x00482e], + [0.859375, 0x00472e], + [0.86328125, 0x00472e], + [0.8671875, 0x00462d], + [0.87109375, 0x00452d], + [0.875, 0x00442d], + [0.87890625, 0x00432d], + [0.8828125, 0x00422d], + [0.88671875, 0x00412c], + [0.890625, 0x00412c], + [0.89453125, 0x00402c], + [0.8984375, 0x003f2c], + [0.90234375, 0x003e2c], + [0.90625, 0x003d2b], + [0.91015625, 0x003c2b], + [0.9140625, 0x003b2b], + [0.91796875, 0x003a2b], + [0.921875, 0x003a2a], + [0.92578125, 0x00392a], + [0.9296875, 0x00382a], + [0.93359375, 0x003729], + [0.9375, 0x003629], + [0.94140625, 0x003529], + [0.9453125, 0x003428], + [0.94921875, 0x003328], + [0.953125, 0x003228], + [0.95703125, 0x003127], + [0.9609375, 0x003027], + [0.96484375, 0x002f26], + [0.96875, 0x002e26], + [0.97265625, 0x002d25], + [0.9765625, 0x002c25], + [0.98046875, 0x002b24], + [0.984375, 0x002a24], + [0.98828125, 0x002923], + [0.9921875, 0x002823], + [0.99609375, 0x002622], + [1, 0x072421], +]; + +let viz = new ColorRampVisualizer(colorRamp); + +function evaluatePixel(sample) { + let ndvi = index(sample.NIR, sample.red); + const minIndex = 0; + const maxIndex = 1; + let visVal = null; + + if (ndvi > maxIndex || ndvi < minIndex) { + visVal = [0, 0, 0, 0]; + } else { + visVal = [...viz.process(ndvi), sample.dataMask]; + } + + const indexVal = sample.dataMask === 1 ? ndvi : NaN; + + return { + default: visVal, + index: [indexVal], + eobrowserStats: [ndvi, sample.clear], + dataMask: [sample.dataMask], + }; +} diff --git a/planet_scope/ndvi/fig/fig1.png b/planet/planetscope/ndvi/fig/fig1.png similarity index 100% rename from planet_scope/ndvi/fig/fig1.png rename to planet/planetscope/ndvi/fig/fig1.png diff --git a/planet/planetscope/ndvi/index.md b/planet/planetscope/ndvi/index.md new file mode 100644 index 00000000..a47c9d14 --- /dev/null +++ b/planet/planetscope/ndvi/index.md @@ -0,0 +1,47 @@ +--- +title: Normalized difference vegetation index, PlanetScope +parent: PlanetScope +grand_parent: Planet +layout: script +nav_exclude: true +scripts: + - [Visualization, script.js] + - [EO Browser, eob.js] + - [Raw Values, raw.js] +examples: +- zoom: '16' + lat: '-32.10671' + lng: '116.00704' + datasetId: 'ccb1f8f0-e5bf-4c31-afe5-d8803bcbde2a' + fromTime: '2023-04-19T00:00:00.000Z' + toTime: '2023-04-19T23:59:59.999Z' + platform: + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/planetscope/ndvi/eob.js + additionalQueryParams: + - - themeId + - PLANET_SANDBOX +--- + +The example data is using Planet Sandox data. This data is restricted to Sentinel Hub users with active paid plans. If you are already a Planet Customer, see [here](https://community.planet.com/sentinel-hub-81/access-new-tools-for-analyzing-your-planet-data-on-sentinel-hub-732) on how to get access. + +## General description + +The well known and widely used NDVI is a simple, but effective index for quantifying green vegetation. It normalizes green leaf scattering in Near Infra-red wavelengths with chlorophyll absorption in red wavelengths. + +The value range of the NDVI is -1 to 1. Negative values of NDVI (values approaching -1) correspond to water. Values close to zero (-0.1 to 0.1) generally correspond to barren areas of rock, sand, or snow. Low, positive values represent shrub and grassland (approximately 0.2 to 0.4), while high values indicate temperate and tropical rainforests (values approaching 1). It is a good proxy for live green vegetation; see [1] for details. + +The normalized difference vegetation index, abbreviated NDVI, is defined as + +$$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 How Can I Configure My Layers For Statistical Information In EO Browser? + +## Representative images + +NDVI of agriculture fields in Iowa. + + + +## References + [1] Wikipedia, [Normalized Difference Vegetation Index](https://en.wikipedia.org/wiki/Normalized_Difference_Vegetation_Index). Accessed on October 4th 2017. diff --git a/planet/planetscope/ndvi/raw.js b/planet/planetscope/ndvi/raw.js new file mode 100644 index 00000000..4fb08a3a --- /dev/null +++ b/planet/planetscope/ndvi/raw.js @@ -0,0 +1,15 @@ +//VERSION=3 +// ndvi + +function setup() { + return { + input: ["NIR", "red", "dataMask"], + output: { + bands: 4, + }, + }; +} + +function evaluatePixel(sample) { + return [index(sample.NIR, sample.red)]; +} diff --git a/planet/planetscope/ndvi/script.js b/planet/planetscope/ndvi/script.js new file mode 100644 index 00000000..e2e62a3b --- /dev/null +++ b/planet/planetscope/ndvi/script.js @@ -0,0 +1,288 @@ +//VERSION=3 +// ndvi + +function setup() { + return { + input: ["NIR", "red", "dataMask"], + output: { + bands: 4, + }, + }; +} + +const colorRamp = [ + [0, 0xfffdea], + [0.00390625, 0xfefce7], + [0.0078125, 0xfefbe5], + [0.01171875, 0xfdfae3], + [0.015625, 0xfcf9e0], + [0.01953125, 0xfbf8de], + [0.0234375, 0xfaf7dc], + [0.02734375, 0xfaf6d9], + [0.03125, 0xf9f5d7], + [0.03515625, 0xf8f4d5], + [0.0390625, 0xf7f3d2], + [0.04296875, 0xf6f2d0], + [0.046875, 0xf6f1ce], + [0.05078125, 0xf5f0cb], + [0.0546875, 0xf4efc9], + [0.05859375, 0xf3eec7], + [0.0625, 0xf3edc4], + [0.06640625, 0xf2ecc2], + [0.0703125, 0xf1ebbf], + [0.07421875, 0xf0eabd], + [0.078125, 0xf0e9ba], + [0.08203125, 0xefe8b8], + [0.0859375, 0xeee7b6], + [0.08984375, 0xeee6b3], + [0.09375, 0xede4b1], + [0.09765625, 0xece3ae], + [0.1015625, 0xebe2ac], + [0.10546875, 0xebe1a9], + [0.109375, 0xeae0a7], + [0.11328125, 0xe9dfa4], + [0.1171875, 0xe9dea2], + [0.12109375, 0xe8dd9f], + [0.125, 0xe7dc9c], + [0.12890625, 0xe6db9a], + [0.1328125, 0xe6da97], + [0.13671875, 0xe5d995], + [0.140625, 0xe4d892], + [0.14453125, 0xe4d78f], + [0.1484375, 0xe3d68d], + [0.15234375, 0xe2d58a], + [0.15625, 0xe2d487], + [0.16015625, 0xe1d384], + [0.1640625, 0xe0d281], + [0.16796875, 0xe0d17f], + [0.171875, 0xdfd07d], + [0.17578125, 0xdecf7a], + [0.1796875, 0xdece77], + [0.18359375, 0xddcd74], + [0.1875, 0xdccc71], + [0.19140625, 0xdccb6e], + [0.1953125, 0xdbca6a], + [0.19921875, 0xdac967], + [0.203125, 0xdac864], + [0.20703125, 0xd9c660], + [0.2109375, 0xd8c55d], + [0.21484375, 0xd8c459], + [0.21875, 0xd8c458], + [0.22265625, 0xd6c456], + [0.2265625, 0xd5c354], + [0.23046875, 0xd3c252], + [0.234375, 0xd2c250], + [0.23828125, 0xd0c14e], + [0.2421875, 0xcec04c], + [0.24609375, 0xcdc04a], + [0.25, 0xccbf48], + [0.25390625, 0xcabe46], + [0.2578125, 0xc9be44], + [0.26171875, 0xc7bd41], + [0.265625, 0xc5bc3f], + [0.26953125, 0xc4bb3d], + [0.2734375, 0xc2bb3a], + [0.27734375, 0xc0ba38], + [0.28125, 0xbfb935], + [0.28515625, 0xbdb932], + [0.2890625, 0xbbb82f], + [0.29296875, 0xbab72d], + [0.296875, 0xb8b729], + [0.30078125, 0xb6b626], + [0.3046875, 0xb5b523], + [0.30859375, 0xb3b51f], + [0.3125, 0xb1b41b], + [0.31640625, 0xb0b317], + [0.3203125, 0xaeb311], + [0.32421875, 0xacb20a], + [0.328125, 0xaab103], + [0.33203125, 0xa9b100], + [0.3359375, 0xa7b000], + [0.33984375, 0xa5af00], + [0.34375, 0xa3af00], + [0.34765625, 0xa2ae00], + [0.3515625, 0xa0ad00], + [0.35546875, 0x9ead00], + [0.359375, 0x9cac00], + [0.36328125, 0x9bac00], + [0.3671875, 0x99ab00], + [0.37109375, 0x97aa00], + [0.375, 0x95a900], + [0.37890625, 0x93a900], + [0.3828125, 0x92a800], + [0.38671875, 0x90a700], + [0.390625, 0x8ea700], + [0.39453125, 0x8ca600], + [0.3984375, 0x8aa500], + [0.40234375, 0x89a400], + [0.40625, 0x87a400], + [0.41015625, 0x85a300], + [0.4140625, 0x83a200], + [0.41796875, 0x82a200], + [0.421875, 0x80a100], + [0.42578125, 0x7ea000], + [0.4296875, 0x7c9f00], + [0.43359375, 0x7a9f00], + [0.4375, 0x799e00], + [0.44140625, 0x779d00], + [0.4453125, 0x759c00], + [0.44921875, 0x739c00], + [0.453125, 0x729b00], + [0.45703125, 0x709a00], + [0.4609375, 0x6e9900], + [0.46484375, 0x6c9900], + [0.46875, 0x6a9800], + [0.47265625, 0x699700], + [0.4765625, 0x679600], + [0.48046875, 0x659600], + [0.484375, 0x639500], + [0.48828125, 0x619400], + [0.4921875, 0x609300], + [0.49609375, 0x5e9300], + [0.5, 0x5c9300], + [0.50390625, 0x5a9200], + [0.5078125, 0x589100], + [0.51171875, 0x579000], + [0.515625, 0x558f00], + [0.51953125, 0x538f01], + [0.5234375, 0x518e03], + [0.52734375, 0x4f8d05], + [0.53125, 0x4d8c07], + [0.53515625, 0x4b8c09], + [0.5390625, 0x498b0b], + [0.54296875, 0x478a0d], + [0.546875, 0x45890f], + [0.55078125, 0x438810], + [0.5546875, 0x418812], + [0.55859375, 0x3f8713], + [0.5625, 0x3d8614], + [0.56640625, 0x3b8516], + [0.5703125, 0x398517], + [0.57421875, 0x378418], + [0.578125, 0x358319], + [0.58203125, 0x33821a], + [0.5859375, 0x31811b], + [0.58984375, 0x2e811c], + [0.59375, 0x2c801d], + [0.59765625, 0x2a7f1d], + [0.6015625, 0x277e1e], + [0.60546875, 0x257d1f], + [0.609375, 0x227d20], + [0.61328125, 0x1f7c20], + [0.6171875, 0x1c7b21], + [0.62109375, 0x197a22], + [0.625, 0x157922], + [0.62890625, 0x117923], + [0.6328125, 0x0c7824], + [0.63671875, 0x067724], + [0.640625, 0x027625], + [0.64453125, 0x007525], + [0.6484375, 0x007526], + [0.65234375, 0x007426], + [0.65625, 0x007327], + [0.66015625, 0x007227], + [0.6640625, 0x007128], + [0.66796875, 0x007028], + [0.671875, 0x007029], + [0.67578125, 0x006f29], + [0.6796875, 0x006e29], + [0.68359375, 0x006d2a], + [0.6875, 0x006c2a], + [0.69140625, 0x006c2a], + [0.6953125, 0x006b2b], + [0.69921875, 0x006a2b], + [0.703125, 0x00692b], + [0.70703125, 0x00682c], + [0.7109375, 0x00672c], + [0.71484375, 0x00672c], + [0.71875, 0x00662c], + [0.72265625, 0x00652d], + [0.7265625, 0x00642d], + [0.73046875, 0x00632d], + [0.734375, 0x00622d], + [0.73828125, 0x00622d], + [0.7421875, 0x00612e], + [0.74609375, 0x00602e], + [0.75, 0x005f2e], + [0.75390625, 0x005e2e], + [0.7578125, 0x005d2e], + [0.76171875, 0x005d2e], + [0.765625, 0x005c2e], + [0.76953125, 0x005b2e], + [0.7734375, 0x005a2e], + [0.77734375, 0x00592f], + [0.78125, 0x00582f], + [0.78515625, 0x00582f], + [0.7890625, 0x00572f], + [0.79296875, 0x00562f], + [0.796875, 0x00552f], + [0.80078125, 0x00542f], + [0.8046875, 0x00532f], + [0.80859375, 0x00532f], + [0.8125, 0x00522f], + [0.81640625, 0x00512f], + [0.8203125, 0x00502f], + [0.82421875, 0x004f2f], + [0.828125, 0x004e2e], + [0.83203125, 0x004d2e], + [0.8359375, 0x004d2e], + [0.83984375, 0x004c2e], + [0.84375, 0x004b2e], + [0.84765625, 0x004a2e], + [0.8515625, 0x00492e], + [0.85546875, 0x00482e], + [0.859375, 0x00472e], + [0.86328125, 0x00472e], + [0.8671875, 0x00462d], + [0.87109375, 0x00452d], + [0.875, 0x00442d], + [0.87890625, 0x00432d], + [0.8828125, 0x00422d], + [0.88671875, 0x00412c], + [0.890625, 0x00412c], + [0.89453125, 0x00402c], + [0.8984375, 0x003f2c], + [0.90234375, 0x003e2c], + [0.90625, 0x003d2b], + [0.91015625, 0x003c2b], + [0.9140625, 0x003b2b], + [0.91796875, 0x003a2b], + [0.921875, 0x003a2a], + [0.92578125, 0x00392a], + [0.9296875, 0x00382a], + [0.93359375, 0x003729], + [0.9375, 0x003629], + [0.94140625, 0x003529], + [0.9453125, 0x003428], + [0.94921875, 0x003328], + [0.953125, 0x003228], + [0.95703125, 0x003127], + [0.9609375, 0x003027], + [0.96484375, 0x002f26], + [0.96875, 0x002e26], + [0.97265625, 0x002d25], + [0.9765625, 0x002c25], + [0.98046875, 0x002b24], + [0.984375, 0x002a24], + [0.98828125, 0x002923], + [0.9921875, 0x002823], + [0.99609375, 0x002622], + [1, 0x072421], +]; + +let viz = new ColorRampVisualizer(colorRamp); + +function evaluatePixel(sample) { + let ndvi = index(sample.NIR, sample.red); + const minIndex = 0; + const maxIndex = 1; + let visVal = null; + + if (ndvi > maxIndex || ndvi < minIndex) { + visVal = [0, 0, 0, 0]; + } else { + visVal = [...viz.process(ndvi), sample.dataMask]; + } + + return visVal; +} diff --git a/planet_scope/ndvi_difference/eob.js b/planet/planetscope/ndvi_difference/eob.js similarity index 100% rename from planet_scope/ndvi_difference/eob.js rename to planet/planetscope/ndvi_difference/eob.js diff --git a/planet_scope/ndvi_difference/fig/fig1..png b/planet/planetscope/ndvi_difference/fig/fig1.png similarity index 100% rename from planet_scope/ndvi_difference/fig/fig1..png rename to planet/planetscope/ndvi_difference/fig/fig1.png diff --git a/planet/planetscope/ndvi_difference/index.md b/planet/planetscope/ndvi_difference/index.md new file mode 100644 index 00000000..efbc4537 --- /dev/null +++ b/planet/planetscope/ndvi_difference/index.md @@ -0,0 +1,42 @@ +--- +title: NDVI difference between two dates +parent: Planetscope +grand_parent: Planet +layout: script +nav_exclude: true +scripts: +- - Visualization + - script.js +- - EO Browser + - eob.js +- - Raw Values + - raw.js +examples: +- zoom: '14' + lat: '52.24714' + lng: '9.20886' + datasetId: Planetscope + fromTime: '2023-04-02T00:00:00.000Z' + toTime: '2023-06-01T23:59:59.999Z' + platform: + - EOB + evalscripturl: https://raw.githubusercontent.com/sentinel-hub/custom-scripts/master/planet_scope/ndvi_difference/script.js + additionalQueryParams: + - - themeId + - PLANET_SANDBOX +--- + +## General description +This script aims to obtain the diffence of NDVI between the latest acquisition and the acquisition 10-day prior to the latest on within a specified time period. Multi-temporal analysis is common in the Earth Observation field. Here we take NDVI as an example and demonstrate how to calculate the difference of NDVI between two acquisitions using [`mosaicking: ORBIT`](https://docs.sentinel-hub.com/api/latest/evalscript/v3/#mosaicking) and [`preProcessScenes`](https://docs.sentinel-hub.com/api/latest/evalscript/v3/#preprocessscenes-function-optional) in one single request. + +To implement multi-temporal analysis in the Evalscript, we apply `ORBIT` mosaicking to query daily mosaic in the specified time period. Then, by using the optional `preProcessScenes` function, we find out the acquisition acquired on the date closest to the date 10-day prior to the latest acquisition and filter the out the other unused acquisitions to save Processing Units. Last but not least, in the `evaluatePixel` function we initialise a combined mask to ensure the difference of NDVI between two acquisitions exists only if there is data on both dates. + +**Note**: The example script is used to obtain the raw value of NDVI difference. For visualisation purpose, please follow the EO Browser link in the [Evaluate and visualize](#evaluate-and-visualize) section. The visualisation script contains 4 outputs: default, index, eobrowserStats and dataMask. The default layer is a visualisation layer to visualise NDVI difference in EO Browser. The index layer is the actual value of the NDVI difference. The eobrowserStats and the dataMask layer is configured to activate statistical features on EO Browser. Please see the [FAQ](https://www.sentinel-hub.com/faq/#how-configure-your-layers-statistical-info-eo-browser) for more details. + +## Author of the script + +William Ray + +## Description of representative images +The following image shows the NDVI difference between the latest acquisition and the acquisition 10-day prior to the latest one during the time period from 2nd of April, 2023 to 2nd June, 2023. +![NDVI difference example](fig/fig1.png) diff --git a/planet_scope/ndvi_difference/raw.js b/planet/planetscope/ndvi_difference/raw.js similarity index 100% rename from planet_scope/ndvi_difference/raw.js rename to planet/planetscope/ndvi_difference/raw.js diff --git a/planet_scope/ndvi_difference/script.js b/planet/planetscope/ndvi_difference/script.js similarity index 100% rename from planet_scope/ndvi_difference/script.js rename to planet/planetscope/ndvi_difference/script.js diff --git a/planet_scope/ndwi/eob.js b/planet/planetscope/ndwi/eob.js similarity index 100% rename from planet_scope/ndwi/eob.js rename to planet/planetscope/ndwi/eob.js diff --git a/planet_scope/ndwi/fig/fig1.jpg b/planet/planetscope/ndwi/fig/fig1.jpg similarity index 100% rename from planet_scope/ndwi/fig/fig1.jpg rename to planet/planetscope/ndwi/fig/fig1.jpg diff --git a/planet_scope/ndwi/README.md b/planet/planetscope/ndwi/index.md similarity index 96% rename from planet_scope/ndwi/README.md rename to planet/planetscope/ndwi/index.md index aa0d6bd1..c37e9ee3 100644 --- a/planet_scope/ndwi/README.md +++ b/planet/planetscope/ndwi/index.md @@ -3,7 +3,6 @@ title: NDWI Normalized Difference Water Index, PlanetScope parent: PlanetScope grand_parent: Planet layout: script -permalink: /planet_scope/ndwi/ nav_exclude: true scripts: - - Visualization @@ -21,7 +20,7 @@ examples: toTime: '2023-04-19T23:59:59.999Z' platform: - EOB - evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet_scope/ndwi/eob.js + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/planetscope/ndwi/eob.js additionalQueryParams: - - themeId - PLANET_SANDBOX diff --git a/planet_scope/ndwi/raw.js b/planet/planetscope/ndwi/raw.js similarity index 100% rename from planet_scope/ndwi/raw.js rename to planet/planetscope/ndwi/raw.js diff --git a/planet/planetscope/ndwi/script.js b/planet/planetscope/ndwi/script.js new file mode 100644 index 00000000..3e56a725 --- /dev/null +++ b/planet/planetscope/ndwi/script.js @@ -0,0 +1,30 @@ +//VERSION=3 +//NDWI + +function setup() { + return { + input: [{ bands: ["green", "nir", "dataMask"] }], + output: [ + { id: "default", bands: 4 }, + ] + } +} + +function evaluatePixel(sample) { + let ndwi = index(green, nir); + + let id_default = colorBlend(ndwi, + [-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0], + [ + [1, 0, 1], + [1, 0.5, 0], + [1, 1, 0], + [0.2, 1, 0.5], + [0, 0, 1], + [0, 0, 0.3], + [0, 0, 0], + ] + ); + + return { default: [...id_default, sample.dataMask] }; +} diff --git a/planet_scope/true_color/fig/fig1.jpg b/planet/planetscope/true_color/fig/fig1.jpg similarity index 100% rename from planet_scope/true_color/fig/fig1.jpg rename to planet/planetscope/true_color/fig/fig1.jpg diff --git a/planet_scope/true_color/README.md b/planet/planetscope/true_color/index.md similarity index 94% rename from planet_scope/true_color/README.md rename to planet/planetscope/true_color/index.md index d58f1427..6e795d8c 100644 --- a/planet_scope/true_color/README.md +++ b/planet/planetscope/true_color/index.md @@ -3,7 +3,6 @@ title: True color product, PlanetScope parent: PlanetScope grand_parent: Planet layout: script -permalink: /planet_scope/true_color/ nav_exclude: true examples: - zoom: '16' @@ -14,7 +13,7 @@ examples: toTime: '2023-04-19T23:59:59.999Z' platform: - EOB - evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet_scope/true_color/script.js + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/planetscope/true_color/script.js additionalQueryParams: - - themeId - PLANET_SANDBOX diff --git a/planet_scope/true_color/script.js b/planet/planetscope/true_color/script.js similarity index 100% rename from planet_scope/true_color/script.js rename to planet/planetscope/true_color/script.js diff --git a/skysat/skysat.md b/planet/skysat/index.md similarity index 83% rename from skysat/skysat.md rename to planet/skysat/index.md index f346c6f4..20d6cf96 100644 --- a/skysat/skysat.md +++ b/planet/skysat/index.md @@ -3,7 +3,6 @@ layout: default title: SkySat nav_order: 2 parent: Planet -permalink: /planet/skysat/ --- # SkySat (Commercial) @@ -22,6 +21,7 @@ The spectral bands of SkySat data are the following: *pan - 450-900nm Panchromatic, resolution 0.5* - - [True Color](/skysat/true_color) - - [Panchromatic](/skysat/panchromatic) - - [NDVI with visualization](/skysat/ndvi) \ No newline at end of file + + - [True Color]({% link planet/skysat/true_color/index.md %}) + - [Panchromatic]({% link planet/skysat/panchromatic/index.md %}) + - [NDVI with visualization]({% link planet/skysat/ndvi/index.md %}) \ No newline at end of file diff --git a/skysat/ndvi/eob.js b/planet/skysat/ndvi/eob.js similarity index 100% rename from skysat/ndvi/eob.js rename to planet/skysat/ndvi/eob.js diff --git a/skysat/ndvi/fig/skysat_ndvi.jpeg b/planet/skysat/ndvi/fig/skysat_ndvi.jpeg similarity index 100% rename from skysat/ndvi/fig/skysat_ndvi.jpeg rename to planet/skysat/ndvi/fig/skysat_ndvi.jpeg diff --git a/skysat/ndvi/README.md b/planet/skysat/ndvi/index.md similarity index 72% rename from skysat/ndvi/README.md rename to planet/skysat/ndvi/index.md index 6b7c5dbf..a67d9de2 100644 --- a/skysat/ndvi/README.md +++ b/planet/skysat/ndvi/index.md @@ -3,7 +3,6 @@ title: Normalized difference vegetation index with custom visualization, SkySat parent: SkySat grand_parent: Planet layout: script -permalink: /skysat/ndvi/ nav_exclude: true scripts: - - Visualization @@ -12,8 +11,23 @@ scripts: - eob.js - - Raw Values - raw.js +examples: +- zoom: '16' + lat: '-32.10671' + lng: '116.00704' + datasetId: 'fc704520-fc81-439f-9016-5e162c32e736' + fromTime: '2022-10-19T00:00:00.000Z' + toTime: '2022-10-19T23:59:59.999Z' + platform: + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/skysat/ndvi/eob.js + additionalQueryParams: + - - themeId + - PLANET_SANDBOX --- +The example data is using Planet Sandox data. This data is restricted to Sentinel Hub users with active paid plans. If you are already a Planet Customer, see [here](https://community.planet.com/sentinel-hub-81/access-new-tools-for-analyzing-your-planet-data-on-sentinel-hub-732) on how to get access. + ## Evaluate and visualize diff --git a/skysat/ndvi/raw.js b/planet/skysat/ndvi/raw.js similarity index 100% rename from skysat/ndvi/raw.js rename to planet/skysat/ndvi/raw.js diff --git a/skysat/ndvi/script.js b/planet/skysat/ndvi/script.js similarity index 100% rename from skysat/ndvi/script.js rename to planet/skysat/ndvi/script.js diff --git a/skysat/panchromatic/fig/skysat_panchromatic.jpg b/planet/skysat/panchromatic/fig/skysat_panchromatic.jpg similarity index 100% rename from skysat/panchromatic/fig/skysat_panchromatic.jpg rename to planet/skysat/panchromatic/fig/skysat_panchromatic.jpg diff --git a/planet/skysat/panchromatic/index.md b/planet/skysat/panchromatic/index.md new file mode 100644 index 00000000..d2764ba2 --- /dev/null +++ b/planet/skysat/panchromatic/index.md @@ -0,0 +1,37 @@ +--- +title: Skysat - Panchromatic +parent: SkySat +grand_parent: Planet +layout: script +nav_exclude: true +examples: +- zoom: '16' + lat: '-32.10671' + lng: '116.00704' + datasetId: 'fc704520-fc81-439f-9016-5e162c32e736' + fromTime: '2022-10-19T00:00:00.000Z' + toTime: '2022-10-19T23:59:59.999Z' + platform: + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/skysat/panchromatic/script.js + additionalQueryParams: + - - themeId + - PLANET_SANDBOX +--- + +The example data is using Planet Sandox data. This data is restricted to Sentinel Hub users with active paid plans. If you are already a Planet Customer, see [here](https://community.planet.com/sentinel-hub-81/access-new-tools-for-analyzing-your-planet-data-on-sentinel-hub-732) on how to get access. + + +## Evaluate and visualize + +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 + +The panchromatic product maps Skysat panchromatic single band value that combines R, G, and B components allowing for a greater spatial resolution. + +## Description of representative images + +Panchromatic visualisation over Rome, Italy, acquired on 2020/03/20. + +![Small panchromatic visualization.](fig/skysat_panchromatic.jpg) diff --git a/skysat/panchromatic/script.js b/planet/skysat/panchromatic/script.js similarity index 100% rename from skysat/panchromatic/script.js rename to planet/skysat/panchromatic/script.js diff --git a/skysat/true_color/fig/skysat_true_color.jpeg b/planet/skysat/true_color/fig/skysat_true_color.jpeg similarity index 100% rename from skysat/true_color/fig/skysat_true_color.jpeg rename to planet/skysat/true_color/fig/skysat_true_color.jpeg diff --git a/skysat/true_color/README.md b/planet/skysat/true_color/index.md similarity index 52% rename from skysat/true_color/README.md rename to planet/skysat/true_color/index.md index 0df24668..5d623cc7 100644 --- a/skysat/true_color/README.md +++ b/planet/skysat/true_color/index.md @@ -3,10 +3,24 @@ title: True color product, SkySat parent: SkySat grand_parent: Planet layout: script -permalink: /skysat/true_color/ nav_exclude: true +examples: +- zoom: '16' + lat: '-32.10671' + lng: '116.00704' + datasetId: 'fc704520-fc81-439f-9016-5e162c32e736' + fromTime: '2022-10-19T00:00:00.000Z' + toTime: '2022-10-19T23:59:59.999Z' + platform: + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/skysat/true_color/script.js + additionalQueryParams: + - - themeId + - PLANET_SANDBOX --- +The example data is using Planet Sandox data. This data is restricted to Sentinel Hub users with active paid plans. If you are already a Planet Customer, see [here](https://community.planet.com/sentinel-hub-81/access-new-tools-for-analyzing-your-planet-data-on-sentinel-hub-732) on how to get access. + ## Evaluate and visualize diff --git a/skysat/true_color/script.js b/planet/skysat/true_color/script.js similarity index 100% rename from skysat/true_color/script.js rename to planet/skysat/true_color/script.js diff --git a/planet_scope/cloud_classification/script.js b/planet_scope/cloud_classification/script.js deleted file mode 100644 index 1b86db8c..00000000 --- a/planet_scope/cloud_classification/script.js +++ /dev/null @@ -1,41 +0,0 @@ -//VERSION=3 -//UDM2 Classification - -function setup() { - return { - input: [{ - bands: [ - "clear", - "snow", - "shadow", - "haze_light", - "haze_heavy", - "cloud" - ] - }], - output: { - bands: 4 - } - } -} - -function evaluatePixel(samples) { - if (samples.snow == 1) { - return [0, 0.5, 1, 1] // blue - } - if (samples.shadow == 1) { - return [0.4, 0.4, 0.4, 1] //grey - } - if (samples.haze_light == 1) { - return [0, 0.9, 1, 1] //sky blue - } - if (samples.haze_heavy == 1) { - return [1, 0.7, 1, 1] //light pink - } - if (samples.cloud == 1) { - return [0.7, 0.7, 0.7, 1] //white - } - else { - return [0, 0, 0, 0] - } -} diff --git a/planet_scope/ndci/script.js b/planet_scope/ndci/script.js deleted file mode 100644 index 55f5d778..00000000 --- a/planet_scope/ndci/script.js +++ /dev/null @@ -1,12 +0,0 @@ -//PlanetScope NDCI -let ndci = index(rededge, red); - -return colorBlend( - ndci, - [0.0, 0.5, 1.0], - [ - [1, 0, 0], - [1, 1, 0], - [0.1, 0.31, 0], - ] -); diff --git a/planet_scope/ndre/script.js b/planet_scope/ndre/script.js deleted file mode 100644 index ff123255..00000000 --- a/planet_scope/ndre/script.js +++ /dev/null @@ -1,12 +0,0 @@ -//PlanetScope NDRE -let ndre = index(nir, rededge); - -return colorBlend( - ndre, - [0.0, 0.5, 1.0], - [ - [1, 0, 0], - [1, 1, 0], - [0.1, 0.31, 0], - ] -); diff --git a/planet_scope/ndvi/eob.js b/planet_scope/ndvi/eob.js deleted file mode 100644 index ada66726..00000000 --- a/planet_scope/ndvi/eob.js +++ /dev/null @@ -1,40 +0,0 @@ -//VERSION=3 -//PlanetScope NDVI EO Browser - -function setup() { - return { - input: [ - { - bands: ["red", "nir", "dataMask", "clear"], - }, - ], - output: [ - { id: "default", bands: 4 }, - { id: "index", bands: 1, sampleType: "FLOAT32" }, - { id: "eobrowserStats", bands: 2, sampleType: "FLOAT32" }, - { id: "dataMask", bands: 1 }, - ], - }; -} - -function evaluatePixel(sample) { - let ndvi = index(sample.nir, sample.red); - const clear = sample.dataMask && sample.clear; - - let ndvi_colored = colorBlend( - ndvi, - [0.0, 0.5, 1.0], - [ - [1, 0, 0], - [1, 1, 0], - [0.1, 0.31, 0], - ] - ); - - return { - default: [...ndvi_colored, clear], - index: [ndvi], - eobrowserStats: [ndvi, +!clear], - dataMask: [sample.dataMask], - }; -} diff --git a/planet_scope/ndvi/script.js b/planet_scope/ndvi/script.js deleted file mode 100644 index 389dd559..00000000 --- a/planet_scope/ndvi/script.js +++ /dev/null @@ -1,12 +0,0 @@ -//PlanetScope NDVI -let ndvi = index(nir, red); - -return colorBlend( - ndvi, - [0.0, 0.5, 1.0], - [ - [1, 0, 0], - [1, 1, 0], - [0.1, 0.31, 0], - ] -); diff --git a/skysat/panchromatic/README.md b/skysat/panchromatic/README.md deleted file mode 100644 index 3bff09be..00000000 --- a/skysat/panchromatic/README.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Skysat - Panchromatic -parent: SkySat -grand_parent: Planet -layout: script -permalink: /skysat/panchromatic/ -nav_exclude: true ---- - - -## Evaluate and visualize - -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 - -The panchromatic product maps Skysat panchromatic single band value that combines R, G, and B components allowing for a greater spatial resolution. - -## Description of representative images - -Panchromatic visualisation over Rome, Italy, acquired on 2020/03/20. - -![Small panchromatic visualization.](fig/skysat_panchromatic.jpg)