# Definition of a Processing Unit

Each request is "worth" a proportional amount of processing unit(s) depending on what data and processing is requested. We define one processing unit (PU) as a request for:

- an output (image) size of 512 x 512 pixels,
- 3 collection input bands,
- one data
`sample`

per pixel (see sample), - an output (image) format not exceeding 16 bits per pixel,
- without additional processing (e.g. orthorectification) applied,
- the request is processed on-the-fly (i.e.
`process`

API, WMS, WMTS, WCS or FIS request).

In addition to this:

- The minimal weight for a request is 0.001 PU.
- The number of remaining processing units is reduced only when a request successfully executes, i.e. when the response code is
`2XX`

.

We use "multiplication factors" to calculate how many processing units are required for each request. The definition of 1 processing unit and the calculation rules are summarized in the table:

Parameter/API | Quantity for 1 PU | Rules for multiplication factors |
---|---|---|

Output size (width x height) | 512 x 512 px | The multiplication factor is calculated by dividing requested output (image) size (width x height) by 512 x 512. The minimum value of this multiplication factor is 0.01. This corresponds to an area of 0.25 km ^{2} for Sentinel-2 data at 10 m spatial resolution. |

Number of input bands | 3 | The multiplication factor is calculated by dividing the requested number of input bands by 3. An exception is requesting `dataMask` which is not counted. |

Output format | 8 bit or 16 bit TIFF/JPG/PNG | Requesting 32 bit float TIFF will result in a multiplication factor of 2 due to larger memory consumption and data traffic. Requesting application/octet-stream will result in a multiplication factor of 1.4 due to additional integration costs (This is used for integration with external tools such as xcube.). |

Number of data samples | 1 | The multiplication factor equals the number of data samples per pixel. |

Orthorectification | No | Requesting orthorectification (for S1 GRD data) will result in a multiplication factor of 2 due to additional processing requirements (This rule is not applied at the moment.). |

Batch Processing | No | Processing with `batch processing` API will result in a multiplication factor of 1/3. Thus, three times more data can be processed comparing to `process` API for the same amount of PUs. |

## Request weight calculation examples

### Sentinel-1 change detection

An example of the calculation of processing units for a Sentinel-1 change detection request (e.g. comparison of two time slices) is presented in the table below.

Parameter | Quantity | Multiplication factor | Details |
---|---|---|---|

Output size (width x height) | 1024 x 1024 px | x 4 | The requested output size is 1024 x 1024 px which is 4 times larger than the output size for one PU (512 x 512 px). Hence the multiplication factor is 4. |

Number of input bands | 4 | x 4/3 | 4 input bands are requested, which is 4/3 times more than 3 input bands, which are included in one PU. The multiplication factor is thus 4/3. |

Output format | 32-bit float | x 2 | The requested 32 bit float TIFF has a multiplication factor of 2. |

Number of data samples | 2 | x 2 | 2 data samples (one for each time slice) were requested for each pixels. Thus the multiplication factor is 2. |

Orthorectification | Yes | x 2 | Ortorectification is requested, which results in a multiplication factor of 2. |

Total | 42.667 processing units | To calculate the number of processing units for this request multiply all the individual multiplication factors: 4 x 4/3 x 2 x 2 x 2 = 42.667 |

*Note: Statistical API (FIS requests) is also a multi-temporal request. The same rules for calculating multiplication factors apply.*

### NDVI calculation for a parcel

An example of the calculation of processing units for the NDVI value over a 4 hectare large parcel at 10 m spatial resolution is presented in the table below.

Parameter | Quantity | Multiplication factor | Details |
---|---|---|---|

Output size (width x height) | 20 x 20 px | x 0.01 | The requested output size is 20 x 20 px which is smaller than the minimum area, thus the multiplication factor is 0.01. |

Number of input bands | 2 | x 2/3 | 2 input bands are requested, thus the multiplication factor is 2/3. |

Output format | 16-bit tiff | x 1 | The same as in the definition of one processing unit, thus the multiplication factor is 1. |

Number of data samples | 1 | x 1 | The same as in the definition of one processing unit, thus the multiplication factor is 1. |

Orthorectification | No | x 1 | The same as in the definition of one processing unit, thus the multiplication factor is 1. |

Total | 0.0067 processing units | To calculate the number of processing units for this request multiply all the individual multiplication factors: 0.01 x 2/3 x 1 x 1 = 0.0067 |