CLMS HR-S&I: Fractional Snow Cover - On-ground fractional snow cover (%) visualisation script
//VERSION=3
function setup() {
return {
input: ["FSCOG", "dataMask"],
output: { bands: 4, sampleType: "AUTO" },
};
}
const ramps = [
[0, 0xffffff],
[100, 0x4d4dff],
];
const visualizer = new ColorRampVisualizer(ramps);
function evaluatePixel(sample) {
var FSCOG_viz = visualizer.process(sample.FSCOG);
if (sample.FSCOG == 255) {
return [0, 0, 0, sample.dataMask];
} else if (sample.FSCOG == 205) {
return [0.9, 0.9, 0.9, sample.dataMask];
} else {
return [FSCOG_viz[0], FSCOG_viz[1], FSCOG_viz[2], sample.dataMask];
}
}
General description of the script
This script visualises Fractional Snow Cover - On-ground fractional snow cover(%) (FSCOG).
Description of representative images
23rd April 2020, Innsbruck, AT