Re: Sort and Where [message #20489] |
Fri, 30 June 2000 00:00 |
Simon de Vet
Messages: 36 Registered: May 2000
|
Member |
|
|
Ivan Zimine wrote:
> Simon de Vet wrote:
>>
>> I assumed that this would sort both in the order of the y-coordinates.
>> However, when I use these values, my negative values reappear.
>
> 'sort' does not sort input array but returns subscipts for sorting
That's what I thought, and is no doubt what's causing all my problems.
I thought that the way I was handling my arrays would take this into
account. I guess not.
I'll keep trying. I have a hunch that this would be more straightforward if
I were to do it on multiple lines... easier to keep track of what's doing
what.
Simon
|
|
|
Re: Sort and Where [message #20497 is a reply to message #20489] |
Thu, 29 June 2000 00:00  |
Ivan Zimine
Messages: 40 Registered: February 1999
|
Member |
|
|
Simon de Vet wrote:
>
> I assumed that this would sort both in the order of the y-coordinates.
> However, when I use these values, my negative values reappear.
'sort' does not sort input array but returns subscipts for sorting
IDL> x = [3,1,4,5]
IDL> print, sort(x)
1 0 2 3
; does input array have 0?
IDL> print, x(sort(x))
1 3 4 5
hope this helps
Ivan
--
Ivan Zimine | ivan.zimine@physics.unige.ch
Dpt. of Radiology | (+41 22) 372 70 70
Geneva University Hospitals |
|
|
|