to_band

Contents

to_band#

to_band(to_convert: Union[list, BandNames, str], as_list: bool = True) Union[list, BandNames][source]#

Convert a string (or real value) to any alias, band or index.

You can pass the name or the value of the bands.

>>> to_band(["NDVI", "GREEN", RED, "VH_DSPK", "SLOPE", DEM, "CLOUDS", CLOUDS])
[<function NDVI at 0x00000154DDB12488>,
<SpectralBandNames.GREEN: 'GREEN'>,
<SpectralBandNames.RED: 'RED'>,
<SarBandNames.VH_DSPK: 'VH_DSPK'>,
<DemBandNames.SLOPE: 'SLOPE'>,
<DemBandNames.DEM: 'DEM'>,
<ClassifBandNames.CLOUDS: 'CLOUDS'>,
<ClassifBandNames.CLOUDS: 'CLOUDS'>]
Parameters:

to_convert (Union[list, BandNames, str]) – Values to convert into band objects

Returns:

converted values

Return type:

list