Has anyone used the signal processing functions in ObsPy to create an event detection routine based on cross correlation using a "template event waveform"? I'd hate to re-invent the wheel if someone has already done this....so just checking first. I am looking for a simple single 3C station detector at this point to match a repeating event.
I have done this and it is neither super fast nor elegant it does work.
If you would like I could send you the code.
Regards,
Austin A. Holland
Research Seismologist
Oklahoma Geological Survey
The University of Oklahoma
Mewbourne College of Earth and Energy
Sarkeys Energy Center, 100 E.
Boyd St., Room E-128, Norman, OK 73019-0628
austin.holland@ou.edu | PH: (405)
325-8497 | CELL: (405) 361-9967 | FAX 325-7069
I implemented event template similarity checking directly inside the
network triggering routine in ObsPy. Currently it is only in master (and
will be part of 0.9.0 once it's released).
I have created a function named "distaz" which uses the obspy build-in function distaz that calculates the azimuth and distance between 101 stations and an event.
It takes almost 48 seconds to complete the calculation! It seems too slow. Am I doing something wrong? Any suggestions?
# my function
def distaz(station_list, event):
client = Client()
for station in station_list:
result = client.distaz(station.latitude, station.longitude, event.latitude, event.longitude)
station.azimuth = result['azimuth']
station.distance = result['distance']
you are using the distaz() method of the IRIS client. Essentially you launch 101 requests at their servers, let the servers do the calculations and get the result... That of course is not the fastest way to achieve what you want.
ObsPy also has built-in functionality to perform the calculations on your machine:
Your obspy code worked brilliantly. Thank you again for sharing! I know I thanked you individually but wanted to thank you publicly in the forum. Using and reworking this code I was able to find over 300 events with very high cross correlation coeff's (> 0.85)...and I added on some Moment magnitude determination relative to the template event and that works great down to negative Mw -0.3!!!
Seems there is quite a demand for this code. I have cleaned up the code
some and posted it on our website. I set up a test case with the default
obspy data which should work out of the box with no data in hand. The
code is available at: http://wichita.ogs.ou.edu/documents/python/xcor.py
Happy Correlating,
Austin A. Holland
Research Seismologist | Oklahoma Geological Survey
The University of Oklahoma Mewbourne College of Earth and Energy
Sarkeys Energy Center, 100 E. Boyd St., Room E-128, Norman, OK 73019-0628
austin.holland@ou.edu | PH: (405) 325-8497 | CELL: (405) 361-9967 | FAX
325-7069