xrspatial.multispectral.evi#
- xrspatial.multispectral.evi(nir_agg: xarray.core.dataarray.DataArray, red_agg: xarray.core.dataarray.DataArray, blue_agg: xarray.core.dataarray.DataArray, c1=6.0, c2=7.5, soil_factor=1.0, gain=2.5, name='evi')[source]#
Computes Enhanced Vegetation Index. Allows for importved sensitivity in high biomass regions, de-coupling of the canopy background signal and reduction of atmospheric influences.
- Parameters
nir_agg (xr.DataArray) – 2D array of near-infrared band data.
red_agg (xr.DataArray) – 2D array of red band data.
blue_agg (xr.DataArray) – 2D array of blue band data.
c1 (float, default=6.0) – First coefficient of the aerosol resistance term.
c2 (float, default=7.5) – Second coefficients of the aerosol resistance term.
soil_factor (float, default=1.0) – Soil adjustment factor between -1.0 and 1.0.
gain (float, default=2.5) – Amplitude adjustment factor.
name (str, default='evi') – Name of output DataArray.
- Returns
evi_agg – 2D array of evi values. All other input attributes are preserved.
- Return type
xarray.DataArray of same type as inputs
References
Examples
>>> from xrspatial.datasets import get_data >>> data = get_data('sentinel-2') # Open Example Data >>> nir = data['NIR'] >>> red = data['Red'] >>> blue = data['Blue'] >>> from xrspatial.multispectral import evi >>> # Generate EVI Aggregate Array >>> evi_agg = evi(nir_agg=nir, red_agg=red, blue_agg=blue) >>> nir.plot(aspect=2, size=4) >>> red.plot(aspect=2, size=4) >>> blue.plot(aspect=2, size=4) >>> evi_agg.plot(aspect=2, size=4)
>>> y, x = 100, 100 >>> m, n = 3, 4 >>> print(nir[y1:y2, x1:x2].data) [[1519. 1504. 1530. 1589.] [1491. 1473. 1542. 1609.] [1479. 1461. 1592. 1653.]] >>> print(red[y1:y2, x1:x2].data) [[1327. 1329. 1363. 1392.] [1309. 1331. 1423. 1424.] [1293. 1337. 1455. 1414.]] >>> print(blue[y1:y2, x1:x2].data) [[1281. 1270. 1254. 1297.] [1241. 1249. 1280. 1309.] [1239. 1257. 1322. 1329.]] >>> print(evi_agg[y1:y2, x1:x2].data) [[-3.8247013 -9.51087 1.3733553 2.2960372] [11.818182 3.837838 0.6185031 1.3744428] [-8.53211 5.486726 0.8394608 3.5043988]]