bgoutorbe / seismic-noise-tomography Goto Github PK
View Code? Open in Web Editor NEWPython framework for seismic noise tomography
Python framework for seismic noise tomography
Hi there, my name's Benjamin Boland and I'm currently working on incorporating seismic noise tomography into the system in Gippsland, south eastern Victoria in Australia. I'm currently working on my masters project in SMT and would very much like to incorporate this code into this project.
I'm currently getting the following errors:
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 586, in runfile
execfile(filename, namespace)
File "/home/boland/Documents/seismic-noise-tomography-master/crosscorrelation.py", line 458, in
xc.export(outprefix=OUTFILESPATH, stations=stations, verbose=True)
File "pysismo/pscrosscorr.py", line 1839, in export
self._to_ascii(outprefix, verbose=verbose)
File "pysismo/pscrosscorr.py", line 2031, in _to_ascii
data = zip(self._get_timearray(), *[self[s1][s2].dataarray for s1, s2 in pairs])
File "pysismo/pscrosscorr.py", line 2135, in _get_timearray
s1, s2 = pairs[0]
IndexError: list index out of range
Try as I might, I'm unable to get the cross-correlations to export into the correct format, as the time-array pairs() function isn't correctly assigning values in my case.
Any suggestions on how to fix this would be greatly appreciated.
Please either comment back or my email is [email protected], thank you so much for you time and help and if I could get this thing running for our systems that would be amazing!
Your code looks nigh on perfect for my needs here, it's just something wrong that I'm doing on my end I'm sure of it.
Cheers and have a great day!
Benjamin Boland
Hello, I'm a master student from National Chen Kung University, Taiwan.
I read the article "Rayleigh wave group velocities at periods of 6-23s across Brazil from ambient noise tomography", and i'm very interested in the tomographic inversion.
I have already finished the cross-correlation function processing, and it output the reference waveform with the miniseed format. I saw the code in dispersion_curves.py that the waveform format is pickle. I have also tried to get the pickle file from obspy with the following code:
import obspy.core as obs
st = obs.read('test.mseed')
st.write('test.pickle', format='PICKLE')
And it prints
AttributeError: 'Stream' object has no attribute 'FTANs'
Then i tried another way.
import pickle
from pysismo import pscrosscorr
f = open(name='test.mseed', mode='rb')
xc = pscrosscorr.CrossCorrelationCollection()
with open('test.pickle', 'wb') as f:
pickle.dump(xc, f, protocol=2)
It can work, but it prints
Exporting FTANs of 0 pairs to file ./output/FTAN/FTAN_test.pdf
and dispersion curves to file ./output/FTAN/FTAN_test.pickle
Here is my reference miniseed file.
https://goo.gl/VFzXuz
After processing a year's worth of waveforms for 77 stations here in Australia, the code doesn't want to process the dispersion curves using dispersion_curves.py. The maximum I can get for this working so far has been 44 stations for 4 months. Any longer than that and I get the following error:
/storage/ANT/AMBIENT-NOISE-TOMOGRAPHY/pysismo/pscrosscorr.py:2499: DeprecationWarning: numpy boolean negative (the unary -
operator) is deprecated, use the bitwise_xor (the ^
operator) or the logical_xor function instead.
notnan = -(np.isnan(vgarray) | np.isnan(amplarray))
Traceback (most recent call last):
File "dispersion_curves.py", line 102, in
xc.FTANs(suffix=suffix, whiten=False, normalize_ampl=True, logscale=True)
File "/storage/ANT/AMBIENT-NOISE-TOMOGRAPHY/pysismo/pscrosscorr.py", line 1982, in FTANs
*_kwargs)
File "/storage/ANT/AMBIENT-NOISE-TOMOGRAPHY/pysismo/pscrosscorr.py", line 1056, in FTAN_complete
*_kwargs)
File "/storage/ANT/AMBIENT-NOISE-TOMOGRAPHY/pysismo/pscrosscorr.py", line 877, in FTAN
fp=inst_periods[~masknan])
File "/home/abe/anaconda/lib/python2.7/site-packages/numpy/lib/function_base.py", line 1191, in interp
return compiled_interp(x, xp, fp, left, right)
ValueError: array of sample points is empty
The to part of the error (from /storage to (amplarray)) ) comes up thousands of times in a row until the final traceback error. Do you have any advice? Thank you for your time.
Code running_avg directly with np.convolve.
Take care of NaNs and masked arrays
Hi there !
I'm trying to run some FTAN on my own cross-correlation functions (CCF) computed using MSNoise... so far, I think I have managed to mimic it, but I'm not quite sure of the result.
Could you provide some test-case CCF files and their FTAN (image, vgarray) ?
Cheers,
Thomas
Dear seismic-noise-tomography's developer and whom might be concerned
I'm a Master's Degree student from Chiang Mai University, Thailand.
I'm interested in crosscorrelation tomography's field.
Moreover, your work drew me to these programs.
Lately, I was testing on running the crosscorrelation program.
I've found that it keep running on Select a configuration files as the attached picture.
Therefore, I'm writing to kindly ask if you could suggest me that what's going on.
In details,
compiler PyCharm Community Edition 2020.1.2 x64
python 2.7.15
obspy 1.0.2
numpy 1.15.4
scipy 1.2.1
matplotlib 2.2.5
pyproj 1.9.6
,Kindly Regards.
Dear bgoutorbe:
Thank you sincerely for your kindly sharing.
I'm an undergraduate student in China and i want to know how can i get dataless seed file and miniseed files from SEED files to match your code?
In get_stations(), use obspy.core.read() or something else to get quickly header
Just wanted to say thank you very much for your code. It's been an invaluable tool for ANT modelling in the region for which I'm am doing my masters thesis in.
I just have a question on optimisation. Currently, the longest process (particularly for large 1TB+ data sets) is stacking the cross-correlations. Would there be any use utilising the python multiprocessing module to parallelise some of the code in crosscorrelation.py? would this increase speed and utilise more of the hardware on say larger server computers?
What other optimisation steps could be taken to increase the speed of this code? any suggestions would help.
Thank you for your time. If you would like any assistance in testing the code or for anything else, my email is [email protected].
Cheers,
Benjamin Boland
In FTAN plot, plot SNR for each period
see if obspy.signal.cross_correlation.xcorr accepts masked arrays
The program needs to be updated so that each user can work with its own configuration (default paths, bounding boxes, period bands etc.).
DispersionCurve.add_SNRs() should be consistent with FTAN, which applies narrow Gaussian filters to the analytic representation of the cross-correlation:
exp(-alpha * ((f - f0) / f0) ** 2)
So add_SNRs() should apply the SAME bandpass filter. Consequently:
Put processing steps in, e.g., psutil or pscrosscorr.preprocess_trace(remove_mean, remove_trend, remove_instr, time_norm, whiten etc.)
Separate spectrum analysis from cross-correlation
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.