array transpose [message #8799] |
Sat, 19 April 1997 00:00  |
Gary Fu
Messages: 9 Registered: April 1997
|
Junior Member |
|
|
Hi,
Is there a simple way to transpose the array(x,y,z) to array(y,x,z) ?
Thanks.
Gary
|
|
|
Re: array transpose [message #8842 is a reply to message #8799] |
Thu, 24 April 1997 00:00  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
Gary Fu <gfu@shark.gsfc.nasa.gov> writes:
> Hi,
> Is there a simple way to transpose the array(x,y,z) to array(y,x,z) ?
> Thanks.
> Gary
Several people have recommended the built-in TRANSPOSE function. Apparently,
this was enhanced in IDL 4.0 to allow arrays with more than 2 dimensions, and
to include an optional parameter to list the order that the dimensions should
be rearranged into.
For older versions of IDL, I've written a routine called REARRANGE which does
the same thing. It has two modes of operation:
1. Pure IDL code.
2. Call to C code via CALL_EXTERNAL, if the proper logical name is
defined.
It differs from the new TRANSPOSE in only two ways:
1. It numbers the dimensions from 1 instead of 0. (Come-on, RSI,
other IDL built-in routines, like TOTAL, number dimensions starting
from 1 on.)
2. It allows one to signal that a given dimension should be reversed,
by passing it as a negative number.
I suppose it's somewhat obsolete now, but if anyone wants it, it can be found
at URL
ftp://sohoftp.nascom.nasa.gov/solarsoft/gen/idl/util/rearran ge.pro
and the CALL_EXTERNAL code can be found at URL
ftp://sohoftp.nascom.nasa.gov/solarsoft/gen/idl_external
Bill Thompson
|
|
|