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 #41924 is a reply to message #41921] Wed, 01 December 2004 00:45 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
David Fanning wrote:
> JD Smith writes:
>
>
>> 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.
>
>
> Well, I *would* use the INTERPOLATE function if I could
> understand it. :-(
>
> The REBIN documentation says this:
>
> *************************************************
> ; A four point vector:
> A = [0, 10, 20, 30]
>
> ; Expand by a factor of 3:
> B = REBIN(A, 12)
>
> PRINT, B
> IDL prints:
>
> 0 3 6 10 13 16 20 23 26 30 30 30
>
> Note that the last element is repeated three times. If this effect is
> undesirable, use the INTERPOLATE function. For example, to produce 12
> equally spaced interpolates from the interval 0 to 30:
>
> B = INTERPOLATE(A, 3./11. * FINDGEN(12))
> PRINT, B
> IDL prints:
>
> 0 2 5 8 10 13 16 19 21 24 27 30
> *************************************************
>
> But,
>
> IDL> Print, 3./11. * FINDGEN(12))
> 0.000000 0.272727 0.545455 0.818182 1.09091
> 1.36364 1.63636 1.90909 2.18182 2.45455 2.72727
> 3.00000
>
> How in the world to *those* numbers, when applied to A, produce
> the result I get? Seems like magic to me. :-(

They say, a picture is worth a thousand words, therefore the
following plot should be able to enlighten the meaning of INTERPOLATE
better than a lengthy explanation...

x=findgen(4)
a=[0.,10,20,30]
z=3./11. * FINDGEN(12)
plot,x,a,psym=-4,xrange=[-0.5,3.5],yrange=[-5,35]
oplot,z,interpolate(a,z),psym=1


Ciao,
Paolo
>
> Cheers,
>
> David
>

--
____________________________________________________________ ________

Paolo Grigis
ETHZ - Institute of Astronomy email: pgrigis@astro.phys.ethz.ch
Scheuchzerstrasse 7
ETH Zentrum phone: ++41 1 632 42 20
8092 Zurich fax : ++41 1 632 12 05
Switzerland http://www.astro.phys.ethz.ch/
____________________________________________________________ ________
[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: Sun Nov 30 01:33:30 PST 2025

Total time taken to generate the page: 0.64366 seconds