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 #15415 is a reply to message #15336] Thu, 13 May 1999 00:00 Go to previous messageGo to previous message
Struan Gray is currently offline  Struan Gray
Messages: 178
Registered: December 1995
Senior Member
Craig Markwardt, craigmnet@cow.physics.wisc.edu writes:

> As the two posters graciously have demonstrated,
> they were able to partially vectorize the algorithm.
> However, because your procedure involves *overlapping*
> portions of the same array, it will never be
> possible to fully vectorize it.

True, but you can always use the built-in function CONVOL with a
kernal full of ones to do the local-area averaging. My IDL is
installed elsewhere, so I can't check my code, but the following
should give the right idea:

kernal = intarr(3,3)
kernal[*] = 1
squaremean = convol(image*image, kernal, total(kernal))
mean = convol(image, kernal, total(kernal))
standard_dev = sqrt(squaremean - mean*mean)

The nice thing about this method (in addition to running at native
speeds) is that it is easily scaleable to larger kernals, and convol
handles edge effects for you. The downside is that for big images it
can soak up memory, especially if you convert the image to the
next-largest data type in order to side-step data overflow problems.


Struan
[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 19:59:39 PDT 2025

Total time taken to generate the page: 0.80495 seconds