.. 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_visualising_mas.py: Reading and visualising MAS runs ================================ First, load the required modules. .. code-block:: default from psipy.model import MASOutput import matplotlib.pyplot as plt Load a set of MAS output files. .. code-block:: default mas_path = '/Users/dstansby/github/psipy/data/helio' model = MASOutput(mas_path) Each MAS model contains a number of variables. The variable names can be accessed using the ``.variables`` attribute. .. code-block:: default print(model.variables) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none ['p', 't', 'va', 'br', 'vp', 'jp', 'jr', 'bp', 'vr', 'bt', 'vt', 'rho', 'jt'] Plot a cut of the model at a constant radius .. code-block:: default fig, ax = plt.subplots() model['rho'].plot_radial_cut(0, ax=ax) .. image:: /auto_examples/images/sphx_glr_plot_visualising_mas_001.png :alt: rho, r=29.26$R_{\odot}$ :class: sphx-glr-single-img Plot a cut of the model at a constant longitude. .. code-block:: default fig = plt.figure() ax = plt.subplot(111, projection='polar') model['rho'].plot_phi_cut(75, ax=ax) .. image:: /auto_examples/images/sphx_glr_plot_visualising_mas_002.png :alt: rho, $\phi$= 210.94$^{\circ}$ :class: sphx-glr-single-img Add the current sheet .. code-block:: default fig = plt.figure() ax = plt.subplot(111, projection='polar') model['rho'].plot_phi_cut(75, ax=ax) model['br'].contour_phi_cut(75, levels=[0], ax=ax, colors='white') plt.show() .. image:: /auto_examples/images/sphx_glr_plot_visualising_mas_003.png :alt: rho, $\phi$= 210.94$^{\circ}$ :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.322 seconds) .. _sphx_glr_download_auto_examples_plot_visualising_mas.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_visualising_mas.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_visualising_mas.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_