CLMS HR-S&I: Persistent Snow Area quality layer visualisation script

//VERSION=3

function setup() {
  return {
    input: ["QC", "dataMask"],
    output: { bands: 4, sampleType: "AUTO" },
  };
}
const map = [
  [0, 0x00a600], //0 - High Quality
  [1, 0xa6e64d], //1 - Medium Quality
  [2, 0xf2a64d], //2 - Low Quality
  [3, 0xff0000], //3 - Minimal Quality
  [250, 0xcccccc], //250 - Masked
  [255, 0x000000], //255 - NODATA
];

const visualizer = new ColorMapVisualizer(map);

function evaluatePixel(sample) {
  let rgbVis = visualizer.process(sample.QC);
  return rgbVis.concat(sample.dataMask);
}

General description of the script

This script visualises the Persistent Snow Area quality layer.

Table 1: Classification classes and colouring scheme.

Value Color Label
1 0 - high quality
2 1 - medium quality
3 2 - low quality
4 3 - minimal quality
5 200 - masked
6 255 - no data

Description of representative images

PSA quality over the Mont Blanc Region, FR

PSA QC

Resources