Hello! I have the code below, I am trying to get the colormap stretched to the min and max values of the queried image, but I can not figure out how to obtain those values.
The code below is for the non stretched image, if i dow the strectching the array of values in colorBlend should be something like this colorBlend(val,[min, min+step, min+step2,min+step3,min+step*4,max],…)
How can I obtain min and max?
Thanks!
function evaluatePixel(samples) {
let val = index(samples[0].B08, samples[0].B04);
return colorBlend(val,[0, 0.2, 0.4, 0.6, 0.8, 1],
[[0.815, 0.450, 0.345],
[0.815, 0.666, 0.345],
[0.815, 0.807, 0.345],
[0.745, 0.815, 0.345],
[0.549, 0.815, 0.345],
[0.439, 0.815, 0.345]]);;
}
function setup(ds) {
setInputComponents([ds.B04, ds.B08]);
setOutputComponentCount(3);
}
