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

Home » Public Forums » archive » Re: Congrid/Rebin Conundrum
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Congrid/Rebin Conundrum [message #55927] Thu, 13 September 2007 07:28
wlandsman is currently offline  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 Go to previous message
David Fanning is currently offline  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 Go to previous message
wlandsman is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Random problem with Delaunay triangulation
Next Topic: Widget Definition from the Event Handler?

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

Current Time: Thu Oct 09 23:16:03 PDT 2025

Total time taken to generate the page: 0.56357 seconds