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

Home » Public Forums » archive » Re: The fastest way to extract some points in million poits data set
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: The fastest way to extract some points in million poits data set [message #46758] Wed, 21 December 2005 03:45
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Park" <snfinder@naver.com> writes:

> HI~ ALL^^,
>
>
> I usually use where function on a lot of situations.
> It gives me easily the indices of array that I want among data set.
>
> BUT, it is a little slow I think.
>
> When I use a where function,
> in my computer, if data have one million points it takes 0.01
> sec(order).
> It makes me depressed because I have to do that step so many times.

"So many" is such a vague concept. Even if you have to do that
operation a million times, it takes just a few hours. That is not too
depressing!

> Is there a faster method to extract the points which satisfy some
> condition
> in points data set(3D)?
> I need the indices of points that satisfy specified conditions.
> (For example, specified conditions: inside the particular cube, inside
> the sphere or etc.)

I think you might want to take a different approach. Rather than
looking for a faster version of WHERE, you should be looking for
better ways to precondition your data.

If you can pre-arrange your array, you may be able to speed up the
individual searches by excluding some parts of phase space. For
example, perhaps you can sort the array by one coordinate. Then you
can restrict your search to only those points that have the right
initial coordinate value. This can be made even faster if you pre-bin
the data with HISTOGRAM and use the REVERSE_INDICES keyword. If that
is not enough, the same approach can be expanded with some difficulty
to multiple dimensions.

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: The fastest way to extract some points in million poits data set [message #46762 is a reply to message #46758] Tue, 20 December 2005 05:49 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Park writes:

> When I use a where function,
> in my computer, if data have one million points it takes 0.01
> sec(order).
> It makes me depressed because I have to do that step so many times.

I'd try Zoloft. It won't speed the calculation up, but
you will certainly feel better about it. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: PLOTting into a 2-D array
Next Topic: Re: Compress array??

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

Current Time: Fri Oct 10 23:19:25 PDT 2025

Total time taken to generate the page: 0.39859 seconds