.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/glaciology/plot_11_dansgaard_isotope_thermometer.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_glaciology_plot_11_dansgaard_isotope_thermometer.py: Dansgaard's isotope thermometer (1964) ====================================== Willi Dansgaard collected rain and snow from stations worldwide and found that their oxygen-18 content falls by about 0.7 permil per kelvin of mean annual temperature at high latitudes: as moist air cools, its heavy molecules condense first. Read backwards, the isotope ratio of ice is a thermometer, and the glacial ice of Greenland, about 7 permil lighter than Holocene ice, records a cooling of about 10 K. .. GENERATED FROM PYTHON SOURCE LINES 12-35 .. image-sg:: /api/gallery/glaciology/images/sphx_glr_plot_11_dansgaard_isotope_thermometer_001.png :alt: Dansgaard: glacial ice 10 K colder :srcset: /api/gallery/glaciology/images/sphx_glr_plot_11_dansgaard_isotope_thermometer_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.glaciology import dansgaard_delta, dansgaard_temperature slope, offset = 0.69, -13.6 station = np.array([258.0, 248.0, 263.0, 241.0, 268.0, 253.0, 233.0, 271.0]) # K, synthetic stations scatter = np.array([0.6, -0.8, 0.3, 1.1, -0.4, -0.2, 0.7, -0.9]) # permil measured = dansgaard_delta(station, slope, offset) + scatter assert np.isclose(np.polyfit(station, measured, 1)[0], slope, atol=0.05) holocene, glacial = dansgaard_temperature(np.array([-35.0, -42.0]), slope, offset) assert np.isclose(holocene - glacial, 7 / slope) fig, ax = plt.subplots() line = np.linspace(225, 280, 2) ax.plot(station - 273.15, measured, "o", label="synthetic stations") ax.plot(line - 273.15, dansgaard_delta(line, slope, offset), label="0.69 permil/K") title = f"Dansgaard: glacial ice {holocene - glacial:.0f} K colder" ax.set(xlabel="mean annual temperature [degC]", ylabel="delta-18O [permil]", title=title) ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.085 seconds) .. _sphx_glr_download_api_gallery_glaciology_plot_11_dansgaard_isotope_thermometer.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/glaciology/plot_11_dansgaard_isotope_thermometer.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_11_dansgaard_isotope_thermometer.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_11_dansgaard_isotope_thermometer.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_11_dansgaard_isotope_thermometer.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_