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
from __future__ import print_function
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.PFO
which is available for example from IRIS. Use the get_waveforms()
method.get_stations()
method.import obspy
from obspy.clients.fdsn import Client
# Event time.
event_time = obspy.UTCDateTime("2014-08-24T10:20:44.0")
# Get the event information. The temporal and magnitude constraints make it unique
cat = ...
print(cat)
# Download station information at the response level!
inv = ...
print(inv)
# Download 3 component waveforms.
st = ...
print(st)
Have a look at the just downloaded data.
inv.plot()
inv.plot_response(0.001)
cat.plot()
st.plot()
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 ipywidgets 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=(1, 180),
depth=(0, 700), wavetype=["ttall", "diff"]);