[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: Re: A[X,Y,Z] -> A[Z,X,Y]*From*: Paul van Delst <pvandelst(at)ncep.noaa.gov>*Date*: Wed, 09 Aug 2000 14:56:31 -0400*Newsgroups*: comp.lang.idl-pvwave*Organization*: CIMSS @ NOAA/NCEP*References*: <9AUG00.17493035@feda34.fed.ornl.gov> <3991A5D7.1FC5F383@ssec.wisc.edu>*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:20747

"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

**References**:**A[X,Y,Z] -> A[Z,X,Y]***From:*Dave Greenwood

**Re: A[X,Y,Z] -> A[Z,X,Y]***From:*Liam E. Gumley

- Prev by Date:
**Re: A[X,Y,Z] -> A[Z,X,Y]** - Next by Date:
**No. of variables allowed?** - Prev by thread:
**Re: A[X,Y,Z] -> A[Z,X,Y]** - Next by thread:
**No. of variables allowed?** - Index(es):