.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/plot_surface.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_examples_plot_surface.py: Surface plot ------------ This example demonstrates how to calculate the quantities on a constant altitude plane. .. GENERATED FROM PYTHON SOURCE LINES 9-41 .. image-sg:: /examples/images/sphx_glr_plot_surface_001.png :alt: O$_2$ number density at 200 km :srcset: /examples/images/sphx_glr_plot_surface_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np import pymsis lons = range(-180, 185, 5) lats = range(-90, 95, 5) alt = 200 f107 = 150 f107a = 150 ap = 7 # One years worth of data at the 12th hour every day date = np.datetime64("2003-01-01T12:00") aps = [[ap] * 7] output = pymsis.calculate(date, lons, lats, alt, f107, f107a, aps) # output is now of the shape (1, nlons, nlats, 1, 11) # Get rid of the single dimensions output = np.squeeze(output) _, ax = plt.subplots() xx, yy = np.meshgrid(lons, lats) mesh = ax.pcolormesh(xx, yy, output[:, :, pymsis.Variable.O2].T, shading="auto") plt.colorbar(mesh, label="Number density (/m$^3$)") ax.set_title(f"O$_2$ number density at {alt} km") ax.set_xlabel("Longitude") ax.set_ylabel("Latitude") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.294 seconds) .. _sphx_glr_download_examples_plot_surface.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_surface.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_surface.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_surface.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_