GenerateIndexArray Task

This task generates an array of numbers.

Example

; Start the application

e = ENVI(/HEADLESS)

 

; Get the task from the catalog of ENVITasks

Task = ENVITask('GenerateIndexArray')

 

; Define task inputs

Task.MIN = 3

Task.MAX = 10

 

; Run the task

Task.Execute

 

; Print the resulting array

Print, Task.OUTPUT_ARRAY

Result:

3.0000000  4.0000000  5.0000000  6.0000000  7.0000000  8.0000000  9.0000000  10.0000000

See More Examples below.

Syntax

Result = ENVITask('GenerateIndexArray')

Input properties (Set, Get): INCREMENT, MAX, MIN, N_ELEMENTS, REVERSE

Output properties (Get only): OUTPUT_ARRAY

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:

INCREMENT (optional)

Enter the desired increment between consecutive values.

MAX (optional)

Enter the maximum value of the array.

MIN (optional)

Enter the mimimum value of the array.

N_ELEMENTS (optional)

Specify the number of elements in the resulting array.

OUTPUT_ARRAY

The resulting array of numbers.

REVERSE (optional)

Set this property to reverse the order of the output elements.

More Examples

Example 2

Task = ENVITask('GenerateIndexArray')

Task.MIN = -1

Task.MAX = 0

Task.INCREMENT = 0.2

Task.Execute

Print, Task.OUTPUT_ARRAY

Result:

-1.0000000  -0.80000000   -0.59999999  -0.39999999   -0.19999999  1.4901161e-008

Example 3

Task = ENVITask('GenerateIndexArray')

Task.MIN = 10

Task.MAX = 20

Task.INCREMENT = -5

Task.Execute

Print, Task.OUTPUT_ARRAY

Result:

20.000000  15.000000  10.000000

Example 4

Task = ENVITask('GenerateIndexArray')

Task.MIN = 0

Task.MAX = 15

Task.N_ELEMENTS = 4

Task.Execute

Print, Task.OUTPUT_ARRAY

Result:

0.00000000  5.00000000  10.00000000  15.00000000

Example 5

Task = ENVITask('GenerateIndexArray')

Task.MIN = -3

Task.MAX = 2

Task.N_ELEMENTS = 3

Task.Execute

Print, Task.OUTPUT_ARRAY

Result:

-3.0000000  -1.0000000  1.0000000

Example 6

Task = ENVITask('GenerateIndexArray')

Task.MAX = 150

Task.NELEMENTS = 4

Task.INCREMENT = 10

Task.Execute

Print, Task.OUTPUT_ARRAY

Result:

120.00000  130.00000  140.00000  150.00000

Example 7

Task = ENVITask('GenerateIndexArray')

Task.MIN = 10

Task.MAX = 20

Task.INCREMENT = 2

Task.REVERSE = 1

Task.Execute

Print, Task.OUTPUT_ARRAY

Result:

20.000000  18.000000  16.000000  14.000000  12.000000

Example 8

Task = ENVITask('GenerateIndexArray')

Task.MIN = 10

Task.MAX = 20

Task.INCREMENT = 3

Task.Execute

Print, Task.OUTPUT_ARRAY

Result:

10.000000  13.000000  16.000000  19.000000

Version History

ENVI 5.5. 1

Introduced

API Version

4.2

See Also

ENVITask, GenerateContourLines Task