forked from Open-EO/openeo-processes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quantiles.json
116 lines (116 loc) · 4.09 KB
/
quantiles.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{
"id": "quantiles",
"summary": "Quantiles",
"description": "Calculates quantiles, which are cut points dividing the range of a probability distribution into either\n\n* intervals corresponding to the given `probabilities` or\n* (nearly) equal-sized intervals (q-quantiles based on the parameter `q`).\n\nEither the parameter `probabilites` or `q` must be specified, otherwise the `QuantilesParameterMissing` exception must be thrown. If both parameters are set the `QuantilesParameterConflict` exception must be thrown.",
"categories": [
"math",
"reducer"
],
"parameter_order": ["data", "probabilities", "q", "ignore_nodata"],
"parameters": {
"data": {
"description": "An array of numbers.",
"schema": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"required": true
},
"probabilities": {
"description": "A list of probabilities to calculate quantiles for. The probabilities must be between 0 and 1.",
"schema": {
"type": "array",
"items": {
"type": "number",
"minimum": 0,
"maximum": 1
}
}
},
"q": {
"description": "A number of intervals to calculate quantiles for. Calculates q-quantiles with (nearly) equal-sized intervals.",
"schema": {
"type": "integer",
"minimum": 2
}
},
"ignore_nodata": {
"description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that an array with `null` values is returned if any element is such a value.",
"schema": {
"type": "boolean",
"default": true
}
}
},
"returns": {
"description": "An array with the computed quantiles. The list has either\n\n* as many elements as the given list of `probabilities` had or\n* *`q`-1* elements.\n\nIf the input array is empty the resulting array is filled with as many `null` values as required according to the list above. For an example, see the 'Empty array example'.",
"schema": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
}
},
"exceptions": {
"QuantilesParameterMissing": {
"message": "The process 'quantiles' requires either the 'probabilities' or 'q' parameter to be set."
},
"QuantilesParameterConflict": {
"message": "The process 'quantiles' only allows that either the 'probabilities' or the 'q' parameter is set."
}
},
"examples": [
{
"arguments": {
"data": [2,4,4,4,5,5,7,9],
"probabilities": [0.005,0.01,0.02,0.05,0.1,0.5]
},
"returns": [2.07,2.14,2.28,2.7,3.4,4.5]
},
{
"arguments": {
"data": [2,4,4,4,5,5,7,9],
"q": 4
},
"returns": [4.0,4.5,5.5]
},
{
"arguments": {
"data": [-1,-0.5,null,1],
"q": 2
},
"returns": [-0.5]
},
{
"arguments": {
"data": [-1,-0.5,null,1],
"q": 4,
"ignore_nodata": false
},
"returns": [null, null, null]
},
{
"title": "Empty array example",
"arguments": {
"data": [],
"probabilities": [0.1,0.5]
},
"returns": [null, null]
}
],
"links": [
{
"rel": "about",
"href": "https://en.wikipedia.org/wiki/Quantile",
"title": "Quantiles explained by Wikipedia"
}
]
}