Closed fuxiang87 closed 6 years ago
Are you using Python 2 by chance? If so, does the problem still persist with Python 3 instead?
I just updated the affected code and am hence closing this issue for now. Please feel free to reopen it in case you are still seeing this error with the most recent version of the code. Thank you for bringing this issue to my attention.
How to resolve this error, "ImportError: cannot import name 'correlate'"? I am using Python 3.5.
Does that error occur when running run.py
when executing it from the same directory?
I am not sure what you are asking. I new to obspy. But this is what I am doing.
from obspy.signal.cross_correlation import correlate cc = correlate(tr1, tr2, 1000) shift, value = xcorr_max(cc) round(value, 2)
I have my own traces whose correlation I am trying to find. I used xcorr function initially like this "corr=xcorr(tr1, tr2, shift_len=0, full_xcorr=True)" which is giving me this result "(0, 0.9034900314816721, array([0.90349003]))". It always give just one value of correlation and that at the 0th location. I am not sure how correct that correlation is. Figure is attached.
In the hope of getting the full correlation, I tried using the correlation function but it gives me import error. Further, in the xcorr_max function, I am getting another error, "AttributeError: 'tuple' object has no attribute 'max'".
I am afraid that this repository is not related to obspy. You might want to consider asking your question over here: https://github.com/obspy/obspy
What's the solution for "ImportError: cannot import name correlation"? I didn't find the def correlation in correlation.py.