Re: correct way to use INTERPOLATE function [message #55973 is a reply to message #55972] |
Fri, 21 September 2007 14:16   |
R.G.Stockwell
Messages: 163 Registered: October 2004
|
Senior Member |
|
|
"Ryan." <rchughes@gmail.com> wrote in message
news:1190408773.723336.302670@o80g2000hse.googlegroups.com.. .
>> Is that waht you are trying to do?
>
> Thanks Paolo and David. That's not what I wanted to do but it did
> help me out to produce the plot I want. I want to create a smallarray
> vs. largearray plot but If I just tried to plot it, IDL will do what
> it does best and plot only the first N_ELEMENTS(smallarray) points.
> The code that I did come up with is as follows (It is very close to
> what Paolo had):
>
> l = FINDGEN(100)*0.5
> s = [10.3, 9.6, 9.2, 8.5, 7.7, 6.9, 5.8, 5.4, 4.7, 4.1]
> ns = N_ELEMENTS(s)
> nl = N_ELEMENTS(l)
>
> x = FINDGEN(ns)/(ns-1)
> x2 = FINDGEN(nl)/nl
>
> z = INTERPOL(s, x, x2)
>
> PLOT, z, l, PSYM=-6
Hi Ryan,
I took a quick glance, and for the life of me i can't figure out
what it is that you really want to do. You are plotting the
"l" array here as a function of your "z" (which is
based on your original "s"). I don't think that means
anything.
I assume you have a watered down example of your
original problem, but it just seems like
1) you have it backwards (i.e. you want to plot
> plot l,z
and 2)
you probably shouldn't be doing that in the first place.
My point would be that the elements of "s" should have some
ordinate related to them. Select the proper ordinate to pair with
the "s"es and just plot that.
Or if you need to interpolate, then interpolate both in the exact
same way.
Cheers,
bob
|
|
|