.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/seismology/plot_15_hanks_kanamori_moment_magnitude.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_seismology_plot_15_hanks_kanamori_moment_magnitude.py: Hanks and Kanamori's moment magnitude (1979) ============================================ Thomas Hanks and Hiroo Kanamori defined a magnitude from the seismic moment so that it matches the older scales where they work and keeps growing for great earthquakes. Each unit of magnitude multiplies the moment by 10^1.5, about 32. The SI form uses Mw = (2/3)(log10 M0 - 9.1). .. GENERATED FROM PYTHON SOURCE LINES 10-30 .. image-sg:: /api/gallery/seismology/images/sphx_glr_plot_15_hanks_kanamori_moment_magnitude_001.png :alt: One magnitude unit is 32 times the moment :srcset: /api/gallery/seismology/images/sphx_glr_plot_15_hanks_kanamori_moment_magnitude_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.seismology import moment_from_magnitude, moment_magnitude magnitude = np.linspace(2, 9.5, 100) moment = moment_from_magnitude(magnitude) np.testing.assert_allclose(moment_magnitude(moment), magnitude) assert np.isclose(moment_from_magnitude(7) / moment_from_magnitude(6), 10**1.5) events = {"Niigata 1964": 3e20, "Chile 1960": 2e23, "Tohoku 2011": 4e22} fig, ax = plt.subplots() ax.semilogy(magnitude, moment) for name, m0 in events.items(): ax.semilogy(moment_magnitude(m0), m0, "o") ax.annotate(name, (moment_magnitude(m0), m0), textcoords="offset points", xytext=(-80, 5)) ax.set(xlabel="moment magnitude Mw", ylabel="seismic moment [N m]", title="One magnitude unit is 32 times the moment") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.111 seconds) .. _sphx_glr_download_api_gallery_seismology_plot_15_hanks_kanamori_moment_magnitude.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../lite/lab/index.html?path=api/gallery/seismology/plot_15_hanks_kanamori_moment_magnitude.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_15_hanks_kanamori_moment_magnitude.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_15_hanks_kanamori_moment_magnitude.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_15_hanks_kanamori_moment_magnitude.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_