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

Home » Public Forums » archive » Re: Center of mess
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: Center of mess [message #35982 is a reply to message #35980] Tue, 05 August 2003 02:43 Go to previous messageGo to previous message
Thomas Launey is currently offline  Thomas Launey
Messages: 25
Registered: September 1999
Junior Member
In article <onwudshe4a.fsf@cow.physics.wisc.edu>,
craigmnet@cow.physics.wisc.edu says...

>
> Hmm, the problem is that you are assigning pixel values with DINDGEN,
> which by default will assign 0.0 to pixel 0, 1.0 to pixel 1, and so
> on. You should add 0.5 to your pixel values, if you intend that the
> left edge of the pixel is 0.0, the right edge is 1.0, and the center
> is 0.5, etc.
>
> Y=Total(total(array,1,/double)*(dindgen(sizarr[1]) + 0.5))/totalarr
>
> and so on.
>
> Good luck,
>
> Craig
>
Actually, my solution was to add 0.5D to the returned X and Y. Still, I
am concerned that this procedure (without the "+0.5") seems to be quite
widespread in the IDL community to find centroid. Am I misunderstanding
the meaning of the returned values or is it a bug in the procedure ?
Thanks,
Thomas
--
Thomas LAUNEY
Lab. Memory and Learning, RIKEN BSI
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDL 6 is available on RSI ftp site
Next Topic: Problems with MPEG

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

Current Time: Wed Oct 08 19:35:02 PDT 2025

Total time taken to generate the page: 0.00491 seconds