This task returns a string array of the spectral indices that can be computed for a given input raster, based on its wavelength metadata. Issue the PRINT command on the AVAILABLE_INDICES property (see code example) or open the Data Manager in the user interface to see the list of available indices.
Example
e = ENVI()
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
Task = ENVITask('QuerySpectralIndices')
Task.INPUT_RASTER = Raster
Task.Execute
Task2 = ENVITask('SpectralIndices')
Task2.INPUT_RASTER = Raster
Task2.INDEX = Task.AVAILABLE_INDICES
Task2.Execute
DataColl = e.Data
DataColl.Add, Task2.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(Task2.OUTPUT_RASTER)
Print, Task.AVAILABLE_INDICES
Syntax
Result = ENVITask('QuerySpectralIndices')
Input properties (Set, Get): INPUT_RASTER
Output properties (Get only): AVAILABLE_INDICES
Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.
Methods
This task inherits the following methods from ENVITask:
AddParameter
Execute
Parameter
ParameterNames
RemoveParameter
Properties
This task inherits the following properties from ENVITask:
COMMUTE_ON_DOWNSAMPLE
COMMUTE_ON_SUBSET
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
This task also contains the following properties:
AVAILABLE_INDICES
A string array with the spectral indices that can be computed for the input raster.
INPUT_RASTER (required)
Specify a raster to query for available spectral indices.
Version History
API Version
4.2
See Also
ENVITask, ENVISpectralIndexRaster, SpectralIndex Task, SpectralIndices Task, ENVISubsetRaster