PEATDB/Ekin/Ekin_main.py
def doFit(self):
        """Fit the currently loaded dataset and update plotter"""
        self.stopfit=False
        currfitdata = self.fitdata
        model = self.model_type.get()
        if self.guess_converg_diff.get() == 1:
            conv = None
        else:
            conv = self.converg_diff.get()
        grad = self.grad_crit.get()
        noiter = self.no_iter.get()
        guess = self.guess_startparms.get()
        damper = self.LM_damper.get()

        def updatenow(diff, vrs, fitvals, c, X):
            """callback for fit update"""
            fdata=Fitting.makeFitData(model, vrs, diff) #get ekin fitdata from vars
            self.update(fitdata=fdata, startvars=False, X=X)
            self.update_idletasks()
            self.plotter.updateFit(X)
            self.count.set(c)
            self.count_win.update()
            if self.stopfit == True:
                X.stop_fit=1
            return

        self.plotter.plotCurrent()  #update plot first, just in case
        self.showStopFitFrame(self)

        changevars=[]
        startvals=[]
        for i in self.fvars:
            changevars.append(i[0].get())
            startvals.append(i[2].get())

        fitresult, X = Fitting.doFit(self.data, model=model,
                                    noiter=noiter, conv=conv, grad=grad, LM_damper=damper,
                                    guess=guess,
                                    silent=False, callback=updatenow,
                                    changevars=changevars,
                                    startvalues=startvals)

        if fitresult == None:
            self.stopFit()
            return

        #send new fit to current ekin dataset
        self.parentapp.updateFittedData(self.fitdata)
        #update fitting frame when finished fit?
        self.stopFit()
        return
Fit the currently loaded dataset and update plotter
Fit the currently loaded dataset and update plotter
Fit the currently loaded dataset and update plotter
def doFit(self):
        self.stopfit=False
        currfitdata = self.fitdata
        model = self.model_type.get()
        if self.guess_converg_diff.get() == 1:
            conv = None
        else:
            conv = self.converg_diff.get()
        grad = self.grad_crit.get()
        noiter = self.no_iter.get()
        guess = self.guess_startparms.get()
        damper = self.LM_damper.get()
        def updatenow(diff, vrs, fitvals, c, X):
            fdata=Fitting.makeFitData(model, vrs, diff) 
            self.update(fitdata=fdata, startvars=False, X=X)
            self.update_idletasks()
            self.plotter.updateFit(X)
            self.count.set(c)
            self.count_win.update()
            if self.stopfit == True:
                X.stop_fit=1
            return
        self.plotter.plotCurrent()  
        self.showStopFitFrame(self)
        changevars=[]
        startvals=[]
        for i in self.fvars:
            changevars.append(i[0].get())
            startvals.append(i[2].get())
        fitresult, X = Fitting.doFit(self.data, model=model,
                                    noiter=noiter, conv=conv, grad=grad, LM_damper=damper,
                                    guess=guess,
                                    silent=False, callback=updatenow,
                                    changevars=changevars,
                                    startvalues=startvals)
        if fitresult == None:
            self.stopFit()
            return
        self.parentapp.updateFittedData(self.fitdata)
        self.stopFit()
        return
def doFit ( self ) : self . stopfit = False currfitdata = self . fitdata model = self . model_type . get ( ) if self . guess_converg_diff . get ( ) == 1 : conv = None else : conv = self . converg_diff . get ( ) grad = self . grad_crit . get ( ) noiter = self . no_iter . get ( ) guess = self . guess_startparms . get ( ) damper = self . LM_damper . get ( ) def updatenow ( diff , vrs , fitvals , c , X ) : """callback for fit update""" fdata = Fitting . makeFitData ( model , vrs , diff ) self . update ( fitdata = fdata , startvars = False , X = X ) self . update_idletasks ( ) self . plotter . updateFit ( X ) self . count . set ( c ) self . count_win . update ( ) if self . stopfit == True : X . stop_fit = 1 return self . plotter . plotCurrent ( ) self . showStopFitFrame ( self ) changevars = [ ] startvals = [ ] for i in self . fvars : changevars . append ( i [ 0 ] . get ( ) ) startvals . append ( i [ 2 ] . get ( ) ) fitresult , X = Fitting . doFit ( self . data , model = model , noiter = noiter , conv = conv , grad = grad , LM_damper = damper , guess = guess , silent = False , callback = updatenow , changevars = changevars , startvalues = startvals ) if fitresult == None : self . stopFit ( ) return self . parentapp . updateFittedData ( self . fitdata ) self . stopFit ( ) return
Fit the currently loaded dataset and update plotter
Fit the currently loaded dataset and update plotter
"""Fit the currently loaded dataset and update plotter""" """callback for fit update""" #get ekin fitdata from vars #update plot first, just in case #send new fit to current ekin dataset #update fitting frame when finished fit?
self