CADETProcess.solution.slice_solution

Contents

CADETProcess.solution.slice_solution#

CADETProcess.solution.slice_solution(solution_original, components=None, use_total_concentration=False, use_total_concentration_components=False, coordinates=None)[source]#

Slice a Solution object along specified dimensions, components or both.

Parameters:
solution_originalSolution

The Solution object to slice.

componentsstr or list of str, optional

The names of the components to keep in the sliced Solution. If None, all components are kept. Defaults to None.

use_total_concentrationbool, optional

If True, only the total concentration data is kept in the sliced Solution. Defaults to False.

use_total_concentration_componentsbool, optional

If True, the total concentration data is kept for each individual species of each component in the sliced Solution. Defaults to False.

coordinatesdict, optional

A dictionary mapping dimensions to slice coordinates. Each dimension in the Solution object is represented by a key in the dictionary, and the corresponding value is a tuple of two or three elements specifying the start, stop and step coordinates of the slice along that dimension. If a value is None, the corresponding coordinate is not sliced. Defaults to None.

Returns:
Solution

A new Solution object representing the sliced data.

Raises:
ValueError

If any of the slice coordinates exceeds the bounds of its corresponding dimension.

CADETProcessError

If any of the specified components or dimensions does not exist in the original Solution.