Skip to content

Commit

Permalink
Fix raw_bands #111
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-braun committed Oct 30, 2023
1 parent e65c717 commit 3c2899b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions eoreader/products/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -2000,6 +2000,21 @@ def get_orbit_direction(self) -> OrbitDirection:
raise NotImplementedError

def to_band(self, raw_bands: Union[list, BandNames, str, int]) -> list:
"""
Convert any raw band identifier to a usable band.
Bands can be called with their name, ID or mapped name.
For example, for Sentinel-3 OLCI you can use `7`, `Oa07` or `YELLOW`. For Landsat-8, you can use `BLUE` or `2`.
Args:
raw_bands (Union[list, BandNames, str, int]): Raw bands
Returns:
list: Mapped bands
"""
if not isinstance(raw_bands, list):
raw_bands = [raw_bands]

bands = []
for raw_band in raw_bands:
try:
Expand Down

0 comments on commit 3c2899b

Please sign in to comment.