indices
darts_preprocessing.engineering.indices
¶
Calculation of spectral indices from optical data.
calculate_ctvi
¶
Calculate CTVI (Corrected Transformed Vegetation Index) from an xarray Dataset containing spectral bands.
This will use the NDVI if it is already present in the dataset, otherwise it will calculate it first.
Parameters:
Returns:
Notes
CTVI is calculated using the formula: CTVI = (NDVI + 0.5) / |NDVI + 0.5| * sqrt(|NDVI + 0.5|)
References
Lemenkova, Polina. "Hyperspectral Vegetation Indices Calculated by Qgis Using Landsat Tm Image: a Case Study of Northern Iceland" Advanced Research in Life Sciences, vol. 4, no. 1, Sciendo, 2020, pp. 70-78. https://doi.org/10.2478/arls-2020-0021
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_evi
¶
calculate_evi(
optical: xarray.Dataset,
g: float = 2.5,
c1: float = 6,
c2: float = 7.5,
l: float = 1,
) -> xarray.DataArray
Calculate EVI (Enhanced Vegetation Index) from an xarray Dataset containing spectral bands.
This function will clip the optical bands to the range [0, 1] before calculating VARI to avoid potential numerical instabilities from negative reflections.
Parameters:
-
optical
(xarray.Dataset
) –The xarray Dataset containing the spectral bands.
-
g
(float
, default:2.5
) –Gain factor (default: 2.5).
-
c1
(float
, default:6
) –Aerosol resistance coefficient for the red band (default: 6).
-
c2
(float
, default:7.5
) –Aerosol resistance coefficient for the blue band (default: 7.5).
-
l
(float
, default:1
) –Canopy background adjustment (default: 1).
Returns:
Notes
EVI is calculated using the formula: EVI = G * (NIR - Red) / (NIR + C1 * Red - C2 * Blue + L)
References
A Huete, K Didan, T Miura, E.P Rodriguez, X Gao, L.G Ferreira, Overview of the radiometric and biophysical performance of the MODIS vegetation indices, Remote Sensing of Environment, Volume 83, Issues 1-2, 2002, Pages 195-213, ISSN 0034-4257, https://doi.org/10.1016/S0034-4257(02)00096-2.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_exg
¶
Calculate EXG (Excess Green Index) from an xarray Dataset containing spectral bands.
This function will clip the optical bands to the range [0, 1] before calculating EXG to avoid potential numerical instabilities from negative reflections.
Parameters:
Returns:
Notes
EXG is calculated using the formula: EXG = 2 x Green - Red - Blue
References
Upendar, K., Agrawal, K.N., Chandel, N.S. et al. Greenness identification using visible spectral colour indices for site specific weed management. Plant Physiol. Rep. 26, 179-187 (2021). https://doi.org/10.1007/s40502-020-00562-0
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_gli
¶
Calculate GLI (Green Leaf Index) from an xarray Dataset containing spectral bands.
Parameters:
Returns:
Notes
GLI is calculated using the formula: GLI = (2 x Green - Red - Blue) / (2 x Green + Red + Blue)
References
Eng, L.S., Ismail, R., Hashim, W., Baharum, A., 2019. The Use of VARI, GLI, and VIgreen Formulas in Detecting Vegetation In aerial Images. International Journal of Technology. Volume 10(7), pp. 1385-1394 https://doi.org/10.14716/ijtech.v10i7.3275
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_gndvi
¶
Calculate GNDVI (Green Normalized Difference Vegetation Index) from an xarray Dataset containing spectral bands.
This function will clip the NIR and Green bands to the range [0, 1] before calculating GNDVI to avoid potential numerical instabilities from negative reflections.
Parameters:
Returns:
Notes
GNDVI is calculated using the formula: GNDVI = (NIR - Green) / (NIR + Green)
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_grvi
¶
Calculate GRVI (Green Red Vegetation Index) from an xarray Dataset containing spectral bands.
This function will clip the Green and Red bands to the range [0, 1] before calculating GRVI to avoid potential numerical instabilities from negative reflections.
Parameters:
Returns:
Notes
GRVI is calculated using the formula: GRVI = (Green - Red) / (Green + Red)
References
Eng, L.S., Ismail, R., Hashim, W., Baharum, A., 2019. The Use of VARI, GLI, and VIgreen Formulas in Detecting Vegetation In aerial Images. International Journal of Technology. Volume 10(7), pp. 1385-1394 https://doi.org/10.14716/ijtech.v10i7.3275
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_ndvi
¶
Calculate NDVI from an xarray Dataset containing spectral bands.
This function will clip the NIR and Red bands to the range [0, 1] before calculating NDVI to avoid potential numerical instabilities from negative reflections.
Parameters:
Returns:
Notes
NDVI (Normalized Difference Vegetation Index) is calculated using the formula: NDVI = (NIR - Red) / (NIR + Red)
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_nrvi
¶
Calculate NRVI (Normalized Ratio Vegetation Index) from an xarray Dataset containing spectral bands.
This will use the RVI if it is already present in the dataset, otherwise it will calculate it first.
Parameters:
Returns:
Notes
NRVI is calculated using the formula: NRVI = (RVI - 1) / (RVI + 1) where RVI = NIR / Red
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_rvi
¶
Calculate RVI (Ratio Vegetation Index) from an xarray Dataset containing spectral bands.
This function will clip the NIR and Red bands to the range [0, 1] before calculating RVI to avoid potential numerical instabilities from negative reflections.
Parameters:
Returns:
Notes
RVI is calculated using the formula: RVI = NIR / Red
References
Lemenkova, Polina. "Hyperspectral Vegetation Indices Calculated by Qgis Using Landsat Tm Image: a Case Study of Northern Iceland" Advanced Research in Life Sciences, vol. 4, no. 1, Sciendo, 2020, pp. 70-78. https://doi.org/10.2478/arls-2020-0021
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_savi
¶
Calculate SAVI (Soil Adjusted Vegetation Index) from an xarray Dataset containing spectral bands.
This will use the NDVI if it is already present in the dataset, otherwise it will calculate it first.
Parameters:
-
optical
(xarray.Dataset
) –The xarray Dataset containing the spectral bands.
-
s
(float
, default:0.5
) –The soil adjustment factor.
Returns:
Notes
SAVI is calculated using the formula: SAVI = NDVI * (1 + s)
References
Lemenkova, Polina. "Hyperspectral Vegetation Indices Calculated by Qgis Using Landsat Tm Image: a Case Study of Northern Iceland" Advanced Research in Life Sciences, vol. 4, no. 1, Sciendo, 2020, pp. 70-78. https://doi.org/10.2478/arls-2020-0021
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_tgi
¶
Calculate TGI (Triangular Greenness Index) from an xarray Dataset containing spectral bands.
This function will clip the optical bands to the range [0, 1] before calculating TGI to avoid potential numerical instabilities from negative reflections.
Parameters:
Returns:
Notes
TGI is calculated using the formula: TGI = -0.5 x [190 x (Red - Green) - 120 x (Red - Blue)]
References
E. Raymond Hunt, Paul C. Doraiswamy, James E. McMurtrey, Craig S.T. Daughtry, Eileen M. Perry, Bakhyt Akhmedov, A visible band index for remote sensing leaf chlorophyll content at the canopy scale, International Journal of Applied Earth Observation and Geoinformation, Volume 21, 2013, Pages 103-112, ISSN 1569-8432, https://doi.org/10.1016/j.jag.2012.07.020.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_ttvi
¶
Calculate TTVI (Thiam's Transformed Vegetation Index) from an xarray Dataset containing spectral bands.
This will use the NDVI if it is already present in the dataset, otherwise it will calculate it first.
Parameters:
Returns:
Notes
TTVI is calculated using the formula: TTVI = sqrt(abs(NDVI) + 0.5)
References
Lemenkova, Polina. "Hyperspectral Vegetation Indices Calculated by Qgis Using Landsat Tm Image: a Case Study of Northern Iceland" Advanced Research in Life Sciences, vol. 4, no. 1, Sciendo, 2020, pp. 70-78. https://doi.org/10.2478/arls-2020-0021
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_tvi
¶
Calculate TVI (Transformed Vegetation Index) from an xarray Dataset containing spectral bands.
This will use the NDVI if it is already present in the dataset, otherwise it will calculate it first.
Parameters:
Returns:
Notes
TVI is calculated using the formula: TVI = sqrt(NDVI + 0.5)
References
Lemenkova, Polina. "Hyperspectral Vegetation Indices Calculated by Qgis Using Landsat Tm Image: a Case Study of Northern Iceland" Advanced Research in Life Sciences, vol. 4, no. 1, Sciendo, 2020, pp. 70-78. https://doi.org/10.2478/arls-2020-0021
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_vari
¶
Calculate VARI (Visible Atmospherically Resistant Index) from an xarray Dataset containing spectral bands.
This function will clip the optical bands to the range [0, 1] before calculating VARI to avoid potential numerical instabilities from negative reflections.
Parameters:
Returns:
Notes
VARI is calculated using the formula: VARI = (Green - Red) / (Green + Red - Blue)
References
Eng, L.S., Ismail, R., Hashim, W., Baharum, A., 2019. The Use of VARI, GLI, and VIgreen Formulas in Detecting Vegetation In aerial Images. International Journal of Technology. Volume 10(7), pp. 1385-1394 https://doi.org/10.14716/ijtech.v10i7.3275
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_vdvi
¶
Alias for GLI (Green Leaf Index) from an xarray Dataset containing spectral bands.
Source code in darts-preprocessing/src/darts_preprocessing/engineering/indices.py
calculate_vigreen
¶
Alias for VIGREEN (Vegetation Index Green) from an xarray Dataset containing spectral bands.