Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tc_cross_correlation/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@author: abell5
"""
from scipy.signal import triang
from scipy.signal.windows import triang
from numpy import sign, arange, zeros, absolute, true_divide, sum, floor, convolve, amax, logical_and
import copy
from obspy.signal import util
Expand Down
8 changes: 4 additions & 4 deletions tc_cross_correlation/realtime_xcorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def __init__(self):
self._add_output('output', tuple_type=['number'])
def process(self, inputs):
store = []
for dir in os.listdir(ROOT_DIR + 'DATA/'+ starttime):
for f in os.listdir(ROOT_DIR+'/DATA/'+ starttime +'/'+ dir):
file=ROOT_DIR+'DATA/'+ starttime + '/'+ dir+'/'+f
str1=np.load(file)
for dir in os.scandir(ROOT_DIR + 'DATA/' + starttime):
for f in os.scandir(ROOT_DIR + '/DATA/' + starttime + '/' + dir.name):
file = ROOT_DIR + 'DATA/' + starttime + '/' + dir.name + '/' + f.name
str1 = np.load(file)
index = len(store)
for i in range(index):
self.write('output',[i, index, store[i], str1])
Expand Down
4 changes: 2 additions & 2 deletions tc_cross_correlation/xcorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from obspy.signal.util import next_pow_2
from scipy.fftpack import fft, ifft
from numpy import complex, conjugate, roll, copy
from numpy import complex64, conjugate, roll, copy

def xcorrf(trace1, trace2, shift=None):
"""
Expand All @@ -26,7 +26,7 @@ def xcorrf(trace1, trace2, shift=None):
# Always use 2**n-sized FFT, perform xcorr
size = max(2 * shift + 1, (N1 + N2) // 2 + shift)
nfft = next_pow_2(size)
print size
print(size)
#Calculate fft of data1 and data2

IN1 = fft(data1, nfft)
Expand Down