Figures and Finished Plots¶
pyharm includes a long list of different movie and plot types with which one can visualize a particular dump file. The names of the following functions can all be passed to pyharm-movie to generate frames of that type, ranging from imaging just one dump to many entire runs. In addition, if passed a key corresponding to a FluidDump variable instead of a particular movie name (e.g. the examples in Keys), it will just attempt to plot that variable.
Keys when plotting¶
In addition to the title or variable name, there are a few modifiers parsed specifically when requesting plots, which generally come after any relevant variable. The list of postfix options can be gleaned from pyharm.plots.frame but includes at least:
- _array for plots in native coordinates on the Cartesian logical grid
- _poloidal or _2d, _toroidal for plotting just one slice or plotting 2D simulation output
- _1d likewise for radial/1D simulation output
- _ghost for plotting ghost zones (works best with _array)
- _simple to turn off axis labels, ticks, and colorbars for a presentation or outreach movie, or if you just need the screen real-estate
There is one exception, which was written to emulate the log_ unary operator for fluid dumps: symlog_. Prefixing symlog_ will plot using pyharm.plots.plot_utils.pcolormesh_symlog(), which can plot signed variables in a consistent two-tone log scale. In addition, log_ is reserved to be able to have a different function when plotting – in the future it will just set the axis or colorbar when plotting, rather than taking the \(log_{10}\) of the variable.
Figures¶
Here is the full list of available figures. Most figures should be compatible with most of the above modifiers, but it is not hard to make silly or incompatible combinations, and no effort is made to prevent this in pyharm.
Various full figures, combining plots & settings frequently used together. Similar to the file of the same name in imtools.
-
pyharm.plots.figures.e_ratio(fig, dump, diag, plotrc)¶ Energy ratios, for highlighting tough spots and checking floors are applied there
-
pyharm.plots.figures.e_ratio_funnel(fig, dump, diag, plotrc)¶ Energy ratios on the sphere at a given radius
-
pyharm.plots.figures.ejection(fig, dump, diag, plotrc)¶ Density and magnetic pressure, averaged over phi
-
pyharm.plots.figures.energies(fig, dump, diag, plotrc)¶ Energy scalars rho, u, b^2 plotted along with inversion failures
-
pyharm.plots.figures.fails(fig, dump, diag, plotrc)¶ In-depth plots of inversion failures
-
pyharm.plots.figures.floors(fig, dump, diag, plotrc)¶ Plot which floor are hit where
-
pyharm.plots.figures.old_floors(fig, dump, diag, plotrc)¶ Plot floor hits from iharm3d output
-
pyharm.plots.figures.prims(fig, dump, diag, plotrc, log=True, simple=False, type='poloidal')¶ Each primitive variable in each of 8 panes
-
pyharm.plots.figures.simple(fig, dump, diag, plotrc)¶ Like ‘simpler’, but adds accretion rate Mdot
-
pyharm.plots.figures.simpler(fig, dump, diag, plotrc)¶ Like ‘simplest’, but with EH magnetization phi_b
-
pyharm.plots.figures.simplest(fig, dump, diag, plotrc, type='both', var='log_rho')¶ Slices of the log10 of one variable without color bars for outreach animations. Note that this animation fudges colorbars, using different scales for left & right
-
pyharm.plots.figures.traditional(fig, dump, diag, plotrc)¶ 8-pane movie: XZ and XY slices of rho & UU on top, with a zoomed version and EH fluxes on the bottom
-
pyharm.plots.figures.vecs_con(fig, dump, diag, plotrc)¶ Contravariant 4-vector components ucon, bcon
-
pyharm.plots.figures.vecs_cov(fig, dump, diag, plotrc)¶ Covariant 4-vector components ucov, bcov
-
pyharm.plots.figures.vecs_prim(fig, dump, diag, plotrc)¶ Poloidal plots of primitive vector components U1,U2,U3,B1,B2,B3 along with plots of rho
Pretty Names¶
pyharm has some tools for translating to (or trying to guess) the “pretty” LaTeX name of a variable based on its name in pyharm. Generally this just involves calling pyharm.pretty(varname)(), with the rest happening in the background, but should it be necessary here’s the full doc.
This file provides a function ‘pretty’ which takes a variable name used in pyharm, and returns the LaTeX form of the name, suitable for plot axes/titles.
-
pyharm.plots.pretty.pretty(var, segment=False)¶ Return a pretty LaTeX form of the named variable