Skip to content

Commit

Permalink
clip: Work on a single value. #75
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Oct 30, 2019
1 parent 2684dab commit 1c46976
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 56 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added examples.

### Changed
- `debug`:
- `clip`: Works on a single value instead on arrays (replaced parameter `data` with `x`). (#75)[https://github.com/Open-EO/openeo-processes/issues/75]
- `debug`: Refers to logging instead of WebSockets.

### Deprecated
- `filter_bbox`, `load_collection`, `resample_spatial`: PROJ definitions are deprecated in favor of EPSG codes, WKT2 and PROJJSON. (#58)[https://github.com/Open-EO/openeo-processes/issues/58]
Expand Down
124 changes: 69 additions & 55 deletions clip.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,82 @@
{
"id": "clip",
"summary": "Clips values between minimum and maximum values.",
"description": "Clips an array of numbers between specified minimum and maximum values. All values larger than the maximal value will have the maximal value, all values lower than minimal value will have the minimal value.",
"summary": "Clips a value between a minimum and a maximum value.",
"description": "Clips a number between specified minimum and maximum values. A value larger than the maximal value will have the maximal value, a value lower than minimal value will have the minimal value.",
"categories": [
"math"
"math"
],
"parameter_order": [
"x",
"min",
"max"
],
"parameter_order": ["data", "min", "max"],
"parameters": {
"data": {
"description": "An array of numbers.",
"schema": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
},
"required": true
"x": {
"description": "A number.",
"schema": {
"type": [
"number",
"null"
]
},
"min": {
"description": "Minimum value. All values lower than this value will be set to the value of this parameter.",
"schema": {
"type": "number"
},
"required": true
"required": true
},
"min": {
"description": "Minimum value. If the value is lower than this value, the process will return the value of this parameter.",
"schema": {
"type": "number"
},
"required": true
},
"max": {
"description": "Maximum value. If the value is greater than this value, the process will return the value of this parameter.",
"schema": {
"type": "number"
},
"max": {
"description": "Maximum value. All values greater than this value will be set to the value of this parameter.",
"schema": {
"type": "number"
},
"required": true
}
"required": true
}
},
"returns": {
"description": "An array with the values clipped to the specified range.",
"schema": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
}
}
"description": "The value clipped to the specified range.",
"schema": {
"type": [
"number",
"null"
]
}
},
"examples": [
{
"arguments": {
"data": [-2,-1,0,1,2],
"min": -1,
"max": 1
},
"returns": [-1,-1,0,1,1]
{
"arguments": {
"x": -5,
"min": -1,
"max": 1
},
"returns": -1
},
{
"arguments": {
"x": 10.001,
"min": 1,
"max": 10
},
"returns": 10
},
{
"arguments": {
"x": 0.000001,
"min": 0,
"max": 0.02
},
"returns": 0.000001
},
{
"arguments": {
"x": null,
"min": 0,
"max": 1
},
{
"arguments": {
"data": [-0.1,-0.001,null,0,0.25,0.75,1.001,null],
"min": 0,
"max": 1
},
"returns": [0,0,null,0,0.25,0.75,1,null]
}
"returns": null
}
]
}
}

0 comments on commit 1c46976

Please sign in to comment.