[ncl-talk] sort multiple 1D vectors with a common timestamp according to one, without a loop

Rick Brownrigg brownrig at ucar.edu
Wed Aug 26 14:42:31 MDT 2015


Hi Matt,

I don't know definitively, but my reading of the docs on dim_pqsort
suggest, along with its attendant example #2, suggest that it does indeed
do what you want.  You could cobble together a small test case to verify.

HTH...
Rick




On Wed, Aug 26, 2015 at 2:32 PM, Matthew Fearon <Matthew.Fearon at dri.edu>
wrote:

> Does dim_pqsort do this?
>
> In my example, if I did  x = dim_pqsort(precip, -2) , is x the indices of
> the sorted array (descending) that I could apply to the other variables to
> order them consistent with precip?
>
> thanks for the help.
>
> ------------------------------
> *From:* ncl-talk-bounces at ucar.edu [ncl-talk-bounces at ucar.edu] on behalf
> of Matthew Fearon [Matthew.Fearon at dri.edu]
> *Sent:* Wednesday, August 26, 2015 1:20 PM
> *To:* ncl-talk at ucar.edu
> *Subject:* [ncl-talk] sort multiple 1D vectors with a common timestamp
> according to one, without a loop
>
> Dear NCL users,
>
> Trying to sort multiple 1D vectors according to one primary vector. For
> example, I have temp, rh, wind, and precip as 1D vectors of the same
> length, and they corresponding in time. How can I sort precip descending
> and attached the corresponding temp, rh, and wind to it, without a loop?
>
> thanks,
> Matt
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150826/c26d4829/attachment.html 


More information about the ncl-talk mailing list