Re: Congrid/Rebin Conundrum [message #55927] |
Thu, 13 September 2007 07:28 |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Sep 13, 9:57 am, David Fanning <n...@dfanning.com> wrote:
> wlandsman writes:
>> So CONGRID is always just resampling your 4 x 4 array to a 1 x 1
>> array, so it just takes the value of data[0,0]. --Wayne
>
> OK, suppose I buy that. Then what is REBIN doing?
>
REBIN is averaging as your example shows. So I am making a
distinction between interpolation (finding a value at a point by using
values at neighboring points) and averaging. In general, CONGRID
is for interpolation (including nearest neighbor) whereas REBIN is for
averaging (though it does use interpolation for expansion).
I should mention frebin.pro (http://idlastro.gsfc.nasa.gov/ftp/pro/
image/frebin.pro ) which averages using partial pixels and thus,
unlike REBIN, can shrink or expand to any size. --Wayne
|
|
|
Re: Congrid/Rebin Conundrum [message #55928 is a reply to message #55927] |
Thu, 13 September 2007 06:57  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
wlandsman writes:
> Well, first of all CONGRID ignores the /INTERP and CUBIC keywords when
> shrinking an array. (There is no straightforward way to interpolate
> when shrinking an image. Think about it for a while.)
>
> So CONGRID is always just resampling your 4 x 4 array to a 1 x 1
> array, so it just takes the value of data[0,0]. --Wayne
OK, suppose I buy that. Then what is REBIN doing?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Congrid/Rebin Conundrum [message #55929 is a reply to message #55928] |
Thu, 13 September 2007 06:48  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Sep 13, 9:11 am, David Fanning <n...@dfanning.com> wrote:
> Hi Folks,
>
> How do you explain these results?
>
Well, first of all CONGRID ignores the /INTERP and CUBIC keywords when
shrinking an array. (There is no straightforward way to interpolate
when shrinking an image. Think about it for a while.)
So CONGRID is always just resampling your 4 x 4 array to a 1 x 1
array, so it just takes the value of data[0,0]. --Wayne
|
|
|