Re: qsort

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 11 2010 - 14:57:09 MST

I think this is what you want:

http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort.shtml

See examples

On 11/11/10 2:49 PM, Stephanie Slade wrote:
> Is there a way to use qsort (or any other method really) but keep the
> original indices? I need to be able to keep it for a "time" index so
> that I can sort another corresponding dataset accordingly. I know this
> is confusing, so I'll make up an example of what I mean.
> Say I have:
>
> [-4, 5, 3, -2, 1] which temporally corresponds to [7, 2, 1, 10, -3] and
> I need the first one to be [-4, -2, 1, 3, 5] but I need the index so
> that I can rearrange the second corresponding array to be [7, 10, -3, 1, 2]
>
> Thank you!
> Steph
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 11 14:57:13 2010

This archive was generated by hypermail 2.1.8 : Mon Nov 15 2010 - 08:55:22 MST