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

Home » Public Forums » archive » Re: Maximum radius of SEARCH2D/SEARCH3D
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: Maximum radius of SEARCH2D/SEARCH3D [message #34729 is a reply to message #34728] Mon, 14 April 2003 13:56 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Alexander Gro� (AlexanderGross_NOSPAM@gmx.de) writes:

> thank you very much. It's working good. For the distance caluculation I used
> a for loop. I did not implement the square root function for distance
> calculation since this costs CPU time. I raised the allowed maximum radius
> to the power of two and compare it to the computed distance each time.
>
> Only for my understanding: Is is possible to do this without the "evil" for
> loop? Is there another way to tell IDL that the operation has to be done for
> each element of the subscripts array?

For the 2D case, I was envisioning something like this:

indices = Search2d(array, x, y)
s = Size(array, /Dimensions)
cols = indices MOD s[0]
rows = indices / s[0]
radius = Sqrt( (cols - x)^2 + (rows - y)^2)
goodPixels = Where(radius LT myCircleRadius)
cols = cols[goodPixels]
rows = rows[goodPixels]

> Thank you very much for sharing your deep insight of IDL. :-)

I think you have me confused with JD. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Image Plots
Next Topic: Re: Image Plots

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

Current Time: Sat Oct 11 23:19:15 PDT 2025

Total time taken to generate the page: 0.63393 seconds