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

Home » Public Forums » archive » Not where
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Not where [message #18866 is a reply to message #18780] Mon, 07 February 2000 00:00 Go to previous messageGo to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Alex Schuster wrote:
>
> David Fanning wrote:
>
>> Kenneth P. Bowman (bowman@null.edu) writes:
>>
>>> I often find myself using WHERE to divide an array into two parts. I do
>>> one operation on the first part and a different operation on the second
>>> part.
>>>
>>> It would be nice to have an auxiliary array containing all the indices
>>> that are *not* returned by WHERE in i. For example, it would be nice to
>>> do
>>>
>>> a = FLTARR(...)
>>> i = WHERE((a...), count, NOT_WHERE = j, NOT_COUNT = not_count)
>>> IF (count GT 0L) THEN a[i] = ...
>>> IF (not_count GT 0L) THEN a[j] = ...
>>>
>>> Lacking the above changes to WHERE, can anyone suggest a fast and easy
>>> way to get j=NOT(i) ?
>
> i = where( a gt something )
> j = where( a le something )
>
> Easy, yes, maybe not too fast, and not very elegant. Martin Schulz wrote
> (and probably posted) the routine INV_INDEX, which I attached.
>
>> Now *here* is a place where Alex's matrix operations will
>> really pay off!
>>
>> I'll leave it to Alex to handle this question. :-)
>
> Hmm, now here I would rather use INV_INDEX instead...
>
> mask = where( a gt something)
> a = (a+1) * mask + (a-5) * (1B-mask)
>

Did you mean:

mask=a gt something

JD

--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: iterating POLY_2D
Next Topic: REQ: alternative plot procedure?

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

Current Time: Fri Oct 10 07:45:48 PDT 2025

Total time taken to generate the page: 1.36025 seconds