MASOutput
- class psipy.model.mas.MASOutput(path: PathLike)
Bases:
ModelOutput
The results from a single run of MAS.
This is a storage object that contains a number of
Variable
objects. It is designed to be used like:mas_output = MASOutput('directory') br = mas_output['br']
Notes
Variables are loaded on demand. To see the list of available variables use
MASOutput.variables
, and to see the list of already loaded variables useMASOutput.loaded_variables
.Attributes Summary
List of loaded variable names.
List of all variable names present in the directory.
Methods Summary
cell_centered_v
([extra_phi_coord])Get the velocity vector at the cell centres.
cell_corner_b
([t_idx])Get the magnetic field vector at the cell corners.
Return the units for the radial coordinate.
get_unit
(var)Return the units for a variable, and the factor needed to convert from the model output to those units.
- Returns
load_file
(var)Load data for variable var.
Attributes Documentation
- loaded_variables
List of loaded variable names.
- variables
List of all variable names present in the directory.
Methods Documentation
- cell_centered_v(extra_phi_coord=False)
Get the velocity vector at the cell centres.
Because the locations of the vector component outputs
- Parameters
- extra_phi_coord: bool
If
True
, add an extra phi slice.
- cell_corner_b(t_idx: Optional[int] = None) DataArray
Get the magnetic field vector at the cell corners.
- Parameters
- t_idxint, optional
If more than one timestep is present in the loaded model, a timestep index at which to get the vectors must be provided.
- Returns
- xarray.DataArray
Notes
The phi limits go from 0 to 2pi inclusive, with the vectors at phi=0 equal to the vectors at phi=2pi.
- get_runit()
Return the units for the radial coordinate.
- get_unit(var)
Return the units for a variable, and the factor needed to convert from the model output to those units.
- Returns
- unit
astropy.units.Unit
- factorfloat
- unit
- get_variables()
- Returns
- list
A list of all variable names present in the directory.
- load_file(var)
Load data for variable var.