Created
May 31, 2023 14:33
-
-
Save willrayeo/db0553cd70a8d339bd01782b1b0ec14c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//VERSION=3 | |
function setup() { | |
return { | |
input: [{ | |
bands: [ | |
"B04", | |
"B08", | |
"SCL", | |
"dataMask" | |
] | |
}], | |
output: [ | |
{ | |
id: "data", | |
bands: 3 | |
}, | |
{ | |
id: "dataMask", | |
bands: 1 | |
}] | |
}; | |
} | |
function evaluatePixel(samples) { | |
let index = (samples.B08 - samples.B04) / (samples.B08+samples.B04); | |
return { | |
data: [index, samples.B08, samples.B04], | |
dataMask: [samples.dataMask], | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment