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

Home » Public Forums » archive » Re: sorting column arrays
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: sorting column arrays [message #49158 is a reply to message #49154] Fri, 30 June 2006 05:30 Go to previous message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
How about this (no loop):

v=lonarr(4,n_elements(array))
reads,strmid(array,4),v
print,v[*,sort(v[1,*]+v[2,*]/10.+v[0,*]/100.)]

The last line makes the sort in one go, since SORT doesn't guarantee
anything about the order of identical elements. You might have to
adjust the coefficients if your data has a wider range than the sample
you show.

regards,
Greg
[Message index]
 
Read Message
Read Message
Previous Topic: IDL's THIN function, with /PRUNE option
Next Topic: Problem when reading many HDF-EOS file

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

Current Time: Fri Oct 10 22:39:54 PDT 2025

Total time taken to generate the page: 1.44059 seconds