| Re: Adding elements in an Array [message #85990 is a reply to message #85989] |
Mon, 23 September 2013 13:44  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
wlandsman writes:
> I use this property of REBIN() all the time because astronomers are often interested in preserving the surface flux when resizing images. And one can do a quick test by resizing to one element.
>
> IDL> print,rebin([2.5,3.2,3.6,9.99],1)
> 4.82250
> IDL> print,mean([2.5,3.2,3.6,9.99])
> 4.82250
I hope you document this code heavily. I don't think a casual reader
will catch this "feature" without some help. I was thinking of Congrid,
because I use that more frequently than Rebin, but "averaging when
minifying" as the default behavior! That's scary to me. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|