Note
Click here to download the full example code
Plotting equatorial slicesΒΆ
This example shows how to plot slices in the equatorial plane from a MAS model output.
First, load the required modules.
from psipy.model import MASOutput
import matplotlib.pyplot as plt
Next, load a set of MAS output files. You will need to change this line to point to a folder with MAS files in them.
Each MAS model contains a number of variables. The variable names can be
accessed using the .variables
attribute.
print(model.variables)
Out:
['p', 't', 'va', 'br', 'vp', 'jp', 'jr', 'bp', 'vr', 'bt', 'vt', 'rho', 'jt']
Set parameters for plotting. This line will give us a horizontal errorbar underneath the plots.
cbar_kwargs = {'orientation': 'horizontal'}
Plot the slices
ax = plt.subplot(projection='polar')
model['vr'].plot_equatorial_cut(ax=ax, cbar_kwargs=cbar_kwargs)
plt.show()

Total running time of the script: ( 0 minutes 0.711 seconds)