.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/atmosphere/plot_10_teisserenc_de_bort_stratosphere.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_atmosphere_plot_10_teisserenc_de_bort_stratosphere.py: Teisserenc de Bort's stratosphere (1902) ======================================== Léon Teisserenc de Bort launched hundreds of unmanned sounding balloons from Trappes. Above about 11 km the temperature stopped falling, a layer he called the stratosphere; Richard Assmann found the same in Berlin. With the standard lapse rate of 6.5 K/km below the tropopause, hydrostatic balance gives the standard-atmosphere pressure of 226.3 hPa at 11 km, and the pressure decays exponentially in the isothermal layer above. .. GENERATED FROM PYTHON SOURCE LINES 12-38 .. image-sg:: /api/gallery/atmosphere/images/sphx_glr_plot_10_teisserenc_de_bort_stratosphere_001.png :alt: plot 10 teisserenc de bort stratosphere :srcset: /api/gallery/atmosphere/images/sphx_glr_plot_10_teisserenc_de_bort_stratosphere_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.atmosphere import two_layer_temperature from earthsciencekit.constants import GRAVITY, R_DRY_AIR height = np.linspace(0, 20e3, 4001) temperature = two_layer_temperature(height, 288.15, 0.0065, 11e3) integrand = GRAVITY / (R_DRY_AIR * temperature) log_pressure = np.concatenate([[0], np.cumsum((integrand[1:] + integrand[:-1]) / 2 * np.diff(height))]) pressure = 101325 * np.exp(-log_pressure) lapse = -np.gradient(temperature, height) assert abs(pressure[height == 11e3][0] - 22632) < 5 assert np.allclose(lapse[height > 11.1e3], 0) and np.allclose(lapse[height < 10.9e3], 0.0065) fig, axes = plt.subplots(1, 2, figsize=(10, 3.5)) axes[0].plot(temperature, height / 1000) axes[0].axhline(11, color="0.5", ls="--", label="tropopause") axes[0].set(xlabel="temperature [K]", ylabel="height [km]") axes[0].legend() axes[1].semilogx(pressure / 100, height / 1000) axes[1].set(xlabel="pressure [hPa, log scale]", ylabel="height [km]") fig.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.200 seconds) .. _sphx_glr_download_api_gallery_atmosphere_plot_10_teisserenc_de_bort_stratosphere.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/atmosphere/plot_10_teisserenc_de_bort_stratosphere.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_10_teisserenc_de_bort_stratosphere.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_10_teisserenc_de_bort_stratosphere.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_10_teisserenc_de_bort_stratosphere.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_