QuerySpectralIndices Task

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

; Start the application

e = ENVI()

 

; Open an input file

File = Filepath('qb_boulder_msi', Subdir=['data'], $

  Root_Dir=e.Root_Dir)

Raster = e.OpenRaster(File)

 

; Get the task from the catalog of ENVITasks

Task = ENVITask('QuerySpectralIndices')

 

; Define inputs

Task.INPUT_RASTER = Raster

 

; Run the task

Task.Execute

 

; Get the task from the catalog of ENVITasks

Task2 = ENVITask('SpectralIndices')

 

; Define inputs

Task2.INPUT_RASTER = Raster

Task2.INDEX = Task.AVAILABLE_INDICES

 

; Run the task

Task2.Execute

 

; Get the collection of data objects currently available in the Data Manager

DataColl = e.Data

 

; Add the output to the Data Manager

DataColl.Add, Task2.OUTPUT_RASTER

 

; Display the result

View = e.GetView()

Layer = View.CreateLayer(Task2.OUTPUT_RASTER)

 

; Print the available indices to the

; ENVI command line

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

ENVI 5.2

Introduced

API Version

4.2

See Also

ENVITask, ENVISpectralIndexRaster, SpectralIndex Task, SpectralIndices Task, ENVISubsetRaster