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

Home » Public Forums » archive » Re: where for only one
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: where for only one [message #8854] Tue, 06 May 1997 00:00
Peter Mason is currently offline  Peter Mason
Messages: 145
Registered: June 1996
Senior Member
On Mon, 5 May 1997, R. Bauer wrote:

> Is there a switch for where which will stop the where function after it
> founds the first value belonging to an equation?
> I do not like that's where will look to the end of the data after it
> found the first value.

You could try the MAX() function instead.
Although it will still churn through the whole input array, it will only
return the first index "found". Also, it's probably a bit more memory-
friendly than WHERE().

e.g.,
j=findgen(20)
junk=max(j ge 10.0,indx) ;the expression is just a bytarr of 0s and 1s
help,indx
; INDX LONG = 10
; You could also test for (junk eq 1b) to see that you had at least 1 "hit".


Peter Mason
[Message index]
 
Read Message
Previous Topic: overplotting hatching
Next Topic: Re: own function with equation

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

Current Time: Wed Oct 08 13:41:52 PDT 2025

Total time taken to generate the page: 0.00413 seconds