ENVISpectralIndexRaster
This function constructs an ENVIRaster from a source raster that has a spectral index applied.
The result is a virtual raster, which has some additional considerations with regard to methods and properties. See Virtual Rasters for more information, including how they differ from ENVITasks.
The equivalent task is SpectralIndex.
Example
This example creates a Normalized Difference Vegetation Index (NDVI) raster. See More Examples for other use cases.
; Start the application
e = ENVI()
; Open an input file
file = FILEPATH('qb_boulder_msi', ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY = ['data'])
raster = e.OpenRaster(file)
; compute NDVI
NDVIImage = ENVISpectralIndexRaster(raster, 'NDVI')
; save it in ENVI raster format
newFile = e.GetTemporaryFilename()
NDVIImage.Export, newFile, 'ENVI'
; Open the NDVI image
NDVIImage = e.OpenRaster(newFile)
; Display the result
View = e.GetView()
Layer = View.CreateLayer(NDVIImage)
Syntax
Result = ENVISpectralIndexRaster(Input_Raster, Index [, ERROR=variable])
Return Value
This routine returns a reference to an ENVIRaster.
Arguments
Input_Raster
Specify the input ENVIRaster.
Index
Specify a string or array of strings with pre-defined spectral indices. You can use the acronym or full name for the string. Follow the hyperlinks for definitions of each index. See More Examples for an example of creating a multi-band spectral index raster.
- Alunite Index (ALUI)
- Anthocyanin Reflectance Index 1 (ARI1)
- Anthocyanin Reflectance Index 2 (ARI2)
- Atmospherically Resistant Vegetation Index (ARVI)
- Burn Area Index (BAI)
- Calcite Index (CALI)
- Carotenoid Reflectance Index 1 (CRI1)
- Carotenoid Reflectance Index 2 (CRI2)
- Cellulose Absorption Index (CAI)
- Clay Alteration Index (CLAI)
- Clay Minerals Ratio (CLAY)
- Difference Vegetation Index (DVI)
- Disease Water Stress Index (DWSI)
- Dolomite Index (DOLI)
- Enhanced Vegetation Index (EVI)
- Epidote / Chlorite / Amphibole Index (ECAI)
- Ferric Iron Alteration Index (FEAI)
- Ferrous Iron (Fe2+) Index (FEI)
- Ferrous Minerals Ratio (Ferrous)
- Ferrous Silicates Index (FESI)
- Global Environmental Monitoring Index (GEMI)
- Green Atmospherically Resistant Index (GARI)
- Green Chlorophyll Index (GCI)
- Green Difference Vegetation Index (GDVI)
- Green Leaf Index (GLI)
- Green Normalized Difference Vegetation Index (GNDVI)
- Green Optimized Soil Adjusted Vegetation Index (GOSAVI)
- Green Ratio Vegetation Index (GRVI)
- Green Soil Adjusted Vegetation Index (GSAVI)
- Green Vegetation Index (GVI)
- Hydroxyl-Bearing (OH) Altered Minerals Index 1 (OHI1)
- Hydroxyl-Bearing (OH) Altered Minerals Index 2 (OHI2)
- Hydroxyl-Bearing (OH) Altered Minerals Index 3 (OHI3)
- Infrared Percentage Vegetation Index (IPVI)
- Iron Oxide Ratio (Iron Oxide)
- Kaolinite Index 1 (KAI1)
- Kaolinite Index 2 (KAI2)
- Kaolinite Index 3 (KAI3)
- Laterite Index (LATI)
- Leaf Area Index (LAI)
- Leaf Chlorophyll Index (LCI)
- Leaf Water Vegetation Index 1 (LWVI1)
- Leaf Water Vegetation Index 2 (LWVI2)
- Lignin Cellulose Absorption Index (LCAI)
- Magnesite Index (MAGI)
- Methane Index (METHANE)
- MgOH-Carbonate Abundance Index (MGAI)
- Modified Chlorophyll Absorption Ratio Index (MCARI)
- Modified Chlorophyll Absorption Radio Index Improved (MCARI2)
- Modified Non-Linear Index (MNLI)
- Modified Normalized Difference Water Index (MNDWI)
- Modified Red Edge Normalized Difference Vegetation Index (MRENDVI)
- Modified Red Edge Simple Ratio (MRESR)
- Modified Simple Ratio (MSR)
- Modified Soil Adjusted Vegetation Index 2 (MSAVI2)
- Modified Triangular Vegetation Index (MTVI)
- Modified Triangular Vegetation Index - Improved (MTVI2)
- Moisture Stress Index (MSI)
- Montmorillonite Index (MONI)
- Muscovite Index (MUSI)
- Non-Linear Index (NLI)
- Normalized Burn Ratio (NBR)
- Normalized Difference Built-Up Index (NDBI)
- Normalized Difference Infrared Index (NDII)
- Normalized Difference Lignin Index (NDLI)
- Normalized Difference Mud Index (NDMI)
- Normalized Difference Nitrogen Index (NDNI)
- Normalized Difference Snow Index (NDSI)
- Normalized Difference Vegetation Index (NDVI)
- Normalized Difference Water Index (NDWI)
- Normalized Multiband Drought Index (NMDI)
- Normalized Pigment Chlorophyll Index (NPCI)
- Optimized Soil Adjusted Vegetation Index (OSAVI)
- Phengitic Index (PHEI)
- Photochemical Reflectance Index (PRI)
- Phyllic Alteration Index (PHAI)
- Plant Senescence Reflectance Index (PSRI)
- Propylitic Alteration Index (PRAI)
- Red Edge Normalized Difference Vegetation Index (RENDVI)
- Red Edge Position Index (REPI)
- Red Green Ratio Index (RGRI)
- Renormalized Difference Vegetation Index (RDVI)
- Silica Dioxide Index (SIDI)
- Simple Ratio (SR)
- Soil Adjusted Vegetation Index (SAVI)
- Structure Independent Pigment Index (SIPI1)
- Structure Insensitive Pigment Index (SIPI)
- Sum Green Index (SGI)
- Transformed Chlorophyll Absorption Reflectance Index (TCARI)
- Transformed Difference Vegetation Index (TDVI)
- Triangular Greenness (TGI)
- Triangular Vegetation Index (TVI)
- Visible Atmospherically Resistant Index (VARI)
- Water Band Index (WBI)
- Wide Dynamic Range Vegetation Index (WDRVI)
- WorldView Built-Up Index (WV-BI)
- WorldView Improved Vegetative Index (WV-VI)
- WorldView New Iron Index (WV-II)
- WorldView Non-Homogeneous Feature Difference (WV-NHFD)
- WorldView Soil Index (WV-SI)
- WorldView Water Index (WV-WI)
Keywords
ERROR
Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''
). If an error occurs and the routine is a function, then the function result will be undefined.
When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.
See Manage Errors for more information on error handling in ENVI programming.
NAME
Specify a string that identifies the raster.
More Examples
This example creates a raster with three bands that each provide a different spectral index.
; Start the application
e = ENVI()
; Open an input file
file = FILEPATH('qb_boulder_msi', ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY = ['data'])
raster = e.OpenRaster(file)
; Create a spectral index raster using an array of indices
Indices = ['Normalized Difference Vegetation Index', $
'Simple Ratio', $
'Difference Vegetation Index']
SIRaster = ENVISpectralIndexRaster(raster, Indices)
Version History
ENVI 5.2 |
Introduced |
ENVI 5.3.1 |
Documented the dehydrated form of this virtual raster |
ENVI 5.4 |
Added Dehydrate and Hydrate methods; added NAME keyword |
API Version
4.2
See Also
ENVIRaster, QuerySpectralIndices Task, SpectralIndex Task, SpectralIndices Task