pviz Module

pysunrunner.pviz.plot_equatorial_cut(D, ax, var_name='vx1', cmap=None, title=None, r_scale=False, log_scale=False, zmin=None, zmax=None, conversion_units=None)[source]

Function to plot an equatorial cut.

Inputs:

D: PLUTO 3D array of data values

var_name: variable to plot

cmap: colormap name, default is rainbow

title: plot title (optional)

r_scale (logical): if True scaled data is plotted (x R^2) (default is False)

log_scale (logical): if True log10 of data is plotted (default is False)

zmin (scalar): Minimum value for color scaling (optional, if not provided set based on data)

zmax (scalar): Maximum value for color scaling (optional, if not provided set based on data)

conversion_units (scalar): factor to convert units. (optional, default is no conversion)

Outputs:

ax: subplot with equitorial cut of data

Usage:

time_idx = 0

D = pp.pload(time_idx, w_dir='./', datatype='dbl')

var_name = 'vx1'

subplot_kw = {'projection': "polar"}

title = 'Radial Velocity'

fig, ax = plt.subplots(subplot_kw=subplot_kw, figsize=(5, 5))

axs = pviz.plot_equatorial_cut(D=D, var_name=var_name, ax=ax, title=title)

plt.show()

pysunrunner.pviz.plot_phi_cut(D, ax, var_name='vx1', phi_cut=3.141592653589793, cmap=None, title=None, r_scale=False, log_scale=False, zmin=None, zmax=None, conversion_units=None)[source]

Function to plot a Meridonial cut.

Inputs:

D: PLUTO 3D array of data values.

var_name: variable to plot

phi_cut: angle in radians for phi_cut, default is meridonial

cmap: colormap name, default is rainbow

title: plot title (optional)

r_scale (logical): if True scaled data is plotted (x R^2) (default is False)

log_scale (logical): if True log10 of data is plotted (default is False)

zmin (scalar): Minimum value for color scaling (optional, if not provided set based on data)

zmax (scalar): Maximum value for color scaling (optional, if not provided set based on data)

conversion_units (scalar): factor to convert units. (optional, default is no conversion)

Outputs:

ax: subplot with phi cut of data

Usage:

time_idx = 0

D = pp.pload(time_idx, w_dir=local_dir, datatype='dbl')

var_name = 'Bx1'

phi_cut = np.deg2rad(180.0)

subplot_kw = {'projection': "polar"}

cmap= 'coolwarm'

title = 'Scaled Radial Magnetic Field'

log_scale = False

r_scale = True

# convert from code units to nT

b_fac_pluto = 0.0458505

fig, ax = plt.subplots(subplot_kw=subplot_kw, figsize=(5, 5))

ax = pviz.plot_phi_cut(D=D, var_name = var_name, phi_cut = phi_cut, ax = ax,cmap = cmap, title = title, r_scale = r_scale, log_scale=log_scale, conversion_units = b_fac_pluto)

plt.show()

pysunrunner.pviz.plot_slice(D, ax, var_name='vx1', r_cut=None, theta_cut=0.0, phi_cut=3.141592653589793, cmap=None, title=None, xlabel='R (AU)', ylabel='V (km s$^{s-1}$)', r_scale=False, log_scale=False, ymin=None, ymax=None, conversion_units=None)[source]

Function to plot 1-D slices

Inputs:

D: PLUTO 3D array of data values.

var_name: variable name for plotting

r_cut: distance in AU for an r-cut, if None data plotted as a function of r

theta_cut: latitude angle in radians for a theta-cut, default is equatorial, if None cuts are plotted as a function of theta

phi_cut: angle in radians for phi-cut, default is meridonial, if None cuts are plotted as a function of phi

cmap: colormap name

title: plot title

xlabel: x-axis label

ylabel: y-axis label

r_scale (logical): if True scaled data is plotted (x R^2)

log_scale (logical): if True log10 of data is plotted

ymin (scalar): Minimum y-axis value for plot

ymax (scalar): Maximum y-axis value for plot

conversion_units (scalar): factor to convert units. If None, no conversion

Outputs:

ax: A plot with one or more slices

pysunrunner.pviz.plot_stack(pluto_list, ax, var_name='vx1', r_val=1.0, t_val=0.0, p_val=3.141592653589793, stack_dim='p', time=None, cmap=None, title=None, xlabel='Time [hours]', ylabel='', log_scale=False, yshift=None)[source]

Function For a 1-D stack plot

Inputs:

pluto_list: A list with each item a PLUTO 3D array of data values

var_name: variable name for plotting

r_val: distance (in AU) for cut

t_val: latitude (in radians) for cut

p_val: longitude (in radians) for

stack_dim: dimension for the stack plot (r, t, or p)

time: time array (units are hours)

cmap: colormap name

title: plot title

xlabel: x-axis label

ylabel: y-axis label

r_scale (logical): if True scaled data is plotted (x R^2)

log_scale (logical): if True log10 of data is plotted

Outputs: ax: A plot with one or more slices