Skip to content

Instantly share code, notes, and snippets.

@willrayeo
Created May 31, 2023 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willrayeo/db0553cd70a8d339bd01782b1b0ec14c to your computer and use it in GitHub Desktop.
Save willrayeo/db0553cd70a8d339bd01782b1b0ec14c to your computer and use it in GitHub Desktop.
//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