museopheno.sensors.SensorManager.generate_index¶
-
SensorManager.
generate_index
(X, expression, interpolate_nan=True, divide_X_by=1, multiply_by=1, dtype=<class 'numpy.float32'>)[source]¶ Generate index from array
- Parameters
X (array) – array where each line is a pixel.
expression (str or dict) – If str, contains only the expression (e.g. ‘B8/B2’) If dict, please generate it from add_index function.
inteprolate_nan (boolean, default True) – If nan value a linear interpolation is done.
divide_X_by (integer or float, default 1) – Value to divide X before computing the index
multiply_by (integer or float, default 1.) – Value to multiply the result (e.g. 100 to set the NDVI between -100 and 100)
dtype (numpy dtype, default np.float32) – dtype of the output (e.g. np.int16 to store the NDVI in integer value)
Example
>>> generate_index(X,expression='B8/B2')