Hi,
We are playing with the WMS API and have some questions regarding processing unit and request count:
we use the following evalscript three times for 0.98 hectare area:
//VERSION=3
function setup() {
return {
input: ["B05", "B06", "B07", "B08A", "B11", "B12", "dataMask"],
output: [
{ id: "default", bands: 4 },
{ id: "index", bands: 1, sampleType: "FLOAT32" },
],
};
}
const scale = [
[-0.3, 0xca0020],
[-0.1, 0xdd494b],
[0, 0xf09377],
[0.1, 0xf5c1a9],
[0.2, 0xf7e5dd],
[0.3, 0xe1ecf2],
[0.4, 0xb4d6e7],
[0.5, 0x82bcd9],
[0.6, 0x3f8eb8],
[1, 0x023655]
];
function evaluatePixel(samples) {
const val =
(((samples.B05* 10000 * 0.4 +
samples.B06* 10000 * 0.9 +
samples.B07* 10000 * 1.3 +
samples.B08A* 10000 * 1.022 -
samples.B11* 10000 * 1.0 -
samples.B12* 10000 * 0.4) / 1000) + 1.0) * 0.5 ;
const indexVal = samples.dataMask === 1 ? val : NaN;
const viz = new ColorRampVisualizer(scale);
return {
default: [...viz.process(val),samples.dataMask],
index: [indexVal],
};
}
The cost for these operations were 30 PU and 25 RC, I would like to understand the calculation for this.
Because from my understanding the documentation it should costs less
9800 square meters / 20 meter resolution / 512*512 → the result is below minimum threshold : x0.01
6 bands → 6/3 : x2
using float precision → x2
three different dates → x3
If my calculations are correct the PU shall be 0.12 and not 30 as we saw in our dashboard
where is the mistake ?
Regards,
Nadav