ogstools.meshlib.data_processing module#
- ogstools.meshlib.data_processing.difference(base_mesh, subtract_mesh, variable=None)[source]#
Compute the difference of variables between two meshes.
- Parameters:
base_mesh (Mesh) – The mesh to subtract from.
subtract_mesh (Mesh) – The mesh whose data is to be subtracted.
variable (Variable | str | None) – The variable of interest. If not given, all point and cell_data will be processed raw.
- Returns:
A new mesh containing the difference of variable or of all datasets between both meshes.
- Return type:
Mesh
- ogstools.meshlib.data_processing.difference_pairwise(meshes_1, meshes_2, variable=None)[source]#
Compute pairwise difference between meshes from two lists/arrays (they have to be of the same length).
- Parameters:
meshes_1 (list | ndarray) – The first list/array of meshes to be subtracted from.
meshes_2 (list | ndarray) – The second list/array of meshes whose data is subtracted from the first list/array of meshes - meshes_1.
variable (Variable | str | None) – The variable of interest. If not given, all point and cell_data will be processed raw.
- Returns:
An array of meshes containing the differences of variable or all datasets between meshes_1 and meshes_2.
- Return type:
ndarray
- ogstools.meshlib.data_processing.difference_matrix(meshes_1, meshes_2=None, variable=None)[source]#
Compute the difference between all combinations of two meshes from one or two arrays based on a specified variable.
- Parameters:
meshes_1 (list | ndarray) – The first list/array of meshes to be subtracted from.
meshes_2 (list | ndarray | None) – The second list/array of meshes, it is subtracted from the first list/array of meshes - meshes_1 (optional).
variable (Variable | str | None) – The variable of interest. If not given, all point and cell_data will be processed raw.
- Returns:
An array of meshes containing the differences of variable or all datasets between meshes_1 and meshes_2 for all possible combinations.
- Return type:
ndarray