cherab.imas.plasma.load_plasma¶
-
cherab.imas.plasma.load_plasma(*args, time: float =
0, occurrence_core: int =0, edge_args: tuple | None =None, edge_kwargs: dict | None =None, time_edge: float | None =None, occurrence_edge: int =0, grid_ggd: IDSStructure | None =None, grid_subset_id: int | str =5, equilibrium: EFITEquilibrium | None =None, b_field: Function2D | None =None, psi_interpolator: Callable[[float], float] | None =None, mask: Function2D | Function3D | None =None, time_threshold: float =inf, split_ion_bundles: bool =True, atomic_data: AtomicData | None =None, parent: _NodeBase | None =None, **kwargs) PlasmaSource¶ Load core and edge profiles and create a
Plasmaobject.If the
edge_profilesIDS is empty, returns only the core plasma. If thecore_profilesIDS is empty, returns only the edge plasma.To load the edge plasma from a different IMAS entry, use
edge_argsandedge_kwargsto pass different arguments to theDBEntryconstructor.The distribution of each species is defined with
Maxwellianusing its density and temperature profiles, which are mapped to 3D using the providedequilibrium.The ion bundle species are split into their constituent charge states using
solve_coronal_equilibriumwhensplit_ion_bundlesis True and the necessary atomic data is available. Otherwise, ion bundles are ignored with a warning.- Parameters:
- *args¶
Arguments passed to the
DBEntryconstructor.- time: float =
0¶ Time for the core plasma, by default 0.
- occurrence_core: int =
0¶ Occurrence index of the
core_profilesIDS, by default 0.- edge_args: tuple | None =
None¶ Arguments passed to the
DBEntryconstructor for the edge plasma if different from the core plasma. By default None: uses the same as*args.- edge_kwargs: dict | None =
None¶ Keyword arguments passed to the
DBEntryconstructor for the edge plasma if different from the core plasma. By default None: uses the same as**kwargs.- time_edge: float | None =
None¶ Time for the edge plasma. If None, uses
time. By default None.- occurrence_edge: int =
0¶ Occurrence index of the
edge_profilesIDS, by default 0.- grid_ggd: IDSStructure | None =
None¶ Alternative
grid_ggdstructure describing the grid. By default None.- grid_subset_id: int | str =
5¶ Identifier of the grid subset (index or name). By default 5 (
"Cells").- equilibrium: EFITEquilibrium | None =
None¶ Alternative
EFITEquilibriumused to map core profiles. By default None: the equilibrium is read from the same IMAS query as the core profiles. Ignored if the core plasma is not available.- b_field: Function2D | None =
None¶ Alternative 2D interpolator of the magnetic field vector (Br, Bphi, Bz). By default None: the magnetic field is loaded from the
equilibriumIDS.- psi_interpolator: Callable[[float], float] | None =
None¶ Alternative
psi_norm(rho_tor_norm)interpolator. Used only ifpsiis missing in the core grid. By default None. Obtained from theequilibriumIDS.- mask: Function2D | Function3D | None =
None¶ Mask function used for blending:
(1 - mask) * f_edge + mask * f_core. By default, usesEFITEquilibrium’sinside_lcfs.- time_threshold: float =
inf¶ Maximum allowed difference between the requested time and the nearest available time, by default
numpy.inf.- split_ion_bundles: bool =
True¶ Whether to split ion bundles into their constituent charge states using
solve_coronal_equilibrium, by default True.- atomic_data: AtomicData | None =
None¶ Atomic data provider class for this plasma, by default None. If None, some species (e.g. ion_bundle) may not be properly loaded.
- parent: _NodeBase | None =
None¶ Parent node in the Raysect scene graph, by default None. Typically a
Worldinstance.- **kwargs¶
Keyword arguments passed to the
DBEntryconstructor.
- Returns:
Plasma– Plasma object with core and/or edge profiles.- Raises:
RuntimeError – If neither core nor edge profiles are available in the IMAS entry.
ValueError – If the provided equilibrium is not an instance of
EFITEquilibrium.RuntimeError – If there are issues with the core or edge profiles (e.g. missing electron profile, missing density or temperature profiles, empty grids, etc.) that prevent the plasma from being created.