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

Home » Public Forums » archive » Re: correct way to use INTERPOLATE function
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: correct way to use INTERPOLATE function [message #55977 is a reply to message #55976] Fri, 21 September 2007 13:26 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
Ryan. wrote:
>> PLOT, Congrid(smallarray, N_Elements(largearray)), largearray
>
> If I do that I get the same result:
> PLOT, CONGRID(smallarray, N_ELEMENTS(largearray), 1, 1) <- With our
> without the INTERP keyword
>
> I want to *stretch* the small array so that it has the same number of
> elements as the large one so I can plot it and all the new points to
> be interpolated linearly between each point. Evenly spaced points is
> fine for my purposes.

For that purpose, you can also use INTERPOL (rather than INTERPOLATE).
Here's an example:

x=findgen(6)/5
y=[0.,2,2,5,6,10]

;first data set
plot,x,y,psym=-6

x2=findgen(100)/100
z=interpol(y,x,x2)
;the z array is interpolated linearly from the point in y

oplot,x2,z,psym=-4

Is that waht you are trying to do?

Cheers,
Paolo

PS: switching to google groups as it turns out newsgroup server
are not supported at my new institution... at least the RSS feed
can be shown in thunderbird in such a way as to look kind of
similar as it should when using a real newsgroup server... but
I am wondering whether there is a way of using a fixed size font
in the google groups "post message" interface...


>
> Ryan.
[Message index]
 
Read Message
Read Message
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: News server
Next Topic: 'object' in IDL terminalogy

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

Current Time: Sun Oct 12 04:44:57 PDT 2025

Total time taken to generate the page: 1.36349 seconds