to_str#
- to_str(to_convert: list[str | SpectralBandNames | SarBandNames | CloudsBandNames | DemBandNames | BandNames] | str | SpectralBandNames | SarBandNames | CloudsBandNames | DemBandNames | BandNames, as_list: bool = True) list | str [source]#
Convert a string (or real value) to any alias, band or index.
You can pass the name or the value of the bands.
- Parameters:
- Returns:
Bands as strings
- Return type:
Examples
>>> from eoreader.bands import RED, DEM, CLOUDS >>> >>> to_str(["NDVI", "GREEN", RED, "VH_DSPK", "SLOPE", DEM, "CLOUDS", CLOUDS]) ['NDVI', 'GREEN', 'RED', 'VH_DSPK', 'SLOPE', 'DEM', 'CLOUDS', 'CLOUDS']