LAB 6 - Focal Mechanisms

LAB 6 - Focal Mechanisms#

In seismology research, we deal with large volumes of time-series data. Python provides an excellent set of tools for handling these data: Obspy.

import glob
from obspy.core import read

The second line here imports the obspy package for dealing with seismic data.

We can also import some of the familar toolkits we have been using already:

#you can use these libraries by refering to their appreviation plt., np. or pd.
#basic plotting library
import matplotlib.pyplot as plt

#scientifc computing library
import numpy as np

#data analysis tool
import pandas as pd
# Try it here!

import glob
from obspy.core import read

import matplotlib.pyplot as plt

#scientifc computing library
import numpy as np

#data analysis tool
import pandas as pd

for file in glob.glob('*.z'):
    st = read(file)
    tr = st[0]
    msg = "%s %s %f %f" % (tr.stats.station, str(tr.stats.starttime),
                           tr.data.mean(), tr.data.std())
    print(msg)

We can make focal mechanism or beachball plots using obspy.

Here are three examples of different faulting mechanisms. Identify each one.

Then try change the color of the plots, their size, and orientation of the fault.

from obspy.imaging.beachball import beachball

The focal mechanism can be given by 3 (strike, dip, and rake) components.

focalmechs = [150, 87, 1]
beachball(focalmechs) 
../../_images/d3429612776de98bd0c9dd168a36f581ed687714c0e0486ded8d6f78b92420f9.png ../../_images/d3429612776de98bd0c9dd168a36f581ed687714c0e0486ded8d6f78b92420f9.png

Try changing the inputs/components to make the 3 major types of faults.

#Try it here

For those of you who have background in tensors.#

You can also make focal mechanisms based upon the 6 independent components of the moment tensor (Mxx, Myy, Mzz, Mxy, Mxz, Myz).

#Try it here 
mt = [0.91, -0.89, -0.02, 1.78, -1.55, 0.47]
beachball(mt, size=200, linewidth=2, facecolor='b')

mt2 = [50, 90, 1]
beachball(mt2, size=200, linewidth=2, facecolor='r')

mt3 = [-2.39, 1.04, 1.35, 0.57, -2.94, -0.94]
beachball(mt3, size=200, linewidth=2, facecolor='g')
../../_images/2372ab3f4162dedb8c971f57ae9f101fd5cd93af312606fefbbb195b69e75947.png ../../_images/5bb2177fe8481ce61687b7b91e890137f737a88f80a1b7054367867d73e1eb96.png ../../_images/eaaf79f10e33b35ddcfbda9260fe187c68110ed9e9b72c00f307b1602e512158.png ../../_images/eaaf79f10e33b35ddcfbda9260fe187c68110ed9e9b72c00f307b1602e512158.png