# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg----------
'''Calculate Hudson's (u, v) coordinates for a given moment tensor.
The moment tensor can be given as a :py:class:`pyrocko.moment_tensor.MomentTensor` object, or by anything that can be converted to a 3x3 NumPy matrix, or as the six independent moment tensor entries as ``(mnn, mee, mdd, mne, mnd, med)``. '''
'''Plot axes and annotations of Hudson's MT decomposition diagram.'''
[-4./3., 0., 4./3., 0., -4/3.], [-1./3., -1., 1./3., 1., -1./3.], zorder=-1, linewidth=linewidth, color=color)
[-1.0, 1.0], [0., 0.], zorder=-1, linewidth=linewidth, color=color)
[0., 0.], [-1., 1.], zorder=-1, linewidth=linewidth, color=color)
('+Isotropic', (0., 1.), (-d, d), 'bottom', 'right'), ('-Isotropic', (0., -1.), (d, -d), 'top', 'left'), ('-CLVD', (+1.0, 0.), (d, -d), 'top', 'left'), ('+CLVD', (-1.0, 0.), (-d, d), 'bottom', 'right')]:
pos[0], pos[1], 'o', color=color, markersize=fontsize/2.)
txt, xy=pos, xycoords='data', xytext=off, textcoords='offset points', verticalalignment=va, horizontalalignment=ha, rotation=0.)
('-Dipole', (2./3., -1./3.), (d, -d), 'top', 'left'), ('+Dipole', (-2./3., 1./3.), (-d, d), 'bottom', 'right'), ('-Crack', (4./9., -5./9.), (d, -d), 'top', 'left'), ('+Crack', (-4./9., 5./9.), (-d, d), 'bottom', 'right')]:
pos[0], pos[1], 'o', color=color, markersize=fontsize/2.)
txt, xy=pos, xycoords='data', xytext=off, textcoords='offset points', verticalalignment=va, horizontalalignment=ha, rotation=0.) |