def generateCorrelations(self,doDetrend=True): # auto correlation corefficient of u if doDetrend: ux=signal.detrend(self.ux()); uy=signal.detrend(self.uy()); uz=signal.detrend(self.uz()); umag=signal.detrend(self.Umag()); else: ux=self.ux(); uy=self.uy(); uz=self.uz(); umag=self.Umag(); #ux=ux[-samples:-1] #uy=uy[-samples:-1] #uz=uz[-samples:-1] self.data['r11'],self.data['taur11'] = tt.xcorr_fft(ux, maxlags=None, norm='coeff') self.data['r22'],self.data['taur22'] = tt.xcorr_fft(uy, maxlags=None, norm='coeff') self.data['r33'],self.data['taur33'] = tt.xcorr_fft(uz, maxlags=None, norm='coeff') self.data['r12'],self.data['taur12'] = tt.xcorr_fft(ux,y=uy, maxlags=None, norm='coeff') self.data['r13'],self.data['taur13'] = tt.xcorr_fft(ux,y=uz, maxlags=None, norm='coeff') self.data['r23'],self.data['taur23'] = tt.xcorr_fft(uy,y=uz, maxlags=None, norm='coeff') self.data['rmag'],self.data['taurmag'] = tt.xcorr_fft(umag, maxlags=None, norm='coeff') # auto correlation of u self.data['R11'],self.data['tauR11'] = tt.xcorr_fft(ux, maxlags=None, norm='biased') self.data['R22'],self.data['tauR22'] = tt.xcorr_fft(uy, maxlags=None, norm='biased') self.data['R33'],self.data['tauR33'] = tt.xcorr_fft(uz, maxlags=None, norm='biased')
def generateStatistics(self,doDetrend=True): ''' Generates statistics and populates member variable data. Arguments: doDetrend: detrend data bevor sigbal processing Populates the "data" python dict with with the following keys: rii: [numpy.array of shape=(?)] Auto-correlation coefficent rii. For i=1,2,3 taurii: [numpy.array of shape=(?)] Time lags for rii. For i=1,2,3 Rii: [numpy.array of shape=(?)] Auto-correlation Rii. For i=1,2,3 tauRii: [numpy.array of shape=(?)] Time lags for Rii. For i=1,2,3 uifrq: [numpy.array of shape=(?)] u1 in frequency domain. For i=1,2,3 uiamp: [numpy.array of shape=(?)] amplitude of u1 in frequency domain. For i=1,2,3 Seiifrq:[numpy.array of shape=(?)] Frequencies for energy spectrum Seii. For i=1,2,3 Seii: [numpy.array of shape=(?)] Energy spectrum Seii derived from Rii. For i=1,2,3 ''' # auto correlation corefficient of u if doDetrend: ux=signal.detrend(self.ux()); uy=signal.detrend(self.uy()); uz=signal.detrend(self.uz()); umag=signal.detrend(self.Umag()); else: ux=self.ux(); uy=self.uy(); uz=self.uz(); umag=self.Umag(); #ux=ux[-samples:-1] #uy=uy[-samples:-1] #uz=uz[-samples:-1] self.data['r11'],self.data['taur11'] = tt.xcorr_fft(ux, maxlags=None, norm='coeff') self.data['r22'],self.data['taur22'] = tt.xcorr_fft(uy, maxlags=None, norm='coeff') self.data['r33'],self.data['taur33'] = tt.xcorr_fft(uz, maxlags=None, norm='coeff') self.data['r12'],self.data['taur12'] = tt.xcorr_fft(ux,y=uy, maxlags=None, norm='coeff') self.data['r13'],self.data['taur13'] = tt.xcorr_fft(ux,y=uz, maxlags=None, norm='coeff') self.data['r23'],self.data['taur23'] = tt.xcorr_fft(uy,y=uz, maxlags=None, norm='coeff') self.data['rmag'],self.data['taurmag'] = tt.xcorr_fft(umag, maxlags=None, norm='coeff') # auto correlation of u self.data['R11'],self.data['tauR11'] = tt.xcorr_fft(ux, maxlags=None, norm='none') self.data['R22'],self.data['tauR22'] = tt.xcorr_fft(uy, maxlags=None, norm='none') self.data['R33'],self.data['tauR33'] = tt.xcorr_fft(uz, maxlags=None, norm='none') #u in frequency domain self.data['u1frq'],self.data['u1amp'] = tt.dofft(sig=ux,samplefrq=self.data['frq']) self.data['u2frq'],self.data['u2amp'] = tt.dofft(sig=uy,samplefrq=self.data['frq']) self.data['u3frq'],self.data['u3amp'] = tt.dofft(sig=uz,samplefrq=self.data['frq']) #Time energy sectrum Se11 (mean: Rii in frequency domain...) self.data['Se11frq'],self.data['Se11'] = tt.dofft(sig=self.data['R11'],samplefrq=self.data['frq']) self.data['Se22frq'],self.data['Se22'] = tt.dofft(sig=self.data['R22'],samplefrq=self.data['frq']) self.data['Se33frq'],self.data['Se33'] = tt.dofft(sig=self.data['R33'],samplefrq=self.data['frq'])
def generateAutoCorrelations(self,doDetrend=True): # auto correlation corefficient of u if doDetrend: ux=signal.detrend(self.ux()); uy=signal.detrend(self.uy()); uz=signal.detrend(self.uz()); else: ux=self.ux(); uy=self.uy(); uz=self.uz(); self.data['r11'],self.data['taur11'] = tt.xcorr_fft(ux, maxlags=None, norm='coeff') self.data['r22'],self.data['taur22'] = tt.xcorr_fft(uy, maxlags=None, norm='coeff') self.data['r33'],self.data['taur33'] = tt.xcorr_fft(uz, maxlags=None, norm='coeff')
def generateCorrelations(self, doDetrend=True): # auto correlation corefficient of u if doDetrend: ux = signal.detrend(self.ux()) uy = signal.detrend(self.uy()) uz = signal.detrend(self.uz()) umag = signal.detrend(self.Umag()) else: ux = self.ux() uy = self.uy() uz = self.uz() umag = self.Umag() #ux=ux[-samples:-1] #uy=uy[-samples:-1] #uz=uz[-samples:-1] self.data['r11'], self.data['taur11'] = tt.xcorr_fft(ux, maxlags=None, norm='coeff') self.data['r22'], self.data['taur22'] = tt.xcorr_fft(uy, maxlags=None, norm='coeff') self.data['r33'], self.data['taur33'] = tt.xcorr_fft(uz, maxlags=None, norm='coeff') self.data['r12'], self.data['taur12'] = tt.xcorr_fft(ux, y=uy, maxlags=None, norm='coeff') self.data['r13'], self.data['taur13'] = tt.xcorr_fft(ux, y=uz, maxlags=None, norm='coeff') self.data['r23'], self.data['taur23'] = tt.xcorr_fft(uy, y=uz, maxlags=None, norm='coeff') self.data['rmag'], self.data['taurmag'] = tt.xcorr_fft(umag, maxlags=None, norm='coeff') # auto correlation of u self.data['R11'], self.data['tauR11'] = tt.xcorr_fft(ux, maxlags=None, norm='biased') self.data['R22'], self.data['tauR22'] = tt.xcorr_fft(uy, maxlags=None, norm='biased') self.data['R33'], self.data['tauR33'] = tt.xcorr_fft(uz, maxlags=None, norm='biased')
def generateAutoCorrelations(self, doDetrend=True): # auto correlation corefficient of u if doDetrend: ux = signal.detrend(self.ux()) uy = signal.detrend(self.uy()) uz = signal.detrend(self.uz()) else: ux = self.ux() uy = self.uy() uz = self.uz() self.data['r11'], self.data['taur11'] = tt.xcorr_fft(ux, maxlags=None, norm='coeff') self.data['r22'], self.data['taur22'] = tt.xcorr_fft(uy, maxlags=None, norm='coeff') self.data['r33'], self.data['taur33'] = tt.xcorr_fft(uz, maxlags=None, norm='coeff')