Modules.ProbabilisticMarchingTriangles package
Submodules
Modules.ProbabilisticMarchingTriangles.probabilistic_marching_triangles module
- Modules.ProbabilisticMarchingTriangles.probabilistic_marching_triangles.probabilistic_marching_triangles(ensemble_data, triangle_mesh, points, isovalue, ax=None, colormap='viridis')[source]
Compute and visualize probabilistic marching triangles.
This function implements the complete stats->mesh->vis pipeline for probabilistic marching triangles visualization. It calculates the probability of isocontour presence in each triangle and creates a matplotlib visualization.
Parameters:
- ensemble_datanp.ndarray
2D array of shape (n_points, n_ensemble) where each column is a realization and each row corresponds to a vertex in the triangular mesh.
- triangle_meshnp.ndarray
2D array of shape (n_triangles, 3) with triangle indices.
- pointsnp.ndarray
2D array of shape (n_points, 2) with point coordinates.
- isovaluefloat
The isovalue for which to compute the isocontour.
- axmatplotlib.axes.Axes, optional
The axis to draw on. If None, a new figure and axis will be created.
- colormapstr, optional
Colormap for the visualization. Default is ‘viridis’.
Returns:
- axmatplotlib.axes.Axes
The axis with the visualized probabilistic isocontour.
Modules.ProbabilisticMarchingTriangles.probabilistic_marching_triangles_stats module
- Modules.ProbabilisticMarchingTriangles.probabilistic_marching_triangles_stats.probabilistic_marching_triangles_summary_statistics(ensemble_data, triangle_mesh, isovalue)[source]
Compute level crossing probability for probabilistic marching triangles.
This function calculates the probability of an isocontour crossing through each triangle in a 2D triangular mesh based on an ensemble of scalar fields.
Parameters:
- ensemble_datanp.ndarray
2D array of shape (n_points, n_ensemble) where each column is a realization and each row corresponds to a vertex in the triangular mesh.
- triangle_meshnp.ndarray
2D array of shape (n_triangles, 3) representing the triangles. Each row contains the indices of the three vertices forming a triangle.
- isovaluefloat
The isovalue for which to compute the contour crossing probability.
Returns:
- dict
Dictionary containing: - ‘level_crossing_probability’: np.ndarray
1D array of shape (n_triangles,) with probabilities of contour presence in each triangle. Values range from 0 to 1.
Modules.ProbabilisticMarchingTriangles.probabilistic_marching_triangles_vis module
- Modules.ProbabilisticMarchingTriangles.probabilistic_marching_triangles_vis.visualize_probabilistic_marching_triangles(mesh_data, points, triangle_mesh, ax=None, colormap='viridis')[source]
Visualize probabilistic marching triangles using matplotlib.
This function creates a 2D visualization of the crossing probabilities using matplotlib’s tripcolor for triangular meshes.
Parameters:
- mesh_datanp.ndarray
1D array of shape (n_triangles,) with probabilities of contour presence in each triangle.
- pointsnp.ndarray
2D array of shape (n_points, 2) representing the coordinates of the points.
- triangle_meshnp.ndarray
2D array of shape (n_triangles, 3) representing the triangulation of the points.
- axmatplotlib.axes.Axes, optional
The axis to draw on. If None, a new figure and axis will be created.
- colormapstr, optional
Colormap for the probability map. Default is ‘viridis’.
Returns:
- axmatplotlib.axes.Axes
The axis with the visualized probabilistic isocontour.
Module contents
ProbabilisticMarchingTriangles Module
This module provides functionality for performing probabilistic marching triangles on 2D triangular meshes with uncertainty. It includes methods for calculating triangle crossing probabilities and visualizing the results using matplotlib.
- Modules.ProbabilisticMarchingTriangles.probabilistic_marching_triangles(ensemble_data, triangle_mesh, points, isovalue, ax=None, colormap='viridis')[source]
Compute and visualize probabilistic marching triangles.
This function implements the complete stats->mesh->vis pipeline for probabilistic marching triangles visualization. It calculates the probability of isocontour presence in each triangle and creates a matplotlib visualization.
Parameters:
- ensemble_datanp.ndarray
2D array of shape (n_points, n_ensemble) where each column is a realization and each row corresponds to a vertex in the triangular mesh.
- triangle_meshnp.ndarray
2D array of shape (n_triangles, 3) with triangle indices.
- pointsnp.ndarray
2D array of shape (n_points, 2) with point coordinates.
- isovaluefloat
The isovalue for which to compute the isocontour.
- axmatplotlib.axes.Axes, optional
The axis to draw on. If None, a new figure and axis will be created.
- colormapstr, optional
Colormap for the visualization. Default is ‘viridis’.
Returns:
- axmatplotlib.axes.Axes
The axis with the visualized probabilistic isocontour.
- Modules.ProbabilisticMarchingTriangles.probabilistic_marching_triangles_mesh(summary_statistics)[source]
Identity function that passes through summary statistics.
This function exists to maintain consistency with the stats->mesh->vis pipeline architecture used in other modules, even though no mesh transformation is needed for probabilistic marching triangles.
Parameters:
- summary_statisticsdict
Dictionary containing: - ‘level_crossing_probability’: np.ndarray
1D array of shape (n_triangles,) representing the probability of contour presence in each triangle.
Returns:
- level_crossing_probabilitynp.ndarray
1D array of probabilities extracted from the input dictionary.
- Modules.ProbabilisticMarchingTriangles.probabilistic_marching_triangles_summary_statistics(ensemble_data, triangle_mesh, isovalue)[source]
Compute level crossing probability for probabilistic marching triangles.
This function calculates the probability of an isocontour crossing through each triangle in a 2D triangular mesh based on an ensemble of scalar fields.
Parameters:
- ensemble_datanp.ndarray
2D array of shape (n_points, n_ensemble) where each column is a realization and each row corresponds to a vertex in the triangular mesh.
- triangle_meshnp.ndarray
2D array of shape (n_triangles, 3) representing the triangles. Each row contains the indices of the three vertices forming a triangle.
- isovaluefloat
The isovalue for which to compute the contour crossing probability.
Returns:
- dict
Dictionary containing: - ‘level_crossing_probability’: np.ndarray
1D array of shape (n_triangles,) with probabilities of contour presence in each triangle. Values range from 0 to 1.
- Modules.ProbabilisticMarchingTriangles.visualize_probabilistic_marching_triangles(mesh_data, points, triangle_mesh, ax=None, colormap='viridis')[source]
Visualize probabilistic marching triangles using matplotlib.
This function creates a 2D visualization of the crossing probabilities using matplotlib’s tripcolor for triangular meshes.
Parameters:
- mesh_datanp.ndarray
1D array of shape (n_triangles,) with probabilities of contour presence in each triangle.
- pointsnp.ndarray
2D array of shape (n_points, 2) representing the coordinates of the points.
- triangle_meshnp.ndarray
2D array of shape (n_triangles, 3) representing the triangulation of the points.
- axmatplotlib.axes.Axes, optional
The axis to draw on. If None, a new figure and axis will be created.
- colormapstr, optional
Colormap for the probability map. Default is ‘viridis’.
Returns:
- axmatplotlib.axes.Axes
The axis with the visualized probabilistic isocontour.