Variable¶
-
class
psipy.model.mas.
Variable
(data, name, unit)¶ Bases:
object
A single scalar variable.
This class primarily contains methods for plotting data. It can be created with any
xarray.DataArray
that has['theta', 'phi', 'r']
fields.- Parameters
- dataxarray.DataArray
Variable data.
- namestr
Variable name.
- unitastropy.units.Quantity
Variable unit.
Attributes Summary
DataFrame with the data.
Units of the scalar data.
Methods Summary
contour_equatorial_cut
(levels[, ax])Plot contours on an equatorial cut.
contour_phi_cut
(i, levels[, ax])Plot contours on a phi cut.
contour_radial_cut
(i, levels[, ax])Plot contours on a radial cut.
plot_equatorial_cut
([ax])Plot an equatorial cut.
plot_phi_cut
(i[, ax])Plot a phi cut.
plot_radial_cut
(i[, ax])Plot a radial cut.
radial_normalized
(radial_exponent)Return a radially normalised copy of this variable.
Attributes Documentation
-
data
¶ DataFrame with the data.
-
unit
¶ Units of the scalar data.
Methods Documentation
-
contour_equatorial_cut
(levels, ax=None, **kwargs)¶ Plot contours on an equatorial cut.
- Parameters
- levelslist
List of levels to contour.
- axmatplolit.axes.Axes, optional
axes on which to plot. Defaults to current axes if not specified.
- kwargs :
Additional keyword arguments are passed to
xarray.plot.contour
.
-
contour_phi_cut
(i, levels, ax=None, **kwargs)¶ Plot contours on a phi cut.
- Parameters
- iint
Index at which to slice the data.
- levelslist
List of levels to contour.
- axmatplolit.axes.Axes, optional
axes on which to plot. Defaults to current axes if not specified.
- kwargs :
Additional keyword arguments are passed to
xarray.plot.contour
.
-
contour_radial_cut
(i, levels, ax=None, **kwargs)¶ Plot contours on a radial cut.
- Parameters
- iint
Index at which to slice the data.
- levelslist
List of levels to contour.
- axmatplolit.axes.Axes, optional
axes on which to plot. Defaults to current axes if not specified.
- kwargs :
Additional keyword arguments are passed to
xarray.plot.contour
.
-
plot_equatorial_cut
(ax=None, **kwargs)¶ Plot an equatorial cut.
- Parameters
- axmatplolit.axes.Axes, optional
axes on which to plot. Defaults to current axes if not specified.
- kwargs :
Additional keyword arguments are passed to
xarray.plot.pcolormesh
.
-
plot_phi_cut
(i, ax=None, **kwargs)¶ Plot a phi cut.
- Parameters
- iint
Index at which to slice the data.
- axmatplolit.axes.Axes, optional
axes on which to plot. Defaults to current axes if not specified.
- kwargs :
Additional keyword arguments are passed to
xarray.plot.pcolormesh
.
-
plot_radial_cut
(i, ax=None, **kwargs)¶ Plot a radial cut.
- Parameters
- iint
Index at which to slice the data.
- axmatplolit.axes.Axes, optional
axes on which to plot. Defaults to current axes if not specified.
- kwargs :
Additional keyword arguments are passed to
xarray.plot.pcolormesh
.
-
radial_normalized
(radial_exponent)¶ Return a radially normalised copy of this variable.
Returns var**gamma, where gamma is the given exponent.
- Parameters
- radial_exponentfloat
- Returns
- Variable