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

Home » Public Forums » archive » Re: Sort and Where - SOLVED!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Sort and Where - SOLVED! [message #20487] Fri, 30 June 2000 00:00
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Simon de Vet wrote:
>
> I've managed to solve my problem.
>
> First I defined the array to remove all the negative values:
>
> nozero = where( pem1(flight, *, 6) gt 0.0 and pem1(flight, *, 9) gt 0.0)
>
> Then I sorted the filter array by the size of the y-coordinates, and
> applied it to the arrays:
>
> x-coordinates:
> pem1(flight, nozero(sort(pem1(flight, nozero, 6))), 9)
>
> y-coordinates:
> pem1(flight, nozero(sort(pem1(flight, nozero, 6))), 6)
>
> The problem lay in where I was sorting. I was originally trying to sort the
> array data itself, instead of trying to sort the index I had already
> created.
>
> Yay!
>
> Simon

Simon,

sounds like you may wish to try my ind_comb routine from my library
at
http://www.mpimet.mpg.de/~schultz.martin/idl/ . This allows you to
combine the results of sequential WHERE operations. In your example:

ok1 = where( pem1(flight, *, 6) gt 0.0)
ok2 = where( pem1(flight, *, 9) gt 0.0)
nozero = ind_comb(ok1, ok2, "AND")

I wrote this when I had to deal with data similar to yours and ran
into this kind of situation over and over again.

Regards,
Martin


--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
Re: Sort and Where - SOLVED! [message #20488 is a reply to message #20487] Fri, 30 June 2000 00:00 Go to previous message
Simon de Vet is currently offline  Simon de Vet
Messages: 36
Registered: May 2000
Member
I've managed to solve my problem.

First I defined the array to remove all the negative values:

nozero = where( pem1(flight, *, 6) gt 0.0 and pem1(flight, *, 9) gt 0.0)

Then I sorted the filter array by the size of the y-coordinates, and
applied it to the arrays:

x-coordinates:
pem1(flight, nozero(sort(pem1(flight, nozero, 6))), 9)

y-coordinates:
pem1(flight, nozero(sort(pem1(flight, nozero, 6))), 6)


The problem lay in where I was sorting. I was originally trying to sort the
array data itself, instead of trying to sort the index I had already
created.

Yay!


Simon
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: include file?
Next Topic: Re: Sort and Where

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

Current Time: Wed Oct 08 19:50:25 PDT 2025

Total time taken to generate the page: 0.00499 seconds