pyrokinetics.kinetics.kinetics.Kinetics#
- class pyrokinetics.kinetics.kinetics.Kinetics(kinetics_type, **kwargs)[source]#
Bases:
ReadableFromFileContains all the kinetic data in the form of Species objects. Data can be accessed via
species_data, which is a CleverDict with each key being a species name. For example, electron data can be accessed via a call tokinetics.species_data["electron"]orkinetics.species_data.electron.Each Species is provided with:
- psi_n: ArrayLike [units] dimensionless
1D array of normalised poloidal flux for each flux surface where data is defined
- r/a: ArrayLike [units] dimensionless
1D array of normalised minor radius for each flux surface. This is needed for derivatives w.r.t rho (r/a)
- Charge: Int [units] elementary_charge
Charge of each species
- Mass: ArrayLike [units] kg
Mass of each species
- Temperature: ArrayLike [units] eV
1D array of the species temperature profile
- Density: ArrayLike [units] meter**-3
1D array of the species density profile
- Rotation: ArrayLike [units] /second
1D array of the species rotation profile
- Parameters:
Methods
__init__(kinetics_type, **kwargs)from_file(path[, file_type])Read a file from disk, returning an instance of this class.
plot([ax, show, x_grid])Plot a quantity defined on the \(\psi\) grid.
supported_file_types()Returns a list of all registered file types.
Attributes
Stored reference of the last kinetics type.
Number of species
Names of each species
CleverDictcontaining kinetics info for each species.- property kinetics_type#
Stored reference of the last kinetics type. May be inferred
- property nspec#
Number of species
- plot(ax=None, show=False, x_grid=None, **kwargs)[source]#
Plot a quantity defined on the \(\psi\) grid.
- Parameters:
quantity (
str) – Name of the quantity to plot. Must be defined over the gridpsi.ax (
Optional[plt.Axes]) – Axes object on which to plot. If not provided, a new figure is created.show (
bool, defaultFalse) – Immediately show Figure after creation.x_grid (
Optional[str], defaultNone) – Radial grid to plot against. Options are psi_n (default) and r/a**kwargs – Additional arguments to pass to Matplotlib’s
plotcall.
- Returns:
The Axes object created after plotting.
- Return type:
plt.Axes- Raises:
ValueError – If
quantityis not a quantity defined over the \(\psi\) grid, or is not the name of an Equilibrium quantity.
- species_data#
CleverDictcontaining kinetics info for each species. May include entries such as ‘electron’ and ‘deuterium’
- property species_names#
Names of each species