[proFit-list] Repetitive fit using pro Fit 6.2.2

Christian Sommerhoff sommerhoff at med.uni-muenchen.de
Fri Feb 4 09:44:07 CST 2011


Dear pro Fit Team,

thanks for the new version of pro Fit and particularly for the inclusion of Python - a great new feature!

I am trying to repeat fitting over a range of columns, i.e. x-values are stored in col 2 and y-values in col 3-n. The loop works nicely, the output verifies that different y columns are used.  BUT the parameters obtained are always identical, i.e. the fit is done only once... 

What am I missing here?


A second problem occurs if I now mask data in col 1 ( i.e. a column not used for fitting), which generates the error msg
Python exception: There is no data to fit.
Traceback (most recent call last):
  File "Test_python.func", line 10, in <module>

Thanks in advance,
Christian

==> Python script
# test repetitive fit over columns

for i in range(3, 5):
    if not  pf.ColEmpty(i):
        pf.SetDefaultCols(2,i,0,0)	
        fitObj = pf.FitCreate(function = 'Exp')
        pf.FitSetArguments(fitObject = fitObj, algorithm = pf.robust , printResults = True, onlyActiveParameters = False, fullDescription = True)
        pf.FitSetExperiment(fitObject = fitObj, window =  pf.GetCurrentWindow(pf.dataType) )
        fitResultObj = pf.FitExecute(fitObject = fitObj)
        n = pf.FitResult(fitResultObject = fitResultObj, result = pf.nrFittedParameters)
        print 'Number of parameters fitted:', n 
        pf.FitResultDispose(fitResultObject = fitResultObj)
        pf.FitDispose(fitObject = fitObj)


==> output
===========================================
Fit Algorithm:	Robust

Function  :	Exp
 Descr 1  :	y = A * exp(-(x-x0)/t0)  + const
 Descr 2  :	exponential function

Data      :	Untitled Data 1

output    :	y
 y  column:	Column 3
 ∆y value :	0.0
 ∆y distr.:	Gaussian

input     :	x
 x  column:	Column 2
 ∆x value :	0.0
 ∆x distr.:	Gaussian


Iterations:	193
-------------------------------------------
Chi squared       	=	271.5419

Parameters:
A    	=	90.0053
x0   	=	 0.0000
t0   	=	 0.2342
const	=	 6.5197

Number of parameters fitted: 4.0

===========================================
Fit Algorithm:	Robust

Function  :	Exp
 Descr 1  :	y = A * exp(-(x-x0)/t0)  + const
 Descr 2  :	exponential function

Data      :	Untitled Data 1

output    :	y
 y  column:	Column 4
 ∆y value :	0.0
 ∆y distr.:	Gaussian

input     :	x
 x  column:	Column 2
 ∆x value :	0.0
 ∆x distr.:	Gaussian


Iterations:	193
-------------------------------------------
Chi squared       	=	271.5419

Parameters:
A    	=	90.0053
x0   	=	 0.0000
t0   	=	 0.2342
const	=	 6.5197

Number of parameters fitted: 4.0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://quantum-soft.com/pipermail/profit-list_quantum-soft.com/attachments/20110204/f41c08f3/attachment.html>


More information about the proFit-list mailing list