eemont.image.index
- eemont.image.index(self, index='NDVI', G=2.5, C1=6.0, C2=7.5, L=1.0, cexp=1.16, nexp=2.0, alpha=0.1, slope=1.0, intercept=0.0, gamma=1.0, kernel='RBF', sigma='0.5 * (a + b)', p=2.0, c=1.0, online=False, drop=False)[source]
Computes one or more spectral indices (indices are added as bands) for an image.
Deprecated since version 0.3.0: Use
spectralIndices()instead.Tip
Check more info about the supported platforms and spectral indices in the User Guide.
- Parameters
self (ee.Image [this]) – Image to compute indices on. Must be scaled to [0,1].
index (string | list[string], default = 'NDVI') –
Index or list of indices to compute.
- Available options:
’vegetation’ : Compute all vegetation indices.
’burn’ : Compute all burn indices.
’water’ : Compute all water indices.
’snow’ : Compute all snow indices.
’drought’ : Compute all drought indices.
’urban’ : Compute all urban (built-up) indices.
’kernel’ : Compute all kernel indices.
’all’ : Compute all indices listed below.
- Awesome Spectral Indices for GEE:
Check the complete list of indices here.
G (float, default = 2.5) – Gain factor. Used just for index = ‘EVI’.
C1 (float, default = 6.0) – Coefficient 1 for the aerosol resistance term. Used just for index = ‘EVI’.
C2 (float, default = 7.5) – Coefficient 2 for the aerosol resistance term. Used just for index = ‘EVI’.
L (float, default = 1.0) – Canopy background adjustment. Used just for index = [‘EVI’,’SAVI’].
cexp (float, default = 1.16) – Exponent used for OCVI.
nexp (float, default = 2.0) – Exponent used for GDVI.
alpha (float, default = 0.1) – Weighting coefficient used for WDRVI.
slope (float, default = 1.0) – Soil line slope.
intercept (float, default = 0.0) – Soil line intercept.
gamma (float, default = 1.0) – Weighting coefficient used for ARVI.
kernel (str, default = 'RBF') –
Kernel used for kernel indices.
- Available options:
’linear’ : Linear Kernel.
’RBF’ : Radial Basis Function (RBF) Kernel.
’poly’ : Polynomial Kernel.
sigma (str | float, default = '0.5 * (a + b)') – Length-scale parameter. Used for kernel = ‘RBF’. If str, this must be an expression including ‘a’ and ‘b’. If numeric, this must be positive.
p (float, default = 2.0) – Kernel degree. Used for kernel = ‘poly’.
c (float, default = 1.0) – Free parameter that trades off the influence of higher-order versus lower-order terms in the polynomial kernel. Used for kernel = ‘poly’. This must be greater than or equal to 0.
online (boolean, default = False) – Whether to retrieve the most recent list of indices directly from the GitHub repository and not from the local copy.
drop (boolean, default = True) – Whether to drop all bands except the new spectral indices.
- Returns
Image with the computed spectral index, or indices, as new bands.
- Return type
ee.Image
See also
scaleScales bands on an image collection.
Examples
>>> import ee, eemont >>> ee.Authenticate() >>> ee.Initialize() >>> S2 = ee.ImageCollection('COPERNICUS/S2_SR').scale().first()
Computing one spectral index:
>>> S2.index('NDVI')
Computing indices with different parameters:
>>> S2.index('SAVI',L = 0.5)
Computing multiple indices:
>>> S2.index(['NDVI','EVI','GNDVI'])
Computing a specific group of indices:
>>> S2.index('vegetation')
Computing kernel indices:
>>> S2.index(['kNDVI'],kernel = 'poly',p = 5)
Computing all indices:
>>> S2.index('all')