emout.core package¶
Subpackages¶
- emout.core.backtrace package
- Submodules
- emout.core.backtrace.backtrace_result module
- emout.core.backtrace.multi_backtrace_result module
- emout.core.backtrace.probability_result module
- emout.core.backtrace.solver_wrapper module
- emout.core.backtrace.trace_result module
- emout.core.backtrace.trace_wrapper module
- emout.core.backtrace.xy_data module
- Module contents
- emout.core.boundaries package
- emout.core.data package
- Submodules
- emout.core.data.data module
DataData.datafileData.nameData.slicesData.slice_axesData.axisunitsData.valunitData.axis()Data.boundariesData.boundaryData.build_frame_updater()Data.directoryData.filenameData.flip()Data.gifplot()Data.inpData.masked()Data.mirror()Data.negate()Data.plot()Data.scale()Data.tData.t_siData.tile()Data.to_numpy()Data.tsliceData.unitData.use_axesData.val_siData.xData.x_siData.xsliceData.yData.y_siData.ysliceData.zData.z_siData.zslice
Data1dData2dData3dData4dLocalDataAccessDisabledError
- emout.core.data.griddata_series module
GridDataMeanGridDataMean.boundariesGridDataMean.boundaryGridDataMean.directoryGridDataMean.filenameGridDataMean.inpGridDataMean.materialize()GridDataMean.ndimGridDataMean.plot()GridDataMean.plot_surfaces()GridDataMean.shapeGridDataMean.slice_axesGridDataMean.slicesGridDataMean.to_numpy()GridDataMean.unitGridDataMean.use_axes
GridDataSelectionGridDataSelection.axis()GridDataSelection.boundariesGridDataSelection.boundaryGridDataSelection.build_frame_updater()GridDataSelection.directoryGridDataSelection.filenameGridDataSelection.gifplot()GridDataSelection.inpGridDataSelection.materialize()GridDataSelection.max()GridDataSelection.mean()GridDataSelection.min()GridDataSelection.ndimGridDataSelection.plot()GridDataSelection.plot_surfaces()GridDataSelection.select_space()GridDataSelection.shapeGridDataSelection.slice_axesGridDataSelection.slicesGridDataSelection.tGridDataSelection.t_siGridDataSelection.to_numpy()GridDataSelection.unitGridDataSelection.use_axesGridDataSelection.xGridDataSelection.x_siGridDataSelection.yGridDataSelection.y_siGridDataSelection.zGridDataSelection.z_si
GridDataSeriesGridDataSeries.datafileGridDataSeries.h5GridDataSeries.groupGridDataSeries.nameGridDataSeries.chain()GridDataSeries.close()GridDataSeries.directoryGridDataSeries.filenameGridDataSeries.grid_shapeGridDataSeries.lazyGridDataSeries.ndimGridDataSeries.shapeGridDataSeries.time_series()GridDataSeries.trange
MultiGridDataSeriesMultiGridDataSeries.datafileMultiGridDataSeries.nameMultiGridDataSeries.tunitMultiGridDataSeries.axisunitMultiGridDataSeries.valunitMultiGridDataSeries.close()MultiGridDataSeries.directoriesMultiGridDataSeries.directoryMultiGridDataSeries.filenameMultiGridDataSeries.filenamesMultiGridDataSeries.grid_shapeMultiGridDataSeries.time_series()
- emout.core.data.vector_data module
VectorDataVectorData.axisunitsVectorData.build_frame_updater()VectorData.component_axesVectorData.gifplot()VectorData.materialize()VectorData.nameVectorData.ndimVectorData.negate()VectorData.plot()VectorData.plot2d()VectorData.plot3d()VectorData.plot3d_mpl()VectorData.scale()VectorData.shapeVectorData.slice_axesVectorData.slicesVectorData.to_numpy()VectorData.valunit
VectorData2dVectorData3d
- Module contents
- emout.core.io package
- emout.core.relocation package
Submodules¶
emout.core.extraction module¶
Data extraction utilities for saving subsets of EMSES output.
Provides EmoutDataExtraction which wraps an Emout instance
and automatically persists accessed grid data as HDF5 snapshots.
- class emout.core.extraction.EmoutDataExtraction(root, data, nparent=1)[source]¶
Bases:
objectWrapper around
Emoutthat persists accessed data to disk.Every grid field accessed via attribute lookup is automatically saved as an HDF5 snapshot (last timestep only) into an extraction directory, enabling lightweight data subsets for post-processing or transfer.
- property backtrace: BacktraceWrapper¶
Return the backtrace solver wrapper.
- Returns:
Backtrace API bound to the underlying simulation data.
- Return type:
- property directory¶
Return the base simulation directory.
- Returns:
Root output directory of the wrapped
Emoutinstance.- Return type:
Path
- property extract_dir¶
Compute the extraction output directory.
The path is derived from
directoryby taking the last nparent path components and appending them to root.- Returns:
Directory where extracted HDF5 snapshots are written.
- Return type:
Path
- property icur: DataFrame¶
Return the
icurdiagnostic file as a DataFrame.- Returns:
Table with step numbers and per-species / per-body current columns parsed from the
icurtext file.- Return type:
pd.DataFrame
- property inp¶
Return the input parameter file.
- Returns:
Parsed
plasma.inpparameters, orNoneif unavailable.- Return type:
InpFile or None
- is_valid()[source]¶
Check whether the underlying dataset is valid.
- Returns:
Whether the simulation completed successfully.
- Return type:
- property ocur: DataFrame¶
Return the
ocurdiagnostic file as a DataFrame.- Returns:
Table with step numbers and per-species / per-body outward-current columns parsed from the
ocurtext file.- Return type:
pd.DataFrame
- property pbody: DataFrame¶
Return the
pbodydiagnostic file as a DataFrame.- Returns:
Table with a
stepcolumn and per-body conductor-potential columns parsed from thepbodytext file.- Return type:
pd.DataFrame
- save_hdf5(name)[source]¶
Save the last timestep of the named field to an HDF5 file.
The file is written to
extract_diras{name}00_0000.h5. If the file already exists the write is skipped.- Parameters:
name (str) – Grid-data field name (e.g.
"phisp","ex").
- property trace: TraceWrapper¶
Return the high-level trace workflow wrapper.
emout.core.facade module¶
Facade class that provides unified access to EMSES simulation outputs.
The Emout class aggregates directory inspection, grid data loading,
particle data, boundary modelling, and backtrace analysis into a single
entry point.
- class emout.core.facade.Emout(directory='./', append_directories=None, ad=None, inpfilename='plasma.inp', input_path=None, output_directory=None, local_data_policy=None, article_mode=None, article_records_path=None, records_path=None, article_name=None, article_source_name=None, article_archive=None)[source]¶
Bases:
objectFacade class for unified access to EMSES simulation outputs.
- property append_directories: List[Path]¶
Return the list of chained append directories.
- Returns:
Directories concatenated after the main directory during loading.
- Return type:
List[Path]
- available_fields()[source]¶
Return the names of available grid data fields.
Scans the output directory for
*00_0000.h5files and returns the field names (e.g.['ex', 'ey', 'ez', 'phisp']).
- property backtrace: BacktraceWrapper¶
Return the backtrace solver wrapper.
- Returns:
Backtrace API bound to this simulation’s directory and input parameters.
- Return type:
- property boundaries¶
Return the MPIEMSES finbound boundary collection.
Builds
Boundaryinstances from theboundary_typesarray indata.inp(whenboundary_type = 'complex') and returns them as aBoundaryCollection.Examples:
data = Emout("output_dir") # Individual boundary mesh (grid units) mesh = data.boundaries[0].mesh() # SI units with resolution override mesh = data.boundaries[0].mesh(use_si=True, ntheta=96) # Composite mesh of all boundaries composite = data.boundaries.mesh(use_si=True) # Per-boundary keyword overrides composite = data.boundaries.mesh( use_si=True, per={0: {"ntheta": 64}, 1: {"nradial": 12}}, )
- Returns:
Supported finbound boundaries. Returns an empty collection if
data.inpis not loaded or is not in complex mode.- Return type:
- property directory: Path¶
Return the main output directory.
- Returns:
Base directory for EMSES output files.
- Return type:
Path
- property icur: DataFrame¶
Return the
icurdiagnostic file as a DataFrame.- Returns:
Table with step numbers and per-species / per-body current columns parsed from the
icurtext file.- Return type:
pd.DataFrame
- property inp: InpFile | None¶
Return the parsed input parameters.
- Returns:
Parsed parameters as an
InpFilecompatible object. Whenplasma.tomlis available, this view is backed by TOML; otherwise it is loaded fromplasma.inp.- Return type:
InpFile or None
- is_valid()[source]¶
Check whether the simulation completed successfully.
- Returns:
True if the last recorded step matches
nstepin the input file.- Return type:
- name2unit = {'axis': <function build_name2unit_mapping.<locals>.<lambda>>, 'b[xyz]': <function build_name2unit_mapping.<locals>.<lambda>>, 'e[xyz]': <function build_name2unit_mapping.<locals>.<lambda>>, 'j.*': <function build_name2unit_mapping.<locals>.<lambda>>, 'nd[1-9]\\d*p': <function ndp_unit>, 'p[1-9][xyz]': <function build_name2unit_mapping.<locals>.<lambda>>, 'p[1-9]tid': <function build_name2unit_mapping.<locals>.<lambda>>, 'p[1-9]v[xyz]': <function build_name2unit_mapping.<locals>.<lambda>>, 'phisp': <function build_name2unit_mapping.<locals>.<lambda>>, 'rb[xyz]': <function build_name2unit_mapping.<locals>.<lambda>>, 're[xyz]': <function build_name2unit_mapping.<locals>.<lambda>>, 'rho': <function build_name2unit_mapping.<locals>.<lambda>>, 'rhobk': <function build_name2unit_mapping.<locals>.<lambda>>, 'rhobkac[1-9]': <function build_name2unit_mapping.<locals>.<lambda>>, 'rhobksp[1-9]': <function build_name2unit_mapping.<locals>.<lambda>>, 't': <function t_unit>}¶
- property ocur: DataFrame¶
Return the
ocurdiagnostic file as a DataFrame.- Returns:
Table with step numbers and per-species / per-body outward-current columns parsed from the
ocurtext file.- Return type:
pd.DataFrame
- particle(species)[source]¶
Return a ParticlesSeries for the given species.
- Parameters:
species (int) – Particle species number (1-based)
- Returns:
Particle data series for the specified species.
- Return type:
ParticlesSeries
- property pbody: DataFrame¶
Return the
pbodydiagnostic file as a DataFrame.- Returns:
Table with a
stepcolumn and per-body conductor-potential columns parsed from thepbodytext file.- Return type:
pd.DataFrame
- property toml¶
Return the parsed TOML configuration.
Only available when
plasma.tomlexists. Provides attribute access to the structured TOML data, e.g.data.toml.species[0].wp. Entries usinggroup_id(*_groups) are expanded at load time and the group tables are removed from the returned object.- Returns:
Parsed TOML data, or
Noneif unavailable.- Return type:
TomlData or None
- property trace: TraceWrapper¶
Return the high-level trace workflow wrapper.
emout.core.units module¶
Unit mapping from EMSES field names to physical-unit translators.
Defines build_name2unit_mapping() which creates a regex-keyed
dictionary that maps grid-data names (e.g. phisp, bx, nd1p)
to factory functions producing UnitTranslator instances.
- emout.core.units.build_name2unit_mapping(max_ndp=9)[source]¶
Build a regex dictionary mapping field-name patterns to unit-translator factories.
- emout.core.units.nd3p_unit(out)[source]¶
Return a unit translator for species-3 grid-density (
nd3p).- Parameters:
out (Emout) – Source
Emoutinstance providing plasma parameters.- Returns:
Translator converting grid-density to number density in /cc for species 3.
- Return type:
- emout.core.units.ndp_unit(out)[source]¶
Return a unit translator for grid-density fields (
nd*p).- Parameters:
out (Emout) – Source
Emoutinstance providing plasma parameters.- Returns:
Translator converting grid-density to number density in /cc.
- Return type:
- emout.core.units.none_unit(out)[source]¶
Return an identity (dimensionless) unit translator.
- Parameters:
out (Emout) – Source
Emoutinstance (unused, kept for API consistency).- Returns:
Identity translator (dimensionless).
- Return type:
- emout.core.units.t_unit(out)[source]¶
tの単位変換器を生成する.
- Parameters:
out (Emout) – Emoutオブジェクト
- Returns:
tの単位変換器
- Return type:
- emout.core.units.wpet_unit(out)[source]¶
wpe * tの単位変換器を生成する.
以下のコードを実行することで、データのt軸をwpe*tで規格化できる.
>>> Emout.name2unit['t'] = wpet_unit
- Parameters:
out (Emout) – Emoutオブジェクト
- Returns:
wpe * tの単位変換器
- Return type:
Module contents¶
Core domain model for the emout package.
Provides the Emout facade and supporting modules for data access,
I/O, boundary modelling, backtrace analysis, field relocation, and unit
conversion.