pyrokinetics.kinetics.kinetics.Kinetics#

class pyrokinetics.kinetics.kinetics.Kinetics(kinetics_type, **kwargs)[source]#

Bases: ReadableFromFile

Contains 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 to kinetics.species_data["electron"] or kinetics.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:
  • kinetics_type (str, default None) – Name of the kinetics input type, such as “SCENE”, “JETTO”, etc.

  • **kwargs – Used to pass in species data.

__init__(kinetics_type, **kwargs)[source]#
Parameters:

kinetics_type (str)

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

kinetics_type

Stored reference of the last kinetics type.

nspec

Number of species

species_names

Names of each species

species_data

CleverDict containing 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 grid psi.

  • ax (Optional[plt.Axes]) – Axes object on which to plot. If not provided, a new figure is created.

  • show (bool, default False) – Immediately show Figure after creation.

  • x_grid (Optional[str], default None) – Radial grid to plot against. Options are psi_n (default) and r/a

  • **kwargs – Additional arguments to pass to Matplotlib’s plot call.

Returns:

The Axes object created after plotting.

Return type:

plt.Axes

Raises:

ValueError – If quantity is not a quantity defined over the \(\psi\) grid, or is not the name of an Equilibrium quantity.

species_data#

CleverDict containing kinetics info for each species. May include entries such as ‘electron’ and ‘deuterium’

property species_names#

Names of each species