cherab.imas.ids.common.species.get_ion_state¶

cherab.imas.ids.common.species.get_ion_state(state: IDSStructure, state_index: int, elements: list[Element], grid_subset_index: int | None = None) tuple[str, frozenset]Source¶

Get a unique identifier for an ion state.

Parameters:
state: IDSStructure¶

The ion_state structure from IMAS.

state_index: int¶

Index of the state in the list of states.

elements: list[Element]¶

List of elements that make up the ion state.

grid_subset_index: int | None = None¶

The grid subset index to use for 1D profiles, by default None.

Returns:

  • species_type (str) – The type of species: ‘ion’, ‘ion_bundle’, ‘molecule’, or ‘molecular_bundle’.

  • species_id (frozenset) – A frozenset of key-value pairs that uniquely identify the species.