I’m trying to create function to return cloud pixel percentage based on SCL Sentinel 2 L2A following these functions:
//VERSION=3
function setup() {
return {
input: :"B02", "B03", "B04", "SCL"],
output: { bands: 1 }
};
}
function calcCloudPercentage(SCL) {
var cloudCount = 0;
var totalPixels = SCL.length;
for (var i = 0; i < totalPixels; i++) {
if (SCLCi] === 3 || SCLCi] === 8 || SCLCi] === 9 || SCLCi] === 10) {
cloudCount++;
}
}
return cloudCount / totalPixels * 100;
}
function evaluatePixel(sample) {
var cloudPercentage = calcCloudPercentage(sample.SCL);
return ncloudPercentage];
}
However, the functions always return “null”. Anyone could help to understand why this return?