cherab.imas.ids.common.ggd.get_ggd_subset_data¶

cherab.imas.ids.common.ggd.get_ggd_subset_data(ids_struct: IDSStructure, name: str, grid_subset_index: int, field: 'values' | 'coefficients' = 'values') NDArray[float64] | NoneSource¶

Return ids_struct.<name>.<field> on the requested GGD subset.

The list of grid subset indices (GGD subset identifiers) can be seen at https://imas-data-dictionary.readthedocs.io/en/latest/generated/identifier/ggd_subset_identifier.html

Parameters:
ids_struct: IDSStructure¶

The IDS structure containing the GGD data. Must contain a field named “grid_subset_index”.

name: str¶

The name of the GGD field to retrieve (e.g., "electrons").

grid_subset_index: int¶

The index of the GGD subset to retrieve.

field: 'values' | 'coefficients' = 'values'¶

The field to retrieve from the GGD subset, by default “values”.

Returns:

NDArray[numpy.float64] | None – If field is “values”, returns 1D numpy.ndarray. If field is “coefficients”, returns 2D numpy.ndarray. Returns None if the requested GGD subset or field is not present in the IDS structure.

Raises:

ValueError – If field is not one of “values” or “coefficients”.

Examples

>>> get_ggd_subset_data(ids.ggd[0].electrons, "density", 5)
>>> get_ggd_subset_data(ids.ggd[0].ion[0], "temperature", 5, field="coefficients")