Skip to content

Commit

Permalink
Add tests for apply_kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Dec 22, 2023
1 parent 3125cbf commit 8c99017
Show file tree
Hide file tree
Showing 3 changed files with 341 additions and 29 deletions.
4 changes: 2 additions & 2 deletions apply_kernel.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "apply_kernel",
"summary": "Apply a spatial convolution with a kernel",
"description": "Applies a 2D convolution (i.e. a focal operation with a weighted kernel) on the horizontal spatial dimensions (axes `x` and `y`) of a raster data cube.\n\nEach value in the kernel is multiplied with the corresponding pixel value and all products are summed up afterwards. The sum is then multiplied with the factor.\n\nThe process can't handle non-numerical or infinite numerical values in the data cube. Boolean values are converted to integers (`false` = 0, `true` = 1), but all other non-numerical or infinite values are replaced with zeroes by default (see parameter `replace_invalid`).\n\nFor cases requiring more generic focal operations or non-numerical values, see ``apply_neighborhood()``.",
"description": "Applies a 2D convolution (i.e. a focal operation with a weighted kernel) on the horizontal spatial dimensions (axes `x` and `y`) of a raster data cube.\n\nEach value in the kernel is multiplied with the corresponding pixel value and all products are summed up afterwards. The sum is then multiplied with the factor.\n\nThe process can't handle non-numerical or infinite numerical values in the data cube. Boolean values are converted to integers (`false` = 0, `true` = 1), but all other non-numerical, NaN, no-data, or infinite values are replaced with zeroes by default (see parameter `replace_invalid`).\n\nFor cases requiring more generic focal operations or non-numerical values, see ``apply_neighborhood()``.",
"categories": [
"cubes",
"math > image filter"
Expand Down Expand Up @@ -70,7 +70,7 @@
},
{
"name": "replace_invalid",
"description": "This parameter specifies the value to replace non-numerical or infinite numerical values with. By default, those values are replaced with zeroes.",
"description": "This parameter specifies the value to replace non-numerical, NaN, no-data, or infinite numerical values with. By default, those values are replaced with zeroes.",
"schema": {
"type": "number"
},
Expand Down
55 changes: 29 additions & 26 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@ This folder contains test cases for the openEO processes.
- [x] absolute
- [x] add
- [x] add_dimension
- [ ] aggregate_spatial
- [ ] aggregate_spatial_window (experimental)
- [ ] aggregate_temporal
- [ ] aggregate_temporal_period
- [ ] aggregate_spatial*
- [ ] aggregate_temporal*
- [ ] aggregate_temporal_period*
- [x] all
- [x] and
- [ ] anomaly
- [x] any
- [x] apply*
- [x] apply_dimension*
- [ ] apply_kernel
- [ ] apply_neighborhood
- [ ] apply_polygon (experimental)
- [x] apply_kernel
- [x] arccos
- [x] arcosh
- [x] arcsin
Expand All @@ -42,7 +38,6 @@ This folder contains test cases for the openEO processes.
- [x] artanh
- [x] between
- [x] ceil
- [ ] climatological_normal
- [x] clip
- [x] constant
- [x] cos
Expand All @@ -64,13 +59,10 @@ This folder contains test cases for the openEO processes.
- [x] exp
- [x] extrema
- [x] filter_bands*
- [ ] filter_bbox
- [ ] filter_labels (experimental)
- [ ] filter_spatial
- [ ] filter_bbox*
- [ ] filter_spatial*
- [x] filter_temporal*
- [ ] filter_vector (experimental)
- [x] first
- [ ] flatten_dimensions (experimental)
- [x] floor
- [x] gt
- [x] gte
Expand All @@ -82,12 +74,11 @@ This folder contains test cases for the openEO processes.
- [x] last
- [x] linear_scale_range
- [x] ln
- [ ] load_geojson (experimental)
- [x] log
- [x] lt
- [x] lte
- [x] mask*
- [ ] mask_polygon
- [ ] mask_polygon*
- [x] max
- [x] mean
- [x] median
Expand All @@ -96,7 +87,6 @@ This folder contains test cases for the openEO processes.
- [x] mod
- [x] multiply
- [x] nan (experimental)
- [ ] ndvi
- [x] neq
- [x] normalized_difference
- [x] not
Expand All @@ -108,12 +98,9 @@ This folder contains test cases for the openEO processes.
- [x] quantiles
- [x] rearrange*
- [x] reduce_dimension*
- [ ] reduce_spatial (experimental)
- [x] rename_dimension
- [x] rename_labels
- [ ] resample_cube_spatial
- [ ] resample_cube_temporal
- [ ] resample_spatial
- [ ] resample_spatial*
- [x] round
- [x] sd
- [x] sgn
Expand All @@ -129,12 +116,7 @@ This folder contains test cases for the openEO processes.
- [x] text_concat
- [x] text_contains
- [x] text_ends
- [ ] trim_cube
- [ ] unflatten_dimension (experimental)
- [x] variance
- [ ] vector_buffer (experimental)
- [ ] vector_reproject (experimental)
- [ ] vector_to_regular_points (experimental)
- [x] xor

\* = could use some more tests
Expand Down Expand Up @@ -164,6 +146,27 @@ We don't expect that we can provide meaningful test cases for these processes.
- sar_backscatter (experimental)
- save_result
- vector_to_random_points (experimental)
- vector_to_regular_points (experimental)

The following processes are experimental or part of a higher profile (L3+), so the tests will hopefully evolve over time:

- aggregate_spatial_window (experimental)
- anomaly
- apply_neighborhood
- apply_polygon (experimental)
- climatological_normal
- filter_labels (experimental)
- filter_vector (experimental)
- flatten_dimensions (experimental)
- load_geojson (experimental)
- ndvi
- reduce_spatial (experimental)
- resample_cube_spatial
- resample_cube_temporal
- trim_cube
- unflatten_dimension (experimental)
- vector_buffer (experimental)
- vector_reproject (experimental)

## Assumptions

Expand Down
Loading

0 comments on commit 8c99017

Please sign in to comment.