evi2

evi2(nir, red)[source]

Compute EVI2 = 2.5 * (NIR - Red) / (NIR + 2.4*Red + 1) via Rust core.

Overview

evi2 computes the 2-band Enhanced Vegetation Index variant (EVI2):

\[EVI2 = G \cdot \frac{NIR - Red}{NIR + C1 \cdot Red + L}\]

Using common constants: - \(G = 2.5\) - \(C1 = 2.4\) - \(L = 1.0\)

EVI2 is often used when the blue band is unavailable, while retaining some of EVI’s improvements over NDVI.

Usage

import numpy as np
from eo_processor import evi2

nir = np.array([0.60, 0.70, 0.35])
red = np.array([0.25, 0.20, 0.15])

out = evi2(nir, red)
print(out)

Shapes & Dtypes

  • Supports 1D and 2D arrays in the public Python API.

  • Inputs may be any numeric dtype (int/uint/float); coerced to float64 internally.

  • Shapes of nir and red must match exactly; mismatch raises ValueError.

Numerical Stability

Very small denominators are guarded with an EPSILON (1e-10). When nir + 2.4*red + 1 is ~0 the output is set to 0.0 to avoid instability.

See Also

End of EVI2 documentation.