emout.core.io package

Submodules

emout.core.io.directory module

Directory inspection and input-file discovery for EMSES runs.

DirectoryInspector locates plasma.inp / plasma.toml, resolves append-directory chains, and provides lazy access to parsed input parameters and unit conversion objects.

class emout.core.io.directory.DirectoryInspector(directory, append_directories=None, inpfilename='plasma.inp', input_path=None, output_directory=None)[source]

Bases: object

Directory discovery and input-file loading helper for Emout.

Provides main_directory, append_directories, inp (InpFile), and unit (Units) to the facade layer.

property inp: InpFile | None

Return the parsed input parameter file.

Returns:

Parsed plasma.inp if loaded, otherwise None.

Return type:

InpFile or None

is_valid()[source]

Check whether the simulation completed successfully.

Compare the last step in the icur file against nstep from the input parameters.

Return type:

bool

read_icur_as_dataframe()[source]

Read the icur diagnostic file as a DataFrame.

Returns:

Table with step and per-species/per-body current columns.

Return type:

pandas.DataFrame

read_pbody_as_dataframe()[source]

Read the pbody diagnostic file as a DataFrame.

Returns:

Table with step and per-body particle-count columns.

Return type:

pandas.DataFrame

property toml

Return the parsed TOML configuration.

Only available when plasma.toml exists. Provides attribute access to the structured TOML, e.g. data.toml.species[0].wp. Group defaults (group_id) are expanded into each entry.

Returns:

Parsed TOML data, or None if unavailable.

Return type:

TomlData or None

property unit: Units | None

Return the unit conversion object.

Returns:

Unit translators if a conversion key was found, otherwise None.

Return type:

Units or None

emout.core.io.grid module

Grid data loading from EMSES HDF5 output files.

GridDataLoader resolves field names (including relocated fields and vector components) and returns GridDataSeries or VectorData instances.

class emout.core.io.grid.GridDataLoader(dir_inspector, name2unit_map)[source]

Bases: object

Resolve EMSES field names and load grid data from HDF5 files.

Supports plain scalars, relocated electric/magnetic fields (re*, rb*), and multi-axis vector fields ({name}xy, {name}xyz).

load(name)[source]

Load grid data by name, handling relocated and vector fields.

  • r[e/b][xyz] – generate a relocated field.

  • (dname)(axis1)(axis2)(axis3) (xyz permutation) – return VectorData3d.

  • (dname)(axis1)(axis2) – return VectorData2d.

  • Otherwise – return a chained GridDataSeries.

Return type:

Any

emout.core.io.grid.get_tqdm()[source]

Return the appropriate tqdm variant for the current environment.

Module contents

I/O helpers for discovering and reading EMSES output files.