def draw(self): self.figure.clf() #clear the figure self.FFTPlot = self.figure.add_subplot(111) #if len(self.FFTPlot.lines)>0: # for i in range(0,len(self.FFTPlot.lines)): # del self.FFTPlot.lines[0] #self.FFTPlot.cla() #print len(self.FFTPlot.lines) #smooth and window the data self.DeltaFreqY = 1/self.delta_inv_x #padd the data pad_mult = 10 zero_matrixY = np.zeros(len(self.Y)*pad_mult/2) self.pad_wind_dataY = np.append(self.Y, zero_matrixY) # pad_wind_data = np.append(zero_matrix, pad_wind_data) self.FreqY, self.FFT_SignalY = dHvA_Util.take_fft(self.pad_wind_dataY, 20, self.DeltaFreqY) self.FFTPlot.plot(self.FreqY,self.FFT_SignalY,linewidth=2,color='blue',picker=10) self.FFTPlot.set_xlabel('dHvA Frequency (T)') self.FFTPlot.set_ylabel('Amplitude (a.u.)') self.FFTPlot.set_title('FFT') self.FFTPlot.grid(True) self.FFTPlot.relim() self.FFTPlot.set_xlim([0,10000]) #self.FFTPlot.set_ylim([0,0.5]) self.FFTPlot.autoscale(True,axis='y') #add cursor to select points self.cursor = Cursor(self.FFTPlot,color='black',linewidth=1)
def draw(self): self.figure.clf() #clear the figure self.FFTPlot = self.figure.add_subplot(111) #if len(self.FFTPlot.lines)>0: # for i in range(0,len(self.FFTPlot.lines)): # del self.FFTPlot.lines[0] #self.FFTPlot.cla() #print len(self.FFTPlot.lines) #smooth and window the data self.DeltaFreqY = 1 / self.delta_inv_x #padd the data pad_mult = 10 zero_matrixY = np.zeros(len(self.Y) * pad_mult / 2) self.pad_wind_dataY = np.append(self.Y, zero_matrixY) # pad_wind_data = np.append(zero_matrix, pad_wind_data) self.FreqY, self.FFT_SignalY = dHvA_Util.take_fft( self.pad_wind_dataY, 20, self.DeltaFreqY) self.FFTPlot.plot(self.FreqY, self.FFT_SignalY, linewidth=2, color='blue', picker=10) self.FFTPlot.set_xlabel('dHvA Frequency (T)') self.FFTPlot.set_ylabel('Amplitude (a.u.)') self.FFTPlot.set_title('FFT') self.FFTPlot.grid(True) self.FFTPlot.relim() self.FFTPlot.set_xlim([0, 10000]) #self.FFTPlot.set_ylim([0,0.5]) self.FFTPlot.autoscale(True, axis='y') #add cursor to select points self.cursor = Cursor(self.FFTPlot, color='black', linewidth=1)
def draw(self): self.FFTPlot = self.figure.add_subplot(111) if len(self.FFTPlot.lines)>0: del self.FFTPlot.lines[0] #smooth and window the data self.DeltaFreqY = 1/self.delta_inv_x #padd the data pad_mult = 10 zero_matrixY = np.zeros(len(self.Y)*pad_mult/2) self.pad_wind_dataY = np.append(self.Y, zero_matrixY) # pad_wind_data = np.append(zero_matrix, pad_wind_data) self.FreqY, self.FFT_SignalY = dHvA_Util.take_fft(self.pad_wind_dataY, 20, self.DeltaFreqY) self.FFTPlot.plot(self.FreqY,self.FFT_SignalY,linewidth=2,color='blue') self.FFTPlot.set_xlabel('dHvA Frequency (1/T)') self.FFTPlot.set_ylabel('Amplitude (a.u.)') self.FFTPlot.set_title('FFT') self.FFTPlot.relim() self.FFTPlot.autoscale(True)