REVERSE
Syntax | Return Value | Arguments | Keywords | Examples | Version History | See Also
The REVERSE function reverses the order of one dimension of an array.
This routine is written in the IDL language. Its source code can be found in the file reverse.pro in the lib subdirectory of the IDL distribution.
Syntax
Result = REVERSE( Array [, Subscript_Index] [, /OVERWRITE] )
Return Value
Returns the reversed dimension of the array.
Arguments
Array
The array containing the original data.
Subscript_Index
An integer specifying the dimension index (1, 2, 3, etc.) that will be reversed. This argument must be less than or equal to the number of dimensions of Array. If this argument is omitted, the first subscript is reversed.
Keywords
OVERWRITE
Set this keyword to conserve memory by doing the transformation "in-place." The result overwrites the previous contents of the array. This keyword is ignored for one- or two-dimensional arrays.
Examples
Reverse the order of an array where each element is set to the value of its subscript:
IDL prints:
Original Array: 0 1 2 3 4 5 6 7 8 Reversed Columns: 2 1 0 5 4 3 8 7 6 Reversed Rows: 6 7 8 3 4 5 0 1 2Note
Also see Reversing Images (Image Processing in IDL) for a more extensive example.
Version History
See Also
INVERT, REFORM, ROT, ROTATE, SHIFT, TRANSPOSE