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

Home » Public Forums » archive » coherence test implementation
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: coherence test implementation [message #15420 is a reply to message #15336] Thu, 13 May 1999 00:00 Go to previous messageGo to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
(quick, before they wake up in Australia! :-)

Hi again,

Dick Jackson wrote:
>
> You piqued my curiosity, since you're right, there had to be a more
> efficient way! My attached coherence.pro should do the trick, and I
> clock it at about 60 times faster with a 300x300 test.
> [...]
> Generalizing coherence.pro to allow variable 'width' [...]
> wouldn't be hard

I looked at my code again, and realized I was duplicating the function of
the IDL CONVOL routine. That sure simplified things! (and in my 300x300
test, cut time in half yet again) Adding the 'width' idea was trivial. I
think writing helpful comments was the worst part. :-)

And, as with any Good Thing in IDL, it can be written in one line:

coh = Sqrt((Convol(array ^ 2.0, Replicate(1, width, width)) $
- (Convol(Float(array), Replicate(1, width, width))^2 $
/ (width ^ 2))) $
/ ((width ^ 2)-1))

(the attached .pro is much easier to read and understand)

Enjoy.

Cheers,
--
-Dick

Dick Jackson Fanning Software Consulting, Canadian Office
djackson@dfanning.com Calgary, Alberta Voice/Fax: (403) 242-7398
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: divide by zero problems
Next Topic: little and big endian -- once more

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

Current Time: Fri Oct 10 16:49:49 PDT 2025

Total time taken to generate the page: 2.15928 seconds