Re: correct way to use INTERPOLATE function [message #55976 is a reply to message #55974] |
Fri, 21 September 2007 13:49   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
pgrigis@gmail.com writes:
> 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?
Ah, interesting. After some playing around with CONGRID
keywords, I discovered that this interpolation method
is virtually identical to this:
nelem = N_Elements(x2)
OPLOT, x2, CONGRID(y, nelem, /INTERP, /MINUS_ONE)
Could be an interesting article in here somewhere. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|