DREAMOutput

The DREAM Python interface contains an elaborate set of classes for handling DREAM output data.

Base classes

Equation system

Kinetic quantities

Description

f_hot

Hot electron distribution function

f_re

Runaway electron distribution function

Fluid quantities

Description

E_field

Electric field

j_hot

Hot electron current density

j_ohm

Ohmic current density

j_re

Runaway electron current density

j_tot

Total current density

n_cold

Cold electron density

n_hot

Hot electron density

n_i

Ion densities

n_re

Runaway electron density

n_tot

Total electron density

psi_p

Poloidal flux

T_cold

Cold electron temperature

W_cold

Cold electron energy

Scalar quantities

Description

I_p

Total plasma current

I_wall

Tokamak wall current

psi_edge

Poloidal flux at plasma edge

psi_wall

Poloidal flux at tokamak wall

V_loop_w

Loop voltage at tokamak wall

x_p

SPI shard positions

Y_p

SPI shard radii

Other quantities

Class documentation

class DREAM.DREAMOutput.DREAMOutput(filename=None, path='', lazy=True, loadsettings=True)

Bases: object

__contains__(item)

Overriding the Python in operator and allows to check for the existence of properties of this object.

__getitem__(index)

Retrieves a parameter by name.

__init__(filename=None, path='', lazy=True, loadsettings=True)

Construct a new DREAMOutput object. If filename is given, the object is read from the (HDF5) file with that name. If path is also given, this is used to locate the group in the file which contains the output.

Parameters
  • filename (str) – Name of file to load output from.

  • path (str) – Path to group in HDF5 file containing the output.

  • lazy (bool) – If True, allows the file to be read lazily (on-demand) by return h5py DataSet objects instead of the actual data (wrapped in a DREAM.DataObject). This can greatly reduce load times, but may complicate typing slightly. Note also that the HDF5 file will be locked for as long as the Python interpreter is running.

  • loadsettings (bool) – If True, load the settings stored in the output object.

close()

Close the associated HDF5 File object.

getFileSize()

Returns the size in bytes of the output file.

getFileSize_s(includeBytes=False)

Returns the size in bytes of the output file as a nicely formatted string.

load(filename, path='', lazy=True, loadsettings=True)

Loads DREAM output from the specified file. If ‘path’ is given, this indicates which group path in the file to load the output from.

Parameters
  • filename (str) – Name of file to load output from.

  • path (str) – Path to subsect of HDF5 file containing DREAM output.

  • lazy (bool) – If True, allows the file to be read lazily (on-demand) by return h5py DataSet objects instead of the actual data (wrapped in a DREAM.DataObject). This can greatly reduce load times, but may complicate typing slightly. Note also that the HDF5 file will be locked for as long as the Python interpreter is running.

  • loadsettings (bool) – If True, load the settings stored in the output object.

time2index(t)

Converts the specified time to a time index.