The ENVITask function accepts a task name and returns an object reference to the task.

To write a custom task, see Custom Tasks and ENVITaskFromProcedure.

For a complete list of tasks, see ENVITasks by Category.

Example


Example code is available in each of the ENVITask topics.

Syntax


Result = ENVITask('TaskName' [, ERROR=variable])

Or:

Result = ENVITask('TaskURI' [, ERROR=variable])

Or:

Result = ENVITask(GSF_URL [, ERROR=variable])

Return Value


The ENVITask function returns a reference to an ENVITask object. Use the returned reference to set parameters and execute the task by changing properties or calling methods.

Arguments


GSF_URL

Specify a URL to a Geospatial Services Framework (GSF) endpoint, for example:

http://server:port/ese/services/ENVI/ENVIApplyGainOffsetTask

TaskURI

Specify a string with the full path and filename to a .task file on disk. This option is useful if you are developing and testing a custom task but have not yet deployed it to the appropriate location yet.

TaskName

Specify a string with the name of the task to perform. To see the full list of available tasks in ENVI, type the following at the command line after starting ENVI:

taskNames = e.TASK_NAMES
print, taskNames

See also ENVITasks by Category.

Methods


AddParameter

Dehydrate

Execute

Hydrate

Parameter

ParameterNames

RemoveParameter

Properties


Properties marked as (Init) can be set during the initial creation of the object. Properties marked as (Get) can be retrieved. Properties marked as (Set) can be set after initial creation.

ABORTED (Get)

A boolean that returns true if the task was aborted. Not all tasks support aborting; in these cases the property always returns false.

DESCRIPTION (Get, Init)

Text describing the task.

DISPLAY_NAME (Get, Init)

The name of the task as it appears in the user interface.

NAME (Get, Init)

The name of the task.

REVISION (Get, Init)

A string with the semantic revision number of the task. As the task definition evolves over time, the changes will affect how the revision number is incremented.

SOURCE_URI (Get, Init)

The path and filename of the .task file that defines the task. If the task was created programmatically using OBJ_NEW, then SOURCE_URI will be an empty string.

TAGS (Get, Init)

A scalar string or an array of strings that help categorize the task. It can be empty with a value of !NULL.

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.

Version History


ENVI 5.1

Introduced

ENVI 5.2

Added DISPLAY_NAME property.

ENVI 5.3

Added ABORTED property.

ENVI 5.3. 2

Added AddParameter and RemoveParameter methods.

ENVI 5.4

Deprecated IGNORE_VALIDATE property and Validate method.

ENVI 5.5

Added Hydrate method; added ability to specify a Geospatial Services Framework (GSF) endpoint URL as input.

ENVI 5.5.1

Added TAGS and SOURCE_URI properties.