Skip to content

Commit

Permalink
Issue #484: add "Sentinel1" band mapping support to "Awesome Spectral…
Browse files Browse the repository at this point in the history
… Indices" wrapper
  • Loading branch information
soxofaan committed Oct 18, 2023
1 parent 78e8e93 commit 5f27db8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add `DataCube.reduce_spatial()`
- Added option (enabled by default) to automatically validate a process graph before execution. Validation issues just trigger warnings for now. ([#404](https://github.com/Open-EO/openeo-python-client/issues/404))
- Added "Sentinel1" band mapping support to "Awesome Spectral Indices" wrapper ([#484](https://github.com/Open-EO/openeo-python-client/issues/484))

### Changed

Expand Down
8 changes: 8 additions & 0 deletions openeo/extra/spectral_indices/spectral_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
"B11": "S1",
"B12": "S2",
}
BAND_MAPPING_SENTINEL1 = {
"HH": "HH",
"HV": "HV",
"VH": "VH",
"VV": "VV",
}


def _get_expression_map(cube: DataCube, x: ProcessBuilder) -> Dict[str, ProcessBuilder]:
Expand All @@ -78,6 +84,8 @@ def _get_expression_map(cube: DataCube, x: ProcessBuilder) -> Dict[str, ProcessB
band_mapping = BAND_MAPPING_PROBAV
elif "TERRASCOPE_S2" in collection_id or "SENTINEL2" in collection_id:
band_mapping = BAND_MAPPING_SENTINEL2
elif "SENTINEL1" in collection_id:
band_mapping = BAND_MAPPING_SENTINEL1
else:
raise ValueError(f"Could not detect supported satellite platform from {collection_id!r} for index computation")

Expand Down

0 comments on commit 5f27db8

Please sign in to comment.