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

Home » Public Forums » archive » cubic spline fitting
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: cubic spline fitting [message #89708 is a reply to message #89685] Tue, 18 November 2014 20:22 Go to previous message
iansmith@bigpond.net. is currently offline  iansmith@bigpond.net.
Messages: 4
Registered: October 2014
Junior Member
Thank you for your help. I can report that your suggested approach works even where the Y variable in the SPL_INIT procedure is an array of discrete values and not a function of X





On Friday, November 14, 2014 1:51:01 PM UTC+11, wlandsman wrote:
> The documentation gives an example of how to call spl_init and spl_interp
>
> X = (FINDGEN(21)/20.0) * 2.0 * !PI
> Y = SIN(X)
> ; Calculate interpolating cubic spline:
> Y2 = SPL_INIT(X, Y)
> ; Define the X values P at which we desire interpolated Y values:
> X2= FINDGEN(11)/11.0 * !PI
> ; Calculate the interpolated Y values corresponding to X2[i]:
> result = SPL_INTERP(X, Y, Y2, X2)
> PRINT, result
>
> Note that
> (1) there is no comma prior to the parentheses
> (2) one must set the output equal to a variable e.g. Y = SPL_INTERP(X,Y,Y2,X2)
>
> The confusion may be due to the fact that IDL has both procedure calls and function calls, with quite different syntax.
>
>
> On Thursday, November 13, 2014 9:18:36 PM UTC-5, ian....@mq.edu.au wrote:
>> I am trying to use the IDL routines
>>
>> spl_init and spl_interp
>>
>> to do a cubic spline fit to variables that are vectors with 45 elements.
>> ie y is not a function of x.
>>
>> I am getting 2 compilation errors where it seems to be objecting to using a vector for y instead of y being a function of x.
>>
>> IDL> .compile -v 'C:\Ian_Plots\complines 27102014 FYZ Clumps SiO 2-1 and 5-4 Peak Tbs dV30.pro'
>> % Compiled module: LOAD_MOLDATA.
>>
>> spl_init,(x_nH_5,y_Tb13N_5,double)
>> ^
>> % Syntax error.
>> At: C:\Ian_Plots\complines 27102014 FYZ Clumps SiO 2-1 and 5-4 Peak Tbs dV30.pro, Line 476
>>
>> spl_interp,(x_nH_5,y_Tb13N_5,x2_nH_5,y2_13N_5,double)
>> ^
>> % Syntax error.
>> At: C:\Ian_Plots\complines 27102014 FYZ Clumps SiO 2-1 and 5-4 Peak Tbs dV30.pro, Line 481
>> % 2 Compilation error(s) in module $MAIN$.
>>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: CGHISTOPLOT - How to make inward X-axis tick marks?
Next Topic: N3 (authomatic correction of intensity in MRI data)

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

Current Time: Wed Oct 08 17:31:03 PDT 2025

Total time taken to generate the page: 0.00478 seconds