ibex.data_source.imas_python_source_utils.expand

ibex.data_source.imas_python_source_utils.expand(data: list, grid_shape: list)

Expands 1D data to a multidimensional grid using NumPy broadcasting.

The function reshapes the input array and broadcasts it over the given grid dimensions so that the result matches the original coordinate shape (un-flattened).

Parameters:
data: list

1D input array of shape (N,)

grid_shape: list

target grid shape (e.g. [4, 3, 5])

Returns:

broadcasted array of shape (*grid_shape, N)

Raises:

ValueError – if input data is not 1-dimensional