Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aggregate_spatial_window #192

Merged
merged 17 commits into from
Sep 22, 2020
Merged
98 changes: 98 additions & 0 deletions aggregate_spatial_window.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"id": "aggregate_spatial_window",
"summary": "Zonal statistics for rectangular windows",
"description": "Aggregates statistics over the horizontal spatial dimensions (axes `x` and `y`) of the data cube.\n\nThe pixel grid for the axes `x` and `y` is divided into non-overlapping windows with the size specified in the parameters `size` = [`x_size`,`y_size`]. If the number of values for the axes `x` and `y` is not a multiple of the corresponding `x_size` or `y_size` parameter, the behaviour specified in `boundary` parameter is applied.\nFor each of these windows, the reducer process computes the result.",
clausmichele marked this conversation as resolved.
Show resolved Hide resolved
"categories": [
"cubes",
"aggregate & resample"
],
"parameters": [
{
"name": "data",
"description": "A raster data cube.",
"schema": {
"type": "object",
"subtype": "raster-cube"
}
},
{
"name": "reducer",
"description": "A reducer to be applied on all values of each geometry. A reducer is a single process such as ``mean()`` or a set of processes, which computes a single value for a list of values, see the category 'reducer' for such processes.",
"schema": {
"type": "object",
"subtype": "process-graph",
"parameters": [
{
"name": "data",
"description": "An array with elements of any type.",
"schema": {
"type": "array",
"items": {
"description": "Any data type."
}
}
},
{
"name": "context",
"description": "Additional data passed by the user.",
"schema": {
"description": "Any data type."
},
"optional": true,
"default": null
}
]
}
},
{
"name": "size",
"description": "Window sizes (pixels) along each dimension.\n\nFirst value correspond to Window size along X or Longitude and second to Window size along Y or Latitude.",
clausmichele marked this conversation as resolved.
Show resolved Hide resolved
"schema": {
"type": "array",
"items": {
"type": "object",
"subtype": "chunk-size",
"required": [
"value"
],
"properties": {
"value": {
"type": "number",
"minimum": 1,
"description": "The unit the values are given in pixels (`px`)"
}
}
}
}
},
{
"name": "boundary",
"description": "Behavior to apply if the number of values for the axes `x` and `y` is not a multiple of the corresponding `size` = [`x_size`,`y_size`] parameter. Options are:\n\n- `pad` (default): pad the data cube with `NaN` (not a number) values to fit the required window size.\n\n- `trim`: trim the data cube to fit the required window size.",
clausmichele marked this conversation as resolved.
Show resolved Hide resolved
"schema": {
"type": "string",
"enum": [
"pad",
"trim"
]
},
"optional": true,
"default": "pad"
},
{
"name": "context",
"description": "Additional data to be passed to the reducer.",
"schema": {
"description": "Any data type."
},
"optional": true,
"default": null
}
],
"returns": {
"description": "A data cube with the newly computed values and the same dimensions.\n\nThe resolution will change, depending on the chosen parameters. It decreases for the dimensions which have the corresponding parameter `size` = [`x_size`,`y_size`] set to values greater than 1.\n\nThe dimension labels will be set to the center of the window. The other dimension properties (name, type and reference system) remain unchanged.",
"schema": {
"type": "object",
"subtype": "vector-cube"
clausmichele marked this conversation as resolved.
Show resolved Hide resolved
}
}
}