Index DataBase

class spectral_indices.idb.BaseModel(*args, **kwargs)[source]

Base Model for IDB database.

DoesNotExist

alias of BaseModelDoesNotExist

classmethod get_or_raise(**kwargs) M[source]

Return object with kwargs query (from table attributes) or raise error if no object fit the query.

Parameters:

cls (Type[M]) – A BaseModel.

Raises:

ValueError – No object of table {cls.__name__} with {kwargs=}

Returns:

  • Object of the table.

Return type:

M

class spectral_indices.idb.Formula(*args, **kwargs)[source]

Formula table

DoesNotExist

alias of FormulaDoesNotExist

get_bands() List[str][source]

Unserialized bands from Formula data.

Returns:

  • List of band IDs.

Return type:

List[str]

set_bands(bands: List[str])[source]

Set bands to Formula data. Store list as serialized object.

Parameters:

bands (List[str]) – List of bands IDs.

class spectral_indices.idb.Index(*args, **kwargs)[source]

Index table

DoesNotExist

alias of IndexDoesNotExist

class spectral_indices.idb.Sensor(*args, **kwargs)[source]

Sensor table.

DoesNotExist

alias of SensorDoesNotExist