museopheno.sensors.SensorManager.add_index

SensorManager.add_index(index_name, expression, condition=False, compulsory=True)[source]

Add index for the current sensor, verify if band is available before adding the script.

Parameters
  • index_name (str) – name of the index

  • expression (str) – When calling a band, start with B (e.g. ‘B8/B3+0.5’)

  • condition (str) – Condition to respect when computing the index (e.g. ‘B3!=0’)

  • compulsory (boolean, default True.) – If compulsory, will return an error if band is not available with the current sensor.

Example

>>> add_index('NBR',expression='(B08 - B12) / (B08 + B12)',condition='(B08+B12)!=0')
>>> dataset.get_index_expression('NBR')
{'expression': '(B08 - B12) / (B08 + B12)', 'condition': '(B08+B12)!=0'}