NDVI
Luo_Suppe2026-08-15
gma.rsvi.NDVI
[function] NDVI(red, nir):Calculate the Normalized Differnce Vegetation Index.
Parameters:
red: array.
Red-infrared band data.
nir: array.
Near-infrared band data.
Returns:
Type: array.
Example
import numpy as np
from gma import rsvi
# Simulated surface reflectance (0-1) of the red and nir bands
red = np.random.uniform(0.05, 0.5, (512, 512)).astype('float32')
nir = np.random.uniform(0.1, 0.6, (512, 512)).astype('float32')
# Calculate the Normalized Difference Vegetation Index
ndvi = rsvi.NDVI(red, nir)