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

Home » Public Forums » archive » How to use mpfitfun.pro for 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: How to use mpfitfun.pro for fitting? [message #93365 is a reply to message #93364] Mon, 27 June 2016 04:00 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Monday, June 27, 2016 at 6:14:40 AM UTC+1, Meegle_Jade wrote:
> I went through the documentation but I didn't understand it much. Can anyone of you please give me a sample mpfitfun.pro (with the definition of function)?
>
> PS:Infact I am having a set of flux values(measured) for 4 sources at 5 frequency bands. I know the expression of flux and it's a function of 5 parameters.

Hi,
I'm not sure what the problem with the function definition is. In the instructions I found this:
; FUNCTION MYFUNCT, X, P
; ; The independent variable is X
; ; Parameter values are passed in "P"
; YMOD = ... computed model values at X ...
; return, YMOD
; END

And it worked for me. But anyhow, below is an example that works well for me (adapted from something that I use):

function mySineFunction, x, p
return, p[0] + p[1] * sin(x * p[2] /!radeg + p[3])
end

pro doTheFit, angles, xPos
;************* fit x ****************
xSineFit = double(angles)
ySineFit = double(xPos)
yerr = 1
starty = [-800d, 1000d, 1d, -90d]
xResult = mpfitfun('mySineFunction', xSineFit, ySineFit, yerr, startY)
print, xResult
end

I hope this helps.

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How reload (re-import) a modified Python module through the IDL to Python bridge ?
Next Topic: Bug in legend() for horizontal orientations

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

Current Time: Wed Oct 08 13:36:10 PDT 2025

Total time taken to generate the page: 0.00409 seconds