For the this exercise we will download some data from the Tohoku-Oki earthquake, cut out a certain time window around the first arrival and remove the instrument response from the data.
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 12, 8
The first step is to download all the necessary information using the ObsPy FDSN client. Learn to read the documentation!
We need the following things:
get_events()
method of the client. A good provider of event data is the USGS.II.BFO
which is available for example from IRIS. Use the get_waveforms()
method.get_stations()
method.
Have a look at the just downloaded data.
Use obspy.geodetics.locations2degree
.
from obspy.taup import TauPyModel
m = TauPyModel(model="ak135")
arrivals = m.get_ray_paths(...)
arrivals.plot()
st.remove_response(inventory=inv, pre_filt=...)
from IPython.html.widgets import interact
from obspy.taup import TauPyModel
m = TauPyModel("ak135")
def plot_raypaths(distance, depth, wavetype):
try:
plt.close()
except:
pass
if wavetype == "ttall":
phases = ["ttall"]
elif wavetype == "diff":
phases = ["Pdiff", "pPdiff"]
m.get_ray_paths(distance_in_degree=distance,
source_depth_in_km=depth,
phase_list=phases).plot();
interact(plot_raypaths, distance=[0, 180],
depth=[0, 700], wavetype=["ttall", "diff"]);