Parameter File (data.inp)
emout reads the EMSES parameter file (plasma.inp or plasma.toml) and exposes it as a dictionary-like object with attribute access.
Accessing Parameters
import emout
data = emout.Emout("output_dir")
# Dictionary-style access with group name
data.inp["tmgrid"]["nx"] # → e.g., 256
data.inp["plasma"]["wp"] # → e.g., [1.0, 0.05]
# Group name can be omitted if the parameter name is unambiguous
data.inp["nx"] # → same as data.inp["tmgrid"]["nx"]
# Attribute-style access
data.inp.tmgrid.nx
data.inp.nx # Group name omitted
Commonly Used Parameters
Grid
Parameter |
Group |
Description |
|---|---|---|
|
|
Grid dimensions |
|
|
Grid spacing (in EMSES units; see |
nx, ny, nz = data.inp.nx, data.inp.ny, data.inp.nz
Time
Parameter |
Group |
Description |
|---|---|---|
|
|
Time step |
|
|
Output interval (every |
|
|
Total number of steps |
dt = data.inp.dt
total_time_steps = data.inp.nstep
output_interval = data.inp.ifdiag
Plasma
Parameter |
Group |
Description |
|---|---|---|
|
|
Number of particle species |
|
|
Plasma frequency per species |
|
|
Charge-to-mass ratio per species |
|
|
Thermal velocity per species |
|
|
Thermal velocity (alternative) |
nspec = data.inp.nspec
wp = data.inp.wp # list of plasma frequencies
qm = data.inp.qm # list of charge-to-mass ratios
Boundaries
Parameter |
Group |
Description |
|---|---|---|
|
|
Boundary type per axis (0=periodic, 1=Dirichlet, 2=Neumann) |
btypes = data.inp.mtd_vbnd # e.g., [0, 2, 0] for periodic-Neumann-periodic
TOML Format (plasma.toml)
When plasma.toml exists, emout automatically runs toml2inp to generate plasma.inp, then loads it.
The toml2inp command is bundled with MPIEMSES3D.
data = emout.Emout("output_dir")
data.inp.nx # Same interface regardless of file format
Accessing Raw TOML Structure
Use data.toml for direct access to the native TOML structure:
data.toml # TomlData wrapper (None if plasma.inp only)
data.toml.tmgrid.nx # attribute access
data.toml["tmgrid"]["nx"] # dict-style access
data.toml.species[0].wp # nested structures
The TOML format uses section headers corresponding to namelist groups:
[tmgrid]
nx = 256
ny = 256
nz = 512
dt = 0.5
[[species]]
wp = 1.0
qm = -1.0
[[species]]
wp = 0.05
qm = 0.001
Separating Input and Output
data = emout.Emout(input_path="/path/to/plasma.toml", output_directory="output_dir")
Unit Conversion Key
The first line of plasma.inp may contain a unit conversion key:
!!key dx=[0.5],to_c=[10000.0]
dx: Grid spacing in meters [m]to_c: Speed of light in EMSES internal units
This key enables SI unit conversion via data.unit. In plasma.toml, this is expressed as:
[meta.unit_conversion]
dx = 0.5
to_c = 10000.0
If no conversion key is present, data.unit will be None and SI features (val_si, use_si=True) will fall back to raw EMSES units.