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

Home » Public Forums » archive » Fitting curve to data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Fitting curve to data [message #93631] Wed, 14 September 2016 07:23 Go to previous message
liam.steele is currently offline  liam.steele
Messages: 13
Registered: September 2015
Junior Member
Hi all,

I am trying to it a curve to some data points, and have managed to get confused with all the interpolate and spline IDL routines (and more importantly, can't seem to get any of them to work).

As an example, I have a range of depths (in cm) and a value of something at each depth, e.g.

depth = [0.01, 0.1, 0.4, 0.9, 3.5, 14.5, 57.9, 231.7, 926.8]
value = [2.1, 2.1, 1.9, 1.8, 1.3, 1.0, 0.8, 0.5, 0.4]

What I want to do is fit a curve to the data as best I can (the curve doesn't have to go through each point exactly), on a finer set of depths, e.g.

interp_depth = findgen(1001)

I've tried things like:

interp_val = spline(value,depth,interp_depth)
interp_val = interpol(value,depth,interp_depth,/spline)

Can anyone offer any help? Is there some sort of cubic least-squares routine or something I should use? I can get linear interpolation to work, but was wanting something more 'realistic'.

Cheers!
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Problem with classification
Next Topic: IDL structure problem

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

Current Time: Wed Oct 08 13:59:11 PDT 2025

Total time taken to generate the page: 0.00414 seconds