pKaTool/titration_class.py
def experimental_uncertainty(self, pH_uncertainty=0.1):
        """estimates the experimental uncertainty of titration curves"""
        res=0.0
        count = 0
        for group in self.curves.keys():
            #print 'Now estimating for ',group
            pHs = self.curves[group].keys()
            #make sure that ph values are sorted
            pHs.sort()
            for i in range(len(pHs)):
                bw_diff = 0
                fw_diff = 0
                try:
                    bw_diff = (self.curves[group][pHs[i]]-self.curves[group][pHs[i-1]])/(pHs[i]-pHs[i-1])
                except:
                    pass
                try:
                    fw_diff = (self.curves[group][pHs[i+1]]-self.curves[group][pHs[i]])/(pHs[i+1]-pHs[i])
                except:
                    pass

                avr_diff = (bw_diff+fw_diff)/2 ##### abs()?
                res += avr_diff
                count += 1
        res *= pH_uncertainty
        res = abs(res)
        avr_res = res / float(count)
        return res, avr_res
estimates the experimental uncertainty of titration curves
estimates the experimental uncertainty of titration curves
estimates the experimental uncertainty of titration curves
def experimental_uncertainty(self, pH_uncertainty=0.1):
        res=0.0
        count = 0
        for group in self.curves.keys():
            pHs = self.curves[group].keys()
            pHs.sort()
            for i in range(len(pHs)):
                bw_diff = 0
                fw_diff = 0
                try:
                    bw_diff = (self.curves[group][pHs[i]]-self.curves[group][pHs[i-1]])/(pHs[i]-pHs[i-1])
                except:
                    pass
                try:
                    fw_diff = (self.curves[group][pHs[i+1]]-self.curves[group][pHs[i]])/(pHs[i+1]-pHs[i])
                except:
                    pass
                avr_diff = (bw_diff+fw_diff)/2 
                res += avr_diff
                count += 1
        res *= pH_uncertainty
        res = abs(res)
        avr_res = res / float(count)
        return res, avr_res
def experimental_uncertainty ( self , pH_uncertainty = 0.1 ) : res = 0.0 count = 0 for group in self . curves . keys ( ) : pHs = self . curves [ group ] . keys ( ) pHs . sort ( ) for i in range ( len ( pHs ) ) : bw_diff = 0 fw_diff = 0 try : bw_diff = ( self . curves [ group ] [ pHs [ i ] ] - self . curves [ group ] [ pHs [ i - 1 ] ] ) / ( pHs [ i ] - pHs [ i - 1 ] ) except : pass try : fw_diff = ( self . curves [ group ] [ pHs [ i + 1 ] ] - self . curves [ group ] [ pHs [ i ] ] ) / ( pHs [ i + 1 ] - pHs [ i ] ) except : pass avr_diff = ( bw_diff + fw_diff ) / 2 res += avr_diff count += 1 res *= pH_uncertainty res = abs ( res ) avr_res = res / float ( count ) return res , avr_res
estimates the experimental uncertainty of titration curves
estimates the experimental uncertainty of titration curves
"""estimates the experimental uncertainty of titration curves""" #print 'Now estimating for ',group #make sure that ph values are sorted ##### abs()?
self
pH_uncertainty