Re: 3-dimensional integration? [IDL 5.4] [message #35533 is a reply to message #35521] |
Tue, 24 June 2003 07:18   |
Ingo Salzmann
Messages: 10 Registered: December 2002
|
Junior Member |
|
|
Thanx! Unfortunately I forgot to mention, that my data points are
irregularely spaced. I would choose the approach to Triangulate [...]
TRIGRID [...] the data and then follow your hint. But ... what is the
relationship between the old irregularely spaced points described by their
(x,y,int) tuples and the new points within the (n,n,int) array? Are these
coordinates normalized?
Thank you!
"Timm Weitkamp" <timm.weitkamp@nowhere.edu> schrieb im Newsbeitrag
news:Pine.LNX.4.44.0306231600060.1635-100000@localhost.local domain...
> 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>
>
|
|
|