Examples of Visualisation and Analysis tools
Plot method
Plot method is used to plot PLUTO native outputs that are contained within the h5 files, or any calculated data from the superclass such as sonic wave speeds or mach numbers. All controlled via a string passed as data2plot argument. The key values are stored in the object’s attribute “varname_dict”, if none given, the keys are printed in the console and a value error is raised.
- mhd_jet.plot(data2plot=None, log=False, close=False, save=False, title='')
This method plots the simulated data sets output by PLUTO, contained within the h5 file while additionally also plots the wave velocities, machnumbers and other calculated values. Focuses on spatial distributon of the data.
- Arguments:
- data2plot: string variable matching the available data in the data_dict class attribute
default is None
- log: Boolean if values should be log or not
default is False
- close: will not plot the graph
default is False
- save: Argument if the plot should be saved or not
default is False
- title: This will place additional string into the file name when saving
default is ‘’
Hist method
The histogram takes the whole spatial domain, and counts across all cells to compose the histogram data. The data is chosen by the data2plot argument that must be passed when calling the method. All valid strings are contained in the “varname_dict” object attribute which is a dictionary. If none given the key values are printed in the console and a value error is raised.
- mhd_jet.hist(data2plot=None, data2log=False, close=False, save=False, bins=None, log=False)
Method to plot histogram of the data which is passed in as the argument
- Arguments:
- data2plot: string variable matching the available data in the data_dict class attribute
default is None
- data2log: Boolean if y-axis should be log or not
default is False
- close: will not plot the graph
default is False
- save: Argument if the plot should be saved or not
default is False
- bins: Set the number of bins - same as matplotlib histogram method bins argument
default is None
- log: Boolean if values should be log or not
default is False
Shocks method
The shocks method is used to plot magnetohydrodynamic strong shocks, as it is categorised in literature quite often (doi.org/10.1063/1.873124). The plot_shock argument takes a string containing number pairs based on the transition of supersonic, to subsonic across all three wave modes in MHD case. In hydrodynamic case with no magnetic field the ‘12’ also known as fast shock replaces all MHD shocks due to its singular wave mode. Possible values are ‘12, 13, 14, 23, 24, 34’ but any combination of these 2 digit numbers within the given string will plot the defined shocks (fast, slow and a range of intermediate). All shocked cells location are stored in the object’s shocks_list attribute as (X, Y) coordinates, where X and Y are lists.
- mhd_jet.shocks(plot_shock='12, 13, 14, 23, 24, 34', save=False, close=False)
method to plot MHD shocks
- Arguments:
plot_shocks: string that refers to the shock category i.e.: 12, 34, slow, inter close: will not plot the graph
default is False
- save: Argument if the plot should be saved or not
default is False
plot_spacetime method
Space-time diagram is used to give a 2D representation of the full or partial simulation timelapse. It will produce a full read of all data files within the chosen time steps inside the working directory.
- mhd_jet.plot_spacetime(data2plot=None, begin=0, end=-1, radial_step=0, log=False, close=False, save=False)
Space-time diagram plotting method
- Arguments:
- data2plot: string variable matching the available data in the data_dict class attribute
default is None
- begin: the first time step as indicated in the PLUTO output file
defaults is 0
- end: last time step to be loaded in as indicated in the PLUTO output file
defaults is -1
- radial_step: choses the radial step in stencil index to plot
default is 0 for axial symmetry axis
- log: Boolean if values should be log or not
default is False
- close: will not plot the graph
default is False
- save: Argument if the plot should be saved or not
default is False
plot_power method
The power plot method plots the integral of the power at each radial slice across the computational domain. It also initializes the “list_power” object attribute that contains the list of integrated values, in the following sequence: Total system power, total jet power, kinteic jet power, thermal jet power and magnetic jet power
- mhd_jet.plot_power(save=False, close=False)
Plots the power curves for the jet
- Arguments:
- close: will not plot the graph
default is False
- save: Argument if the plot should be saved or not
default is False
plot_energy method
The energy plot method plots the integral of the energy at each radial slice across the computational domain. It also initializes the “list_energy” object attribute that contains the list of integrated values, in the following sequence: Total system energy, total jet energy, kinteic jet energy, thermal jet energy and magnetic jet energy
- mhd_jet.plot_energy(save=False, close=False)
Plots the energy curves for the jet
- Arguments:
- close: will not plot the graph
default is False
- save: Argument if the plot should be saved or not
default is False
plot_energy_density method
The energy plot method plots the integral of the energy density at each radial slice across the computational domain. It also initializes the “list_E_dens” object attribute that contains the list of integrated values, in the following sequence: Total jet energy density, kinteic jet energy density, thermal jet energy density and magnetic jet energy density
- mhd_jet.plot_energy_density(save=False, close=False)
Plots the energy density curves for the jet
- Arguments:
- close: will not plot the graph
default is False
- save: Argument if the plot should be saved or not
default is False
plot_fieldlines method
This method was created to find entangled magnetic field lines at low magnetisation. This is unique to the MHD data, and can only be ploted at a limited uniform sub-grid as defined in PLUTO. It plots the field lines as a stream plot, with the magnetic field magnitude as a countour plot in the background.
- mhd_jet.plot_fieldlines(save=False, close=False, levels=128, min_bxs=None, max_bxs=None, min_bx2=None, max_bx2=None)
Plots a vector plot of the magnetic field lines in the axial-radial plane, while plots the true magnitude of the magnetic field accounted in all 3 directions.
- Arguments:
- save: Argument if the plot should be saved or not
default is False
- close: will not plot the graph
default is False
levels: the resolution of the contour plot (as per matplotlib.pyplot.contour method) min_bxs: minimum value of magnetic field magnitude max_bxs: maximum value of magnetic field magnitude min_bx2: minimum value of magnetic field in x2 direction max_bx2: maximum value of magnetic field in x2 direction
plot_azimuthal_energy method
This method was created for checking jet stability based on Magnetic-Kinetic energy comparison for a self balancing structure as described in doi.org/10.1007/BF00642266
- mhd_jet.plot_azimuthal_energy()
Plots the Kinetic and Magnetic energies as a function of axial distance to compare for stability analysis
oblique_shocks method
Here the oblique shocks’ strength are plotted as a contour plot. The shock calculations are based on the Ranking-Hugoniot relation for an ideal MHD system. It takes in two arguments, one is the minimum of the shock values, the other is the maximum of the shock values in unit less quantity, based on the mach number.
- mhd_jet.oblique_shocks(min=0, max=10000)
Use the Ranking-Hugoniot relation for ideal MHD to find oblique shocks
- Arguments:
min: minimum value of the Mach number max: maximum value of the Mach number