eemont.image.spectralIndices
- eemont.image.spectralIndices(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, omega=2.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 from the Awesome List of Spectral Indices.
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.
omega (float, default = 2.0) – Weighting coefficient used for MBWI.
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
scaleAndOffsetScales bands on an image collection.
Examples
>>> import ee, eemont >>> ee.Authenticate() >>> ee.Initialize() >>> S2 = ee.ImageCollection('COPERNICUS/S2_SR').scaleAndOffset().first()
Computing one spectral index:
>>> S2.spectralIndices('NDVI')
Computing indices with different parameters:
>>> S2.spectralIndices('SAVI',L = 0.5)
Computing multiple indices:
>>> S2.spectralIndices(['NDVI','EVI','GNDVI'])
Computing a specific group of indices:
>>> S2.spectralIndices('vegetation')
Computing kernel indices:
>>> S2.spectralIndices(['kNDVI'],kernel = 'poly',p = 5)
Computing all indices:
>>> S2.spectralIndices('all')