Processing unit for WMS API

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

Hi Nadah,
PUs are calculated for every request you make, even if you do it for the same area. You did not provide the example of the WMS request so it is difficult to provide exact response.
You say that statistics count 25 requests while you only mention 3 requests. So there probably have to be some additional ones that you did not count.

If you would like to get exact explanation, I suggest you create a new configuration, for testing purposes only, copying the layers/evalscripts. Then make these three requests and let us know which instance it it (only first two blocks, the rest of the instance ID should be masked) and we will check in our records what was going on.

Best,
Grega

HI Grega,

We make some requests using 641b296a-33av-xxxx-xxxx-xxxxxxxxxxxxxxxx.

(Please refer to the request made today (31-10-22))

Compared to our previous test, the requests were slightly different.

It would be very helpful if you could explain the calculations to us.

Best,

Nadav

Hi Nadav,
looking at the statistics for this instance around 13:25 CET I see:

6 requests each billed at 1 PU
analysing one of these I see that it has:

  • width & height = 256 px (factor = 0.25)
  • 6 input bands (factor = 6/3 = 2)
  • format = image/png + float32 (factor = 2)
  • number of obserations = 1 (factor = 1) - note that your time period is long enough to contain 2 observations, but as you are using “SIMPLE” mosaicking, this is counted only as 1.

Calculation is therefore: 0.25 x 2 x 2 x 1 = 1 PU
I imagine these are integrated in some web application, acting similar to WMTS.

12 requests each billed 0.167 PU
analysing one of these I see that it has:

  • width & height = 256 px (factor = 0.25)
  • 2 input bands (factor = 2/3 = 0.667)
  • format = image/png (factor = 1)
  • multi-temporal, 2 observations (factor = 2)

Calculation is therefore: 0.25 x 0.667 x 1 x 1 = 0.167

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.