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

Home » Public Forums » archive » Re: REBIN needs explaining
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: REBIN needs explaining [message #41928 is a reply to message #41927] Tue, 30 November 2004 15:56 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Tue, 30 Nov 2004 16:32:03 -0700, David Fanning wrote:

> Hi Folks,
>
> Can someone (Craig?) explain this to me.
>
> Consider:
>
> v = [0, 10]
>
> I understand this:
>
> Print, rebin(v, 20, /Sample)
> 0 0 0 0 0 0 0 0 0
> 0 10 10 10 10 10 10 10 10
> 10 10
>
> What I don't understand is this:
>
> Print, rebin(v, 20)
> 0 1 2 3 4 5 6 7 8
> 9 10 10 10 10 10 10 10 10
> 10 10
>
> Aren't there an awful lot of 10s in there!? Why doesn't this come
> out like this:
>
> 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8
> 9 9 10 10
>
> I notice REBIN, CONGRID, and even CMCONGRID does this same thing. Why?

From the manual:

When expanding an array, REBIN interpolates, it never
extrapolates. Each of the n-1 intervals in the n-element input array
produces m/n interpolates in the m-element output array. The last m/n
points of the result are obtained by duplicating element n-1 of the
input array because their interpolates would lie outside the input
array.

So here it has just 1 interval producing 10 points, and 10 points are
duplicated from the last value. The manual also recommends the
solution:

If this effect is undesirable, use the INTERPOLATE function.

A good question is why they consider the need to avoid extrapolation
by duplicating elements, rather than just interpolating on all
internal intervals. I'm not sure for what problems the current
behavior would be desirable.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: applications guis and licenses
Next Topic: Re: applications guis and licenses

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

Current Time: Sat Oct 11 22:09:58 PDT 2025

Total time taken to generate the page: 1.83911 seconds