Moment tensor conversions

Transformations between different moment tensor representations using the pyrocko.moment_tensor module.

Convert moment tensor components to strike, dip and rake

moment tensor construction is shown by using the moment components (in north-east-down coordinate system convention) and conversion to strike, dip and rake.

Download moment_tensor_example1.py

from pyrocko import moment_tensor as mtm

magnitude = 6.3  # Magnitude of the earthquake

exp = mtm.magnitude_to_moment(magnitude)  # convert the mag to moment in [Nm]

# init pyrocko moment tensor
m = mtm.MomentTensor(
    mnn = 2.34*exp,
    mee = -2.64*exp,
    mdd = 0.295*exp,
    mne = 1.49*exp,
    mnd = 0.182*exp,
    med = -0.975*exp)

print(m)  # print moment tensor

# gives out both nodal planes:
(s1, d1, r1), (s2, d2, r2) = m.both_strike_dip_rake()

print('strike1=%s, dip1=%s, rake1=%s' % (s1, d1, r1))
print('strike2=%s, dip2=%s, rake2=%s' % (s2, d2, r2))

Strike, dip and rake to moment tensor

Conversion from strike, dip and rake to the moment tensor. Afterwards we normalize the moment tensor.

Download moment_tensor_example2.py

from pyrocko import moment_tensor as mtm

magnitude = 6.3  # Magnitude of the earthquake

m0 = mtm.magnitude_to_moment(magnitude)  # convert the mag to moment

strike = 130
dip = 40
rake = 110
mt = mtm.MomentTensor(strike=strike, dip=dip, rake=rake, scalar_moment=m0)

m6 = [mt.mnn, mt.mee, mt.mdd, mt.mne, mt.mnd, mt.med]  # The six MT components
print(m6/mt.scalar_moment())  # normalized MT components