Skip to content

Instantly share code, notes, and snippets.

View emolch's full-sized avatar

Sebastian Heimann emolch

View GitHub Profile
@emolch
emolch / beach.py
Created February 8, 2017 11:18
How to plot full MT, deviatoric and double-couble focal mechanism solutions with Pyrocko
from matplotlib import pyplot as plt
from pyrocko import beachball, moment_tensor as pmt, plot
fig = plt.figure(figsize=(4., 2.))
fig.subplots_adjust(left=0., right=1., bottom=0., top=1.)
axes = fig.add_subplot(1, 1, 1)
axes.set_xlim(0., 4.)
axes.set_ylim(0., 2.)
axes.set_axis_off()
import sys
from pyrocko.fdsn import station as fs
# Example on how to manipulate StationXML with Pyrocko (pyrocko.fdsn.station)
#
# Reads StationXML file and replaces sensor orientation and input unit
# information
sx = fs.load_xml(filename=sys.argv[1])