Voigt funcion in mpfit [message #94814] |
Wed, 25 October 2017 04:15  |
abc
Messages: 46 Registered: March 2011
|
Member |
|
|
HI, I have set of data of an absorption spectra and I want to fit the voigt profile using mpfit. The function I am using is http://www.heliodocs.com/php/xdoc_print.php?file=$SSW/yohkoh /ucon/idl/metcalf/voigt.pro
But I am getting error as
GDL> res=mpfit('voigt',p0,functargs=fa)
% VOIGT: function VOIGT takes 2 params: 'Result = VOIGT(A,U)'
% Execution halted at: MPFIT_CALL_FUNC_EXTRA 1396 /home/abc/Documents/gdl/pro/pro/mpfit.pro
% MPFIT_CALL 1439 /home/abc/Documents/gdl/pro/pro/mpfit.pro
% MPFIT 3185 /home/abc/Documents/gdl/pro/pro/mpfit.pro
% $MAIN$
Kindly help
|
|
|
|
Re: Voigt funcion in mpfit [message #94818 is a reply to message #94814] |
Wed, 25 October 2017 12:28  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Wednesday, October 25, 2017 at 7:15:59 AM UTC-4, abc wrote:
> HI, I have set of data of an absorption spectra and I want to fit the voigt profile using mpfit. The function I am using is http://www.heliodocs.com/php/xdoc_print.php?file=$SSW/yohkoh /ucon/idl/metcalf/voigt.pro
> But I am getting error as
> GDL> res=mpfit('voigt',p0,functargs=fa)
> % VOIGT: function VOIGT takes 2 params: 'Result = VOIGT(A,U)'
First of all, the VOIGT you linked to is a procedure, not a function. MPFIT only works with functions, not procedures. It tries to call VOIGT() as a function, and it gets the system version. Is that what you want?
Second of all, VOIGT has two inputs. How are those meant to be passed? You don't show it in your example.
Third, where is the data? What you showed is just a bare call to VOIGT. Don't you want to compare the VOIGT function results to some data? MPFIT() by itself wants you to compute the residuals. Or, if you don't want to do that, you can use MPFITFUN instead, but you still need data.
Fourth, what are the parameters? Are you trying to solve for A and V?
Craig
|
|
|