.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/plate_tectonics/plot_08_vine_matthews_magnetic_stripes.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_plate_tectonics_plot_08_vine_matthews_magnetic_stripes.py: Vine, Matthews and Morley's magnetic stripes (1963) =================================================== Fred Vine and Drummond Matthews, and independently Lawrence Morley, saw that ocean crust records the reversing geomagnetic field as it cools at the ridge. Distance over half-spreading rate gives the age of each stripe, so the pattern is a mirror image about the ridge. The polarity timescale below keeps only the main chrons and subchrons of the last 4 million years. .. GENERATED FROM PYTHON SOURCE LINES 11-36 .. image-sg:: /api/gallery/plate_tectonics/images/sphx_glr_plot_08_vine_matthews_magnetic_stripes_001.png :alt: Normal (black) and reversed (white) crust :srcset: /api/gallery/plate_tectonics/images/sphx_glr_plot_08_vine_matthews_magnetic_stripes_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.plate_tectonics import spreading_age from earthsciencekit.units import convert # Boundaries of alternating polarity, normal first [million years]. boundaries = np.array([0.0, 0.78, 0.99, 1.07, 1.78, 1.95, 2.58, 3.58, 4.0]) half = convert(2.0, "cm/year", "m/s") distance = np.linspace(-80e3, 80e3, 1601) age = convert(spreading_age(np.abs(distance), half), "s", "year") / 1e6 polarity = np.where(np.searchsorted(boundaries, age, side="right") % 2 == 1, 1, -1) np.testing.assert_array_equal(polarity, polarity[::-1]) brunhes = spreading_age(15.6e3, half) assert np.isclose(convert(brunhes, "s", "year"), 0.78e6) fig, (top, bottom) = plt.subplots(2, 1, sharex=True, figsize=(8, 4.5), height_ratios=[1, 2]) top.imshow(polarity[None, :], aspect="auto", cmap="gray_r", extent=[-80, 80, 0, 1]) top.set(yticks=[], title="Normal (black) and reversed (white) crust") bottom.plot(distance / 1e3, age) bottom.set(xlabel="distance from ridge [km]", ylabel="crustal age [million years]") fig.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.128 seconds) .. _sphx_glr_download_api_gallery_plate_tectonics_plot_08_vine_matthews_magnetic_stripes.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/plate_tectonics/plot_08_vine_matthews_magnetic_stripes.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_08_vine_matthews_magnetic_stripes.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_08_vine_matthews_magnetic_stripes.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_08_vine_matthews_magnetic_stripes.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_