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

Home » Public Forums » archive » Re: 3D congrid without interpolation
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: 3D congrid without interpolation [message #53409 is a reply to message #53405] Fri, 13 April 2007 18:00 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Fri, 13 Apr 2007 17:33:53 -0700, David Fanning wrote:

> JD Smith writes:
>
>> How is "nearest neighbor sampling" not interpolation? Does it
>> explicitly avoid knowledge of how the new array cell is positioned
>> w.r.t. the old one, and simply grab averages of nearby neighbors? Why
>> would this ever be preferable to a linear interpolation?
>
> I don't know. I guess it is preferable because it
> doesn't add new numbers to your data. (I never really
> thought about or cared how it was done, but I suppose
> someone ought to.)

Aha, well I guess it really does just pick the nearest neighboring cell,
so it is not interpolation (I presumed it was averaging over neighbors
without weighting).

IDL> a=findgen(5,5)
IDL> print,a
0.00000 1.00000 2.00000 3.00000 4.00000
5.00000 6.00000 7.00000 8.00000 9.00000
10.0000 11.0000 12.0000 13.0000 14.0000
15.0000 16.0000 17.0000 18.0000 19.0000
20.0000 21.0000 22.0000 23.0000 24.0000
IDL> print,congrid(a,4,4)
0.00000 1.00000 2.00000 3.00000
5.00000 6.00000 7.00000 8.00000
10.0000 11.0000 12.0000 13.0000
15.0000 16.0000 17.0000 18.0000
IDL> print,congrid(a,4,4,/INTERP)
0.00000 1.25000 2.50000 3.75000
6.25000 7.50000 8.75000 10.0000
12.5000 13.7500 15.0000 16.2500
18.7500 20.0000 21.2500 22.5000

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Pasting subarray into array with compound assignment
Next Topic: Re: newbie's question for writing files

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

Current Time: Fri Oct 10 01:34:11 PDT 2025

Total time taken to generate the page: 0.48299 seconds