pyrokinetics.kinetics.imas.KineticsReaderIMAS#

class pyrokinetics.kinetics.imas.KineticsReaderIMAS[source]#

Bases: FileReader

Class that can read IMAS core_profile h5 files and return Kinetics objects. Users are not recommended to instantiate this class directly, and should instead use the functions read_kinetics or Kinetics.read_from_file. Keyword arguments passed to those functions will be forwarded to this class.

IMAS core_profiles do not contain information about the minor radius, so it is necessary to pass an Equilibrium` object to ``read_from_file. This contains the mapping from \(\psi_\text{N} \rightarrow r/a\).

See also

Kinetics

Class representing a 1D profiles of species data

read_kinteics

Read a kinetics file, return an Kinetics.

__init__()#

Methods

__init__()

read_from_file(filename[, time_index, time, eq])

verify_file_type(filename)

Quickly verify that we're looking at a IMAS file without processing

Attributes

file_type: ClassVar[str] = 'IMAS'#
read_from_file(filename, time_index=-1, time=None, eq=None)[source]#
Parameters:
  • filename (Pathlike) – Path to IMAS HDF5 file

  • time (Optional[float]) – The time, in seconds, at which kinetics data should be taken. Data will be drawn from the time closest to the provided value. Users should only provide one of time or time_index. If neither is provided, data is drawn at the last time stamp.

  • time_index (Optional[int]) – As an alternative to providing the time directly, users may provide the index of the desired time stamp.

  • eq (Equilibrium) – Equilibrium object containing the mapping from \(psi_\text{N} \rightarrow r/a\)

Return type:

Kinetics

verify_file_type(filename)[source]#

Quickly verify that we’re looking at a IMAS file without processing

Return type:

None

Parameters:

filename (PathLike | str)