DataPipeline/Processing.py
def gaussiansmooth(self, x, y, degree=6):
        """Smooth noisy data with gaussian filter"""

        window=degree*2-1
        weight=np.array([1.0]*window)
        weightGauss=[]
        for i in range(window):
            i=i-degree+1
            frac=i/float(window)
            gauss=1/(np.exp((4*(frac))**2))
            weightGauss.append(gauss)
        weight=np.array(weightGauss)*weight
        smoothed=[0.0]*(len(y)-window)
        for i in range(len(smoothed)):
            smoothed[i]=sum(np.array(y[i:i+window])*weight)/sum(weight)
        #cut x vals so they match y - may introduce some error
        sx = self.getMatchingList(smoothed, x)
        #print d,len(sx), len(smoothed)
        return sx, smoothed
Smooth noisy data with gaussian filter
Smooth noisy data with gaussian filter
Smooth noisy data with gaussian filter
def gaussiansmooth(self, x, y, degree=6):
        window=degree*2-1
        weight=np.array([1.0]*window)
        weightGauss=[]
        for i in range(window):
            i=i-degree+1
            frac=i/float(window)
            gauss=1/(np.exp((4*(frac))**2))
            weightGauss.append(gauss)
        weight=np.array(weightGauss)*weight
        smoothed=[0.0]*(len(y)-window)
        for i in range(len(smoothed)):
            smoothed[i]=sum(np.array(y[i:i+window])*weight)/sum(weight)
        sx = self.getMatchingList(smoothed, x)
        return sx, smoothed
def gaussiansmooth ( self , x , y , degree = 6 ) : window = degree * 2 - 1 weight = np . array ( [ 1.0 ] * window ) weightGauss = [ ] for i in range ( window ) : i = i - degree + 1 frac = i / float ( window ) gauss = 1 / ( np . exp ( ( 4 * ( frac ) ) ** 2 ) ) weightGauss . append ( gauss ) weight = np . array ( weightGauss ) * weight smoothed = [ 0.0 ] * ( len ( y ) - window ) for i in range ( len ( smoothed ) ) : smoothed [ i ] = sum ( np . array ( y [ i : i + window ] ) * weight ) / sum ( weight ) sx = self . getMatchingList ( smoothed , x ) return sx , smoothed
Smooth noisy data with gaussian filter
Smooth noisy data with gaussian filter
"""Smooth noisy data with gaussian filter""" #cut x vals so they match y - may introduce some error #print d,len(sx), len(smoothed)
self
x
y
degree