general/misc/SSW/
bsort.pro
Routines
top source Bsort
result = Bsort(Array, Asort, INFO=INFO, REVERSE=REVERSE)
NAME: BSORT PURPOSE: Function to sort data into ascending order, like a simple bubble sort. EXPLANATION: Original subscript order is maintained when values are equal (FIFO). (This differs from the IDL SORT routine alone, which may rearrange order for equal values) NOTE: this routine is originally from the NASA GSFC IDL Astro Library. http://idlastro.gsfc.nasa.gov/ CALLING SEQUENCE: result = bsort( array, [ asort, /INFO, /REVERSE ] ) INPUT: Array - array to be sorted OUTPUT: result - sort subscripts are returned as function value OPTIONAL OUTPUT: Asort - sorted array OPTIONAL KEYWORD INPUTS: /REVERSE - if this keyword is set, and non-zero, then data is sorted in descending order instead of ascending order. /INFO = optional keyword to cause brief message about # equal values. HISTORY written by F. Varosi Oct.90: uses WHERE to find equal clumps, instead of looping with IF ( EQ ). compatible with string arrays, test for degenerate array 20-MAY-1991 JKF/ACC via T AKE- return indexes if the array to be sorted has all equal values. Aug - 91 Added REVERSE keyword W. Landsman Always return type LONG W. Landsman August 1994 Converted to IDL V5.0 W. Landsman September 1997 Added to TDAS P.Cruce Jun 2008 $LastChangedBy: pcruce $ $LastChangedDate: 2008-07-01 14:43:50 -0700 (Tue, 01 Jul 2008) $ $LastChangedRevision: 3230 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/misc/SSW/bsort.pro $
Parameters
- Array
- Asort
Keywords
- INFO
- REVERSE
File attributes
Modification date: | Thu Feb 13 16:43:43 2014 |
Lines: | 41 |