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

Home » Public Forums » archive » Re: Sorting with IDL... Please give me any suggestions!!!
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 with IDL... Please give me any suggestions!!! [message #52032] Thu, 21 December 2006 07:28 Go to previous message
yp is currently offline  yp
Messages: 42
Registered: February 2005
Member
If 'nm' is a string array and 'sr' is a float array, what data type is
'gr' or your [nm,sr] ?
You should read the data in a structure. See READ_ASCII and
ASCII_TEMPLATE helps.
Something like this:
template = { VERSION: 1.0, $
DATASTART: N, $
.
.
.
FIELDNAMES: ['nm','sr']. $
FIELDLOCATIONS : LONARR[2], $
FIELDGROUPS: [0,1] }

data=RAED_ASCII(filename, template=template)

You have to learn how to create this template via read_ascii (or use
either build_ascii_template or transread routines)

Then sort the 'sr' field and extract the index. x=sort(data.sr)
name=data.nm(x)
score=data.sr(x)

There are many different ways of reading mixed data types (search this
group, you can find numerous examples and also read through David
Fanning's website).
[Message index]
 
Read Message
Read Message
Previous Topic: Sorting with IDL... Please give me any suggestions!!!
Next Topic: How to write applications in JAVA using IDL

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

Current Time: Sat Oct 11 10:34:11 PDT 2025

Total time taken to generate the page: 1.27856 seconds