def __init__(self, x, y): self.xFile = [] self.yFile = '{}'.format(y[0]) self.length = 0 self.volume = 0 self.peak = [] self.filterSignal = [] i = 0 while i < len(x): self.xFile.append('{}'.format(x[i])) i += 1 self.title = '{}'.format(namespace.title) self.output = '{}'.format(namespace.output) self.dataoutput = '{}'.format(namespace.dataoutput) self.dataStressFile = '{}'.format(namespace.dataStressFile) self.dataDir = '{}'.format(namespace.dataDir) self.distanceDump = '{}'.format(namespace.distanceDump) self.distanceStat = '{}'.format(namespace.distanceStat) self.xlabel = '{}'.format(namespace.xlabel) self.ylabel = '{}'.format(namespace.ylabel) self.l1 = '{}'.format(namespace.l1) self.l2 = '{}'.format(namespace.l2) self.l3 = '{}'.format(namespace.l3) self.time = np.array(getColumn(self.yFile, 0)).astype(float) * 0.001 self.sxx = np.array(getColumn(self.yFile, 1)).astype(float) self.syy = np.array(getColumn(self.yFile, 2)).astype(float) self.szz = np.array(getColumn(self.yFile, 3)).astype(float) if namespace.toforce: self.sxx *= np.pi / 100 self.syy *= np.pi / 100 self.szz *= np.pi / 100 self.computeDist() self.sxx /= self.volume self.syy /= self.volume self.szz /= self.volume if namespace.sumfilter: self.filterSignal = noiseFilter(self.syy, 5, 75) if namespace.plotpeaks: self.peakDetect(self.filterSignal, 12000, 40, 150, 5950) if namespace.writedata: self.writeToFile() if namespace.stdout and namespace.plotpeaks: self.stdOut() if namespace.dataStressFile: self.writeStressFile() self.computeDistAnalizeAtoms()
def noiseFilterPlot(time, s): v = noiseFilter(s, 5, 100) plt.plot(time, v, 'k') # plt.plot(time[imax], vmax, 'c.', label=' %.2f' % (vmax)) return v
def noiseFilterPlot(xs,s): v = noiseFilter(s,5,80) vavg = np.mean(v[ 0:( len(v) / 6 ) ]) plt.plot(xs,v,'k', label=' %.2f'%(vavg))