I have a formula to be converted into version=3
but did not manage to control the var val function.
This way it works but better to have it in VERSION=3
var val = [[B11 - B10] - [0.389*[B12 - B10]]];
return colorBlend(val, [-0.003,0], [[0,0,0],[1,1,1]]);
VERSION=3 could be:
//VERSION=3
function setup() {
return {
input: [“B10”,“B11”,“B12”],
output: { bands: 1 }
};
}
function evaluatePixel(sample) {
let MCI =[[B11 - B10] - [0.389*[B12 - B10]]];
var val = MCI
return colorBlend(val, [-0.003,0], [[0,0,0],[1,1,1]]);
}
BUT
Failed to evaluate script!
evalscript.js:9: ReferenceError: B11 is not defined
let MCI =[[B11 - B10] - [0.389*[B12 - B10]]];
^
ReferenceError: B11 is not defined
at evaluatePixel (evalscript.js:9:12)
at executeForSingleScene (:1119:17)
Thanks a lot for an advice.
