comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Reversing a multi-dimensional array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Reversing a multi-dimensional array [message #35606 is a reply to message #35591] Thu, 03 July 2003 17:06 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Andy Loughe ( remove OMITs )" <Andrew.LougheOMIT@noaaOMIT.govOMIT> writes:
> Hello,
>
> I have a 4-dimensional array, but it could someday grow to become
> 6 or 7 dimensions. What I would like to do is reverse the entire
> array, so that if it is now: a(i,j,k,l) it becomes a(l,k,j,i).
>
> What is the most efficient method for accomplishing this in IDL?

Greetings--

I think you don't actually want to reverse the array, but rather
change the order of the dimensions. This is exactly what TRANSPOSE
will do for you with its mysterious optional permutation vector
parameter. Explaining it is much harder than showing how you would
use it:

aprime = transpose(a, [3,2,1,0])

(which is actually the default). Unfortunately this is a case where
RSI used 0-based dimension numbering instead of 1-based (as is used in
TOTAL, MIN etc).

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Variable y-axis sizes in multiplot/ladder?
Next Topic: Slider Question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 17:06:21 PDT 2025

Total time taken to generate the page: 0.64270 seconds