spacepy.pybats.ram.PressureFile

class spacepy.pybats.ram.PressureFile(filename, *args, **kwargs)[source]

A class for reading and visualizing pressure_####.in files.

__init__(filename, *args, **kwargs)[source]

Base class for “Data Model” representation data

Abstract method, reimplement

Attributes:
attrsdict

dictionary of the attributes of the SpaceData object

Methods

add_cont_press([var, n, target, maxz, minz, ...])

Create a polar log-axis contour plot of pressure and add it to target.

add_pcol_press([var, target, maxz, minz, ...])

Add a pcolor plot of the pressure object to target.

Attributes

add_cont_press(var='total', n=31, target=None, maxz=1000.0, minz=1.0, loc=111, add_cbar=False, npa=False, labelsize=15, title='auto', cmap='inferno', **kwargs)[source]

Create a polar log-axis contour plot of pressure and add it to target. For speedier plots, use plot_cont_press, which makes its own axis.

Parameters:
varstring

The variable within the object to plot. Defaults to ‘total’. Can be set to other species-specific pressure values.

ninteger

The number of contours. Defaults to 31.

maxzreal

The color bar maximum. Defaults to 1000.0

minzreal

The color bar minimum. Defaults to 1.0.

add_cbarbool

Set whether to add a color bar or not. Defaults to False.

cmapstring

Set name of contour color map to use. Defaults to ‘inferno’.

npabool

If True, plot in units of nanopascal instead of energy density. Defaults to False.

labelsizeint

Sets the font size of the labels. Defaults to 15.

titlestring

Sets the plot title. Defaults to ‘auto’, using the variable label.

targetFigure or Axes

If None (default), a new figure is generated from scratch. If a matplotlib Figure object, a new axis is created to fill that figure. If a matplotlib Axes object, the plot is placed into that axis.

locint

Use to specify the subplot placement of the axis (e.g. loc=212, etc.) Used if target is a Figure or None. Default 111 (single plot).

Returns:
figmatplotlib figure object
axmatplotlib axes object
contmatplotlib contour object
cbarmatplotlib colorbar object
add_pcol_press(var='total', target=None, maxz=1000.0, minz=1.0, add_cbar=False, loc=111, labelsize=15, title='auto')[source]

Add a pcolor plot of the pressure object to target.

Parameters:
varstring

The variable within the object to plot. Defaults to ‘total’. Can be set to other species-specific pressure values.

maxzreal

The color bar maximum. Defaults to 1000.0

minzreal

The color bar minimum. Defaults to 1.0.

add_cbarbool

Set whether to add a color bar or not. Defaults to False.

labelsizeint

Sets the font size of the labels. Defaults to 15.

titlestring

Sets the plot title. Defaults to ‘auto’, using the variable label.

targetFigure or Axes

If None (default), a new figure is generated from scratch. If a matplotlib Figure object, a new axis is created to fill that figure. If a matplotlib Axes object, the plot is placed into that axis.

locint

Use to specify the subplot placement of the axis (e.g. loc=212, etc.) Used if target is a Figure or None. Default 111 (single plot).

Returns:
figmatplotlib figure object
axmatplotlib axes object
contmatplotlib contour object
cbarmatplotlib colorbar object
attrs: collections.abc.Mapping