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

Home » Public Forums » archive » Re: 3-dimensional integration? [IDL 5.4]
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: 3-dimensional integration? [IDL 5.4] [message #35545 is a reply to message #35533] Mon, 23 June 2003 07:04 Go to previous messageGo to previous message
Timm Weitkamp is currently offline  Timm Weitkamp
Messages: 66
Registered: August 2002
Member
Oops! When I just wrote,

> Circular regions take more than one line, but are easily doable too.
> Assume that r is the radius of the circle over which you want to
> integrate (in pixels). Then you should do something like this:
>
> dim = SIZE(data, /DIMENSIONS)
> xarr = findgen(dim[0]) # (1+fltarr(dim[1]))
> yarr = findgen(dim[1]) ## (1+fltarr(dim[0]))
> rarr = SQRT((xarr-x)^2 + (yarr-y)^2)
> idxList = WHERE(rarr LE r, npix)
> IF npix NE 0 THEN tot = TOTAL(data[idxList])

... I hit the "send" key too early. The code above works, but its last two
lines can (and should) be merged into the more elegant

tot = TOTAL( (rarr LE r) * data )

I think this way of directly using a logical expression for indexing,
which in many cases I find very handy, is sometimes ignored by the
worshipers of WHERE.

Timm

--
Timm Weitkamp <http://people.web.psi.ch/weitkamp>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: sec : U Re: Sinc interpolation
Next Topic: Re: How to do nested objects??

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

Current Time: Wed Oct 08 18:59:43 PDT 2025

Total time taken to generate the page: 0.00393 seconds