.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/plotting/plot_skewt.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_source_auto_examples_plotting_plot_skewt.py: Skew-T plot of a sounding ------------------------- This example shows how to make a Skew-T plot from a sounding and calculate stability indicies. .. GENERATED FROM PYTHON SOURCE LINES 9-51 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /source/auto_examples/plotting/images/sphx_glr_plot_skewt_001.png :alt: sgpsondewnpnC1.b1 on 20190101 :srcset: /source/auto_examples/plotting/images/sphx_glr_plot_skewt_001.png :class: sphx-glr-multi-img * .. image-sg:: /source/auto_examples/plotting/images/sphx_glr_plot_skewt_002.png :alt: sgpsondewnpnC1.b1 on 20190101 :srcset: /source/auto_examples/plotting/images/sphx_glr_plot_skewt_002.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none ['base_time', 'time_offset', 'qc_time', 'pres', 'qc_pres', 'tdry', 'qc_tdry', 'dp', 'qc_dp', 'wspd', 'qc_wspd', 'deg', 'qc_deg', 'rh', 'qc_rh', 'u_wind', 'qc_u_wind', 'v_wind', 'qc_v_wind', 'wstat', 'asc', 'qc_asc', 'lat', 'lon', 'alt'] /home/runner/work/ACT/ACT/act/retrievals/sonde.py:179: UserWarning: Interpolation point out of data bounds encountered lfc = mpcalc.lfc(p_sorted[0], t_sorted[0], td_sorted[0]) Size: 8B array(28.47591174) Attributes: units: kelvin long_name: Lifted index | .. code-block:: Python from arm_test_data import DATASETS import xarray as xr from matplotlib import pyplot as plt import act # Make sure attributes are retained xr.set_options(keep_attrs=True) # Read data filename_sonde = DATASETS.fetch('sgpsondewnpnC1.b1.20190101.053200.cdf') sonde_ds = act.io.arm.read_arm_netcdf(filename_sonde) print(list(sonde_ds)) # Calculate stability indicies sonde_ds = act.retrievals.calculate_stability_indicies( sonde_ds, temp_name='tdry', td_name='dp', p_name='pres' ) print(sonde_ds['lifted_index']) # Set up plot skewt = act.plotting.SkewTDisplay(sonde_ds, figsize=(15, 10)) # Add data skewt.plot_from_u_and_v('u_wind', 'v_wind', 'pres', 'tdry', 'dp') plt.show() # One could also add options like adiabats and mixing lines skewt = act.plotting.SkewTDisplay(sonde_ds, figsize=(15, 10)) skewt.plot_from_u_and_v( 'u_wind', 'v_wind', 'pres', 'tdry', 'dp', plot_dry_adiabats=True, plot_moist_adiabats=True, plot_mixing_lines=True, ) plt.show() sonde_ds.close() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.550 seconds) .. _sphx_glr_download_source_auto_examples_plotting_plot_skewt.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_skewt.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_skewt.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_skewt.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_