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 #41927 is a reply to message #41926] Tue, 30 November 2004 16:53 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[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 Oct 12 00:33:34 PDT 2025

Total time taken to generate the page: 1.20165 seconds