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

Home » Public Forums » archive » A[X,Y,Z] -> A[Z,X,Y]
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: A[X,Y,Z] -> A[Z,X,Y] [message #21175 is a reply to message #21081] Wed, 09 August 2000 00:00 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
"Liam E. Gumley" wrote:
>
> Dave Greenwood wrote:
>>
>> I'm trying to analyze data from a new experiment using an IDL code from
>> a different experiment. The new experiment has data stored in an array
>> of the form [X,Y,Z] while the code expects [Z,Y,X]. I can do something
>> like (untested):
>>
>> FOR i = 0, z-1 DO BEGIN
>> FOR j = 0, y-1 DO BEGIN
>> newarray[i, y, *] = oldarray[*, y, i]
>> ENDFOR
>> ENDFOR
>>
>> But I thought perhaps someone (probably several people) here could
>> suggest a better (faster, more elegant, etc.) way?
>>
>> Fyi, to give some size to the problem, X=1024, Y=39 and Z=3.
>
> a = findgen(1024, 39, 3)
> b = transpose(a, [2, 0, 1])
> help, b
> B FLOAT = Array[3, 1024, 39]

Not to be to ZYX'y about it, but how about

IDL> a = findgen(1024, 39, 3)
IDL> help, transpose(a, [2, 1, 0])
<Expression> FLOAT = Array[3, 39, 1024]

--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: A[X,Y,Z] -> A[Z,X,Y]
Next Topic: Re: Reverse FFT ?

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

Current Time: Sat Nov 29 21:27:27 PST 2025

Total time taken to generate the page: 1.84258 seconds