PEATDB/plugins/KineticsAnalysis.py
def checkLinearFit(self, E, d, cutoff, fromstart=True, percs=None):
        """Check linear fit for raw abs data to get best fit.
            1. get best fit from 0.7, 0.5, 0.3 removed from end
            2. compare with original and pick the best fit
           We then return a flag stating if this point is to be used in the
           using percent sumsqdiff vals"""

        edata = E.data[d]
        ekd = EkinDataset(edata)
        currfit = E.getFitData(d)
        if currfit == None or len(currfit) == 0:
            return 0
        expdata = Fitting.getExpData(edata)
        X = Fitting.makeFitter(currfit, expdata=expdata)
        try:
            currsqdiff = X.getpercSqDiff()
        except:
            return 0
        currslope = X.getFitDict()['a']

        #remove different successive perc from end
        if fromstart==True:
            '''remove different successive perc from start'''
            newdata, newfit, X = self.fitportion(edata, currfit, percs=percs, X=X)
            newslope = X.getFitDict()['a']
            newsqdiff = X.getpercSqDiff()
            if newsqdiff <= currsqdiff and newslope > 0:
                E.data[d] = newdata
                E.setFitData(d, newfit)
                currsqdiff = newsqdiff
        else:
            newdata, newfit, X = self.fitportion(edata, currfit, percs=percs, X=X)
            newslope = X.getFitDict()['a']
            newsqdiff = X.getpercSqDiff()
            if newsqdiff <= currsqdiff and newslope > 0:
                E.data[d] = newdata
                E.setFitData(d, newfit)
                currsqdiff = newsqdiff

        #print 'perc fit error on point %s: %s' % (d, currsqdiff)
        if currsqdiff > cutoff:
            print 'sumsqdiff %s too high, exclude?' % currsqdiff
            return 0
        else:
            return 1
Check linear fit for raw abs data to get best fit.
            1. get best fit from 0.7, 0.5, 0.3 removed from end
            2. compare with original and pick the best fit
           We then return a flag stating if this point is to be used in the
           using percent sumsqdiff vals
Check linear fit for raw abs data to get best fit.
1.
Check linear fit for raw abs data to get best fit . 1 .
def checkLinearFit(self, E, d, cutoff, fromstart=True, percs=None):
        edata = E.data[d]
        ekd = EkinDataset(edata)
        currfit = E.getFitData(d)
        if currfit == None or len(currfit) == 0:
            return 0
        expdata = Fitting.getExpData(edata)
        X = Fitting.makeFitter(currfit, expdata=expdata)
        try:
            currsqdiff = X.getpercSqDiff()
        except:
            return 0
        currslope = X.getFitDict()['a']
        if fromstart==True:
            newdata, newfit, X = self.fitportion(edata, currfit, percs=percs, X=X)
            newslope = X.getFitDict()['a']
            newsqdiff = X.getpercSqDiff()
            if newsqdiff <= currsqdiff and newslope > 0:
                E.data[d] = newdata
                E.setFitData(d, newfit)
                currsqdiff = newsqdiff
        else:
            newdata, newfit, X = self.fitportion(edata, currfit, percs=percs, X=X)
            newslope = X.getFitDict()['a']
            newsqdiff = X.getpercSqDiff()
            if newsqdiff <= currsqdiff and newslope > 0:
                E.data[d] = newdata
                E.setFitData(d, newfit)
                currsqdiff = newsqdiff
        if currsqdiff > cutoff:
            print 'sumsqdiff %s too high, exclude?' % currsqdiff
            return 0
        else:
            return 1
def checkLinearFit ( self , E , d , cutoff , fromstart = True , percs = None ) : edata = E . data [ d ] ekd = EkinDataset ( edata ) currfit = E . getFitData ( d ) if currfit == None or len ( currfit ) == 0 : return 0 expdata = Fitting . getExpData ( edata ) X = Fitting . makeFitter ( currfit , expdata = expdata ) try : currsqdiff = X . getpercSqDiff ( ) except : return 0 currslope = X . getFitDict ( ) [ 'a' ] if fromstart == True : '''remove different successive perc from start''' newdata , newfit , X = self . fitportion ( edata , currfit , percs = percs , X = X ) newslope = X . getFitDict ( ) [ 'a' ] newsqdiff = X . getpercSqDiff ( ) if newsqdiff <= currsqdiff and newslope > 0 : E . data [ d ] = newdata E . setFitData ( d , newfit ) currsqdiff = newsqdiff else : newdata , newfit , X = self . fitportion ( edata , currfit , percs = percs , X = X ) newslope = X . getFitDict ( ) [ 'a' ] newsqdiff = X . getpercSqDiff ( ) if newsqdiff <= currsqdiff and newslope > 0 : E . data [ d ] = newdata E . setFitData ( d , newfit ) currsqdiff = newsqdiff if currsqdiff > cutoff : print 'sumsqdiff %s too high, exclude?' % currsqdiff return 0 else : return 1
Check linear fit for raw abs data to get best fit.
Check linear fit for raw abs data to get best fit .
"""Check linear fit for raw abs data to get best fit.
            1. get best fit from 0.7, 0.5, 0.3 removed from end
            2. compare with original and pick the best fit
           We then return a flag stating if this point is to be used in the
           using percent sumsqdiff vals""" #remove different successive perc from end '''remove different successive perc from start''' #print 'perc fit error on point %s: %s' % (d, currsqdiff)
self
E
d
cutoff
fromstart
percs