.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_parcel_analysis.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. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_parcel_analysis.py: Parcel Analysis =============== Lift a :term:`parcel` from the surface, shade the energy available to it, and annotate the indices that summarise the :term:`parcel ascent`. The :term:`sounding` is Norman, Oklahoma at 12Z on 2013-05-20 — the morning of the Moore EF5 tornado, with about 1750 J/kg of :term:`CAPE` under a -271 J/kg :term:`cap`. .. GENERATED FROM PYTHON SOURCE LINES 15-53 .. image-sg:: /gallery/images/sphx_glr_plot_parcel_analysis_001.png :alt: plot parcel analysis :srcset: /gallery/images/sphx_glr_plot_parcel_analysis_001.png :class: sphx-glr-single-img .. code-block:: Python from __future__ import annotations from typing import TYPE_CHECKING import matplotlib.pyplot as plt import tephpy from tephpy import samples if TYPE_CHECKING: from matplotlib.figure import Figure def main() -> Figure: """Draw the parcel analysis. Returns ------- matplotlib.figure.Figure The composed figure. """ snd = samples.sounding("norman-12z") fig, ax = plt.subplots(figsize=(8.0, 4.0), subplot_kw={"projection": "tephigram"}) ax.plot_sounding(snd) ax.plot_barbs(snd) parcel = tephpy.calc.parcel_path(snd) ax.plot_profile(parcel, color="k", linestyle="--") ax.shade_cape(snd, parcel) ax.shade_cin(snd, parcel) ax.annotate_indices(tephpy.calc.indices(snd)) ax.legend() return fig if __name__ == "__main__": main() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.521 seconds) .. rst-class:: sphx-glr-example-tags 🏷 Tags: analysis, shading, indices, sounding .. _sphx_glr_download_gallery_plot_parcel_analysis.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_parcel_analysis.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_parcel_analysis.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_parcel_analysis.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_