Skip to main content Link Menu Expand (external link) Document Search Copy Copied

VPP TPROD visualisation script

//VERSION=3

// This custom script visualises TPROD(total productivity)  parameter

function setup() {
  return {
    input: ["TPROD", "dataMask"],
    output: { bands: 4 },
    mosaicking: Mosaicking.TILE
  }
}
const map =
  [
    [0.00, 0xFFFFE5],
    [82.5, 0xFFF7BC],
    [165, 0xFEE391],
    [247.5, 0xFEC44F],
    [330, 0xFE9929],
    [412.5, 0xEC7014],
    [495, 0xCC4C02],
    [577.5, 0x993404],
    [660, 0x662506]
  ]

const visualizer = new ColorMapVisualizer(map);

function evaluatePixel(samples) {
  for (let i = 0; i < samples.length; i++) {
    let sample = samples[i];
    if (sample.dataMask == 1) {
      let rgbVis = visualizer.process(sample.TPROD * 0.1);
      return rgbVis.concat(sample.dataMask);
    }
  }
}

General description of the script

This script visualises total productivity (TPROD) parameter of the VPP product. The color map is adopted from https://github.com/jacobs-tim/copernicus-land-monitoring-service-hrvpp-colourmaps

Description of representative images

2019 season 1 total productivity over Pina de Ebro Zaragoza Spain

TPROD Pina de Ebro Zaragoza Spain

Resources