Home »
Public Forums »
archive »
Re: sort ordering
Re: sort ordering [message #23687] |
Fri, 09 February 2001 12:28 |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
Med Bennett wrote:
> I'm confused by the following behavior:
>
>> IDL> print,stations[0:9]
>> S301 S301 S301 S301 S301 S301 S301 S301 S301 S301
>> IDL> print,sort(stations[0:9])
>> 5 1 2 3 4 0 6 7 8 9
>>
>
> If the elements of certain part of an array are identical, why does IDL
> not generate sort indices in ascending order? This has ugly
> implications for some programs I am writing. Thanks,
This is a known artifact of the SORT algorithm. Try BSORT from the
Astronomy library instead:
http://idlastro.gsfc.nasa.gov/ftp/pro/misc/bsort.pro
Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
|
|
|
Current Time: Wed Oct 08 17:44:32 PDT 2025
Total time taken to generate the page: 0.00556 seconds