.. only:: html
.. note::
:class: sphx-glr-download-link-note
Click :ref:`here ` to download the full example code
.. rst-class:: sphx-glr-example-title
.. _sphx_glr_auto_examples_plot_sars.py:
Plotting data from the SARS database
====================================
.. image:: /auto_examples/images/sphx_glr_plot_sars_001.png
:class: sphx-glr-single-img
.. rst-class:: sphx-glr-script-out
Out:
.. code-block:: none
/Users/travis/build/sharppy/SHARPpy/examples/plot_sars.py:29: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
plt.show()
|
.. code-block:: default
import sharppy.sharptab as tab
import sharppy.databases.sars as sars
import numpy as np
import os
import matplotlib.pyplot as plt
database_fn = os.path.join( os.path.dirname( sars.__file__ ), 'sars_supercell.txt')
supercell_database = np.loadtxt(database_fn, skiprows=1, dtype=bytes, comments="%%%%")
magnitude = []
mlcape = []
srh01 = []
for record in supercell_database:
magnitude.append(int(record[1]))
mlcape.append(float(record[3]))
srh01.append(float(record[6]))
plt.grid()
plt.scatter(mlcape, srh01, c=magnitude, marker='.')
plt.colorbar()
plt.xlabel("MLCAPE [J/kg]")
plt.ylabel(r'0-1 km Storm Relative Helicity [$m^{2}/s^{2}$]')
plt.savefig('plot_sars.png', bbox_inches='tight')
plt.show()
.. rst-class:: sphx-glr-timing
**Total running time of the script:** ( 0 minutes 0.885 seconds)
.. _sphx_glr_download_auto_examples_plot_sars.py:
.. only :: html
.. container:: sphx-glr-footer
:class: sphx-glr-footer-example
.. container:: sphx-glr-download sphx-glr-download-python
:download:`Download Python source code: plot_sars.py `
.. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download Jupyter notebook: plot_sars.ipynb `
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery `_