SpectralBandNames#

class SpectralBandNames(value)[source]#

Bases: BandNames

This class aims to regroup equivalent bands under the same nomenclature. Each product will set their band number in regard to their corresponding name.

Note: The mapping is based on Sentinel-2 spectral bands.

More information can be retrieved here:

This classification allows index computation and algorithms to run without knowing the band nb of every satellite. If None, then the band does not exist for the satellite.

classmethod convert_from(to_convert: list | str) list#

Convert from a list or a string to an enum instance

Parameters:

to_convert (Union[list, str]) – List or string to convert into an enum instance

Returns:

Converted list

Return type:

list

Example

>>> TsxPolarization.convert_from(["SINGLE", "S", TsxPolarization.QUAD])
[<TsxPolarization.SINGLE: 'S'>, <TsxPolarization.SINGLE: 'S'>, <TsxPolarization.QUAD: 'Q'>]
classmethod eoreader_to_stac(eoreader_name: SpectralBandNames) StacCommonNames[source]#

Convert EOReader bands to STAC common names

Parameters:

eoreader_name (SpectralBandNames) – EOReader name

Returns:

STAC common name

Return type:

StacCommonNames

classmethod from_list(name_list: list | str) list#

Get the band enums from list of band names

>>> SarBandNames.from_list("VV")
[<SarBandNames.VV: 'VV'>]
Parameters:

name_list (Union[list, str]) – List of names

Returns:

List of enums

Return type:

list

classmethod from_value(val: Any) ListEnum#

Get the enum class from its value:

Parameters:

val (Any) – Value of the Enum

Returns:

Enum with value

Return type:

ListEnum

Example

>>> TsxPolarization.from_value("Q")
<TsxPolarization.QUAD: 'Q'>
classmethod list_names() list#

Get the name list of this enum:

Example

>>> TsxPolarization.list_values()
["SINGLE", "DUAL", "QUAD", "TWIN"]
classmethod list_values() list#

Get the value list of this enum

Example

>>> TsxPolarization.list_values()
["S", "D", "Q", "T"]
classmethod stac_to_eoreader(common_name: str, name: str) SpectralBandNames[source]#

Convert STAC common names or name to EOReader bands

Parameters:
  • common_name (str) – STAC common name

  • name (str) – STAC name

Returns:

EOReader name

Return type:

SpectralBandNames

classmethod to_value_list(name_list: list | None = None) list#

Get a list from the values of the bands

 >>> SarBandNames.to_name_list([SarBandNames.HV_DSPK, SarBandNames.VV])
['HV_DSPK', 'VV']
>>> SarBandNames.to_name_list()
['VV', 'VV_DSPK', 'HH', 'HH_DSPK', 'VH', 'VH_DSPK', 'HV', 'HV_DSPK']
Parameters:

name_list (list) – List of band names

Returns:

List of band values

Return type:

list

BLUE = 'BLUE'#

Blue

CA = 'COASTAL_AEROSOL'#

Coastal aerosol

F1 = 'F1'#

F1

F2 = 'F2'#

F2

GREEN = 'GREEN'#

Green

GREEN_1 = 'GREEN_I'#

GREEN I

NARROW_NIR = 'NARROW_NIR'#

Narrow NIR, spectrally narrow NIR band, equivalent to B8A (gsd 20m) for Sentinel-2 products, equivalent to NIR band for other products

NIR(B8 for Sentinel-2) = 'NIR'#

NIR (B8 for Sentinel-2)

Oa01 = 'Oa01'#

Oa01

Oa02 = 'Oa02'#

Oa02

Oa09 = 'Oa09'#

Oa09

Oa10 = 'Oa10'#

Oa10

Oa13 = 'Oa13'#

Oa13

Oa14 = 'Oa14'#

Oa14

Oa15 = 'Oa15'#

Oa15

Oa18 = 'Oa18'#

Oa18

Oa19 = 'Oa19'#

Oa01

Oa21 = 'Oa21'#

Oa01

PAN = 'PANCHROMATIC'#

Panchromatic

RED = 'RED'#

Red

S7 = 'S7'#

S7

SWIR_1 = 'SWIR_1'#

SWIR, Band 1

SWIR_2 = 'SWIR_2'#

SWIR, Band 2

SWIR_CIRRUS = 'SWIR_CIRRUS'#

SWIR Cirrus

TIR_1 = 'THERMAL_IR_1'#

Thermal IR, Band 1

TIR_2 = 'THERMAL_IR_2'#

Thermal IR, Band 2

VRE_1 = 'VEGETATION_RED_EDGE_1'#

Vegetation red edge, Band 1

VRE_2 = 'VEGETATION_RED_EDGE_2'#

Vegetation red edge, Band 2

VRE_3 = 'VEGETATION_RED_EDGE_3'#

Vegetation red edge, Band 3

WV = 'WATER_VAPOUR'#

Water vapour

YELLOW = 'YELLOW'#

Yellow