On Apr 8, 2:15 pm, Vince Hradil <hrad...@[EMAIL PROTECTED]
> wrote:
> On Apr 8, 3:04 am, smas...@[EMAIL PROTECTED]
wrote:
>
> > Hi,
>
> > I want to find the first non-zero value of an array. Is there a faster
> > way to do this than with the "where" command: (where(array ne 0))[0]
> > "Where" will look for all non-zero values and I only need the first
> > one. It would be great if I could stop "where" in its search process
> > as soon as it found one element...
>
> > sebastien
>
> Wow - I'd be interested in knowing how slow 'where' is. Are we
> talking the difference between 0.01 seconds and 0.05 seconds? Or even
> the difference between 1 and 5 seconds? Time is money, but at what
> point does our 'need for speed' end?
You make a good point, Vince.
If anyone can find an array that IDL actually searches faster using my
Histogram-and-small-Where setup than by using "Where" on its own, let
me know! :-)
Chris


|