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

Home » Public Forums » archive » Re: Sort an Array of Structures...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Sort an Array of Structures... [message #34189] Thu, 20 February 2003 16:37
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
v3ctr4@libero.it (Vectra) writes:
> Hi all, i've an array of structures like that:
>
> X = 5
> Y = 5
> Z = 5
> dumb_struct = { dumb_struct, a: 0, b: 1.0, c: 0 }
> dd = REPLICATE(dumb_struct, X, Y, X)
>
> how can i order the array in ONE variable, say something like
> dd[*,3,3] ordered by the "a" value of each element?
>
> it's correct someting like this?
> dd = dd(SORT(dd[*,3,3].a))

Did you try it?

One question: why do you index the array DD in the inner expression by
[*,3,3], but not the outer expression?

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Sort an Array of Structures...
Next Topic: WRITING HDF FILES

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

Current Time: Wed Oct 08 17:10:15 PDT 2025

Total time taken to generate the page: 0.00539 seconds