cherab.imas.emitter.load_radiation_emitter

cherab.imas.emitter.load_radiation_emitter(*args, time: float = 0, occurrence: int = 0, args2: tuple | None = None, kwargs2: dict[str, Any] | None = None, time2: float | None = None, occurrence2: int = 0, process_index: int | Collection[int] | None = None, grid_ggd: IDSStructure | None = None, grid_subset_id: int = 5, equilibrium: EFITEquilibrium | None = None, psi_interpolator: Callable[[float], float] | None = None, mask: Function2D | Function3D | None = None, num_toroidal: int = 64, source: 'auto' | 'values' | 'coefficients' = 'auto', time_threshold: float = inf, step: float = 0.01, parent: _NodeBase | None = None, interpolator_cache: 'none' | 'memory' | 'disk' = 'memory', interpolator_cache_dir: str | Path | None = None, **kwargs) Subtract | CylinderSource

Load radiation emissivity and create a single radiation emitter primitive.

There are two sources of emissivity data in the IMAS radiation IDS:
  1. core-region emissivity and/or edge-region emissivity (GGD-based) (values)

  2. emissivity coefficients (JOREK GGD-based) (coefficients)

In the case of (1), one tries to load both core and edge (GGD-based) emissivity values from one IMAS query. If both are available, they are blended using a mask function. If the second IMAS query is provided, (args2, kwargs2, etc.), it is used to load the missing emissivity values if one of them is not available in the first query.

In the case of (2), one tries to load emissivity coefficients from the GGD structure and reconstructs the emissivity based on the Fourier-Bezier method, which is tied to the JOREK specifications.

If source="auto", the function first tries to load emissivity values (1), and if they are not available, it falls back to emissivity coefficients (2). If neither is available, a RuntimeError is raised.

For GGD-based emissivity, the grid interpolator handles cache lookup and persistence internally.

Parameters:
*args

IMAS URI, netCDF path, or legacy positional arguments for imas.DBEntry. For a URI or path, read mode is selected automatically; do not pass "r".

time: float = 0

Time slice to load from the IDS, by default 0.0.

occurrence: int = 0

Occurrence of the radiation IDS, by default 0.

args2: tuple | None = None

URI, netCDF path, or legacy positional DBEntry arguments for the second emissivity. Read mode is selected automatically. If None, the second emissivity is not loaded, by default None.

kwargs2: dict[str, Any] | None = None

Additional DBEntry options for the second emissivity. If None, no options are used, by default None.

time2: float | None = None

Time slice to load for the second emissivity. By default, uses the same time as the first emissivity.

occurrence2: int = 0

Occurrence of the radiation IDS to load for the second emissivity, by default 0.

process_index: int | Collection[int] | None = None

Radiation process identifier index (or indices) to load. By default, all available processes are summed together. Reference: https://imas-data-dictionary.readthedocs.io/en/latest/generated/identifier/radiation_identifier.html The emissivity value array is assumed to follow the same x-axis as the grid subset.

grid_ggd: IDSStructure | None = None

Specific grid GGD structure alternative to the one in the IDS.

grid_subset_id: int = 5

ID of the grid subset to use, by default 5 (= “cells”) subset. Reference: https://imas-data-dictionary.readthedocs.io/en/latest/generated/identifier/ggd_subset_identifier.html

equilibrium: EFITEquilibrium | None = None

Alternative EFITEquilibrium used to map core profiles. By default None: the equilibrium is read from the same IMAS query as the core profiles. Ignored if the core radiation is not available.

psi_interpolator: Callable[[float], float] | None = None

Alternative psi_norm(rho_tor_norm) interpolator. Used only if psi is missing in the core grid, by default None. Obtained from the equilibrium IDS in the same IMAS query as the core profiles.

mask: Function2D | Function3D | None = None

Mask function used for blending: (1 - mask) * f_gdd + mask * f_core. By default, uses EFITEquilibrium’s inside_lcfs.

num_toroidal: int = 64

Number of toroidal subdivisions for 3D grid extension, by default 64. This is used only when the grid is loaded by load_unstruct_grid_2d_extended.

source: 'auto' | 'values' | 'coefficients' = 'auto'

Source for emissivity data: "auto" (tries values then coefficients), "values" (blended emissivity from core profiles + (edge) GGD values), or "coefficients" (reconstruct from Fourier-Bezier coefficients), by default "auto".

step: float = 0.01

Step size for the radiation function interpolator, by default 0.01 m.

parent: _NodeBase | None = None

Parent node in the Raysect scenegraph, by default None.

time_threshold: float = inf

Maximum allowed time difference when loading from IDS, by default inf.

interpolator_cache: 'none' | 'memory' | 'disk' = 'memory'

Interpolator cache strategy, by default "memory". Each strategy is described in the InterpolatorCacheMode type alias.

interpolator_cache_dir: str | Path | None = None

Directory used when interpolator_cache="disk", by default None (uses the system cache directory, e.g., ~/.cache/cherab/imas/interpolators).

**kwargs

Additional imas.DBEntry options, such as dd_version or xml_path.

Returns:

Subtract or Cylinder – Cylindrical emitter primitive with RadiationFunction material.

Raises:
  • ValueError – If source is not one of "auto", "values", or "coefficients".

  • RuntimeError – If no emissivity data is available in either core or GGD radiation data.