Note
Go to the end to download the full example code.
Focal Mechanism Beachball Plot#
This example shows how to create a heatmap of the moment tensor matrix
import matplotlib.pyplot as plt
import numpy as np
from fracspy.visualisation.momenttensor_plots import MTBeachball
plt.close("all")
np.random.seed(0)
Let’s start by creating a moment tensor, as the moment tensor is a symmetric matrix we only need to define 6 of the 9 components
[0, 0, 0, -1, 0, 0]
We are going to visualise the moment tensor in the common form of a beachball defined by the microseismic event’s focal mechanism. The plotting function handles conversion of the six-component moment tensor to the focal mechanism form desired by the ObSpy python package. After which, the beachball is drawn and attached to the provided axis. Here we utilise the function: pyfrac.visualisation.momenttensor_plots.MTBeachball
Total running time of the script: (0 minutes 0.024 seconds)