.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/climate/plot_02_foote_heated_co2.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_climate_plot_02_foote_heated_co2.py: Foote's heated carbon dioxide (1856) ==================================== Eunice Foote set glass cylinders of different gases in sunlight and found that the one filled with carbon dioxide grew hottest and stayed hot longest. She suggested that more of it in the air would warm the Earth. The simplest model of that effect is one atmospheric layer, transparent to sunlight, that absorbs a fraction of the infrared from the ground and re-emits it both up and down. A fully absorbing layer warms the surface by a factor of ``2**0.25``. .. GENERATED FROM PYTHON SOURCE LINES 13-35 .. image-sg:: /api/gallery/climate/images/sphx_glr_plot_02_foote_heated_co2_001.png :alt: One absorbing layer warms the ground :srcset: /api/gallery/climate/images/sphx_glr_plot_02_foote_heated_co2_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.climate import absorbed_solar, effective_temperature, greenhouse_surface_temperature, outgoing_longwave absorbed = absorbed_solar(1361, 0.3) emissivity = np.linspace(0, 1, 101) surface = greenhouse_surface_temperature(absorbed, emissivity) layer = surface / 2**0.25 to_space = (1 - emissivity) * outgoing_longwave(surface, 1) + outgoing_longwave(layer, emissivity) np.testing.assert_allclose(to_space, absorbed) assert np.isclose(surface[-1], 2**0.25 * effective_temperature(absorbed, 1)) fig, ax = plt.subplots() ax.plot(emissivity, surface, label="surface") ax.plot(emissivity, layer, label="atmospheric layer") ax.axhline(effective_temperature(absorbed, 1), color="0.5", ls=":", label="no atmosphere") ax.set(xlabel="infrared emissivity of the layer", ylabel="temperature [K]", title="One absorbing layer warms the ground") ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.081 seconds) .. _sphx_glr_download_api_gallery_climate_plot_02_foote_heated_co2.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/climate/plot_02_foote_heated_co2.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_02_foote_heated_co2.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_foote_heated_co2.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_foote_heated_co2.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_