The REVERSE function reverses the order of one dimension of an array.
To reverse a string use the IDL_String.Reverse method.
The REVERSE function was ported from PRO code to C/C++ code in 8.8. You can run the SAVEFILE_CLEANUP procedure to inspect an older save file and remove any routines that might cause problems in IDL 8.8 and newer. See SAVEFILE_CLEANUP for more information.
Reverse the order of an array where each element is set to the value of its subscript:
A = [[0,1,2],[3,4,5],[6,7,8]]
PRINT, 'Original Array:'
PRINT, 'Reversed Columns:'
PRINT, 'Reversed Rows:'
PRINT, REVERSE(A, 2)
0 1 2
3 4 5
6 7 8
2 1 0
5 4 3
8 7 6
6 7 8
3 4 5
0 1 2
Result = REVERSE( Array [, Subscript_Index] [, /OVERWRITE] )
Returns the reversed dimension of the array.
The array containing the original data.
An integer specifying the dimension index (1, 2, 3, etc.) that will be reversed. If this argument is omitted, the first dimension is reversed.
If this index is greater than the number of dimensions of Array, that dimension is treated as being of size 1 and a copy of Array is returned. Since IDL does not support greater than 8 dimensional arrays, this index must be in the range [1, 8].
If this index is negative, the dimension to reverse is counted from the last forward. A value of -1 implies the last dimension, -2 the next to last, etc. The magnitude of the index must be less than or equal to the number of dimensions of Array.
This argument is ignored for scalar input.
Set this keyword to conserve memory by doing the transformation “in-place.” The result overwrites the previous contents of the Array parameter.
This keyword is ignored for scalar input.
INVERT, REFORM, ROT, ROTATE, SHIFT, TRANSPOSE