Skip to content

ITER IMAS mapping

The contract that lines MIF's prescribed inputs up with the machine-agnostic ITER IMAS data model: which IMAS Interface Data Structure (IDS) and path a consumer reads each MIF input from, or publishes it to. It is a contract, not a runtime IMAS reader, and carries no IMAS library dependency.

Contract

  • MIF_IMAS_INPUT_MAP — the verified-at-source mappings. MIF consumes the b_dot_probe_signal from magnetics, the frc_equilibrium_state from equilibrium (COCOS=17 convention), and publishes capacitor_bank_drive to pf_active. Every IDS carries the common ids_properties + time substructures (IMAS_COMMON_SUBSTRUCTURES).
  • mapping_for(signal) — the ImasInputMapping for one MIF signal.
  • ids_names() — the unique IDS names referenced.
  • extract_mif_inputs(payload, *, require=True) — the active consumer: read MIF's consumed inputs out of an IMAS-IDS-path-keyed payload (the inverse of mapping_for(signal).ids_path). Published signals are skipped; a missing consumed path raises KeyError unless require=False.

examples/interop_bridge.py and tests/unit/interop/test_bridge.py round-trip an IMAS payload through extract_mif_inputs.

Python API

imas_mapping

Contract mapping MIF-consumed inputs onto ITER IMAS Interface Data Structures.

This is a contract, not a runtime IMAS reader: it records which IMAS Data Dictionary IDS and path a consumer would read each MIF input from (or publish it to), so MIF's prescribed inputs line up with the machine-agnostic ITER data model. It carries no IMAS library dependency.

The IDS names and the COCOS=17 equilibrium convention are from the ITER IMAS Data Dictionary (magnetics, equilibrium, pf_active are standard IDSs; the magnetics IDS holds flux-loop and b-field-probe measurements). Every IDS carries the common ids_properties substructure and a time base, which the IMAS_COMMON_SUBSTRUCTURES constant records for consumers.

ImasInputMapping(mif_signal, mif_lane, ids_name, ids_path, direction, note) dataclass

One MIF input mapped onto an IMAS IDS path.

Parameters

mif_signal : str The MIF-consumed input (the chamber-side or prescribed sibling signal). mif_lane : str The MIF lane that consumes the signal. ids_name : str The IMAS Interface Data Structure name. ids_path : str The path within the IDS a consumer reads or publishes. direction : str consumed for an input MIF reads, published for a value MIF emits. note : str Provenance or convention note (e.g. the COCOS equilibrium convention).

mapping_for(mif_signal)

Return the IMAS mapping for mif_signal.

Raises KeyError if the signal is not mapped.

ids_names(mappings=None)

Return the sorted unique IMAS IDS names referenced by the mappings.

extract_mif_inputs(imas_payload, *, require=True)

Read MIF's consumed inputs out of an IMAS-path-keyed payload.

imas_payload maps IMAS IDS paths (as in :data:MIF_IMAS_INPUT_MAP) to values, as a consumer reading from the ITER IMAS data model would supply them. Returns {mif_signal: value} for every mapping whose direction is consumed. With require (the default), a missing consumed path raises KeyError; otherwise it is skipped. This is the active consumer of the mapping contract — the inverse pairs with mapping_for(signal).ids_path for a round-trip.