Modules.ProbabilisticMarchingSquares package
Submodules
Modules.ProbabilisticMarchingSquares.plot module
Modules.ProbabilisticMarchingSquares.probabilistic_marching_squares module
- Modules.ProbabilisticMarchingSquares.probabilistic_marching_squares.probabilistic_marching_squares(ensemble_images, isovalue, ax=None, colormap='viridis')[source]
Compute and visualize probabilistic marching squares.
This function implements the complete stats->mesh->vis pipeline for probabilistic marching squares visualization. It calculates the probability of isocontour presence in each cell and creates a matplotlib visualization.
Parameters:
- ensemble_imagesnp.ndarray
3D array of shape (y_dim, x_dim, n_ensemble) representing the scalar field with ensemble members.
- 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.ProbabilisticMarchingSquares.probabilistic_marching_squares_stats module
- Modules.ProbabilisticMarchingSquares.probabilistic_marching_squares_stats.probabilistic_marching_squares_summary_statistics(ensemble_images, isovalue)[source]
Compute level crossing probability for probabilistic marching squares.
This function calculates the probability of an isocontour crossing through each cell in a 2D grid based on an ensemble of scalar fields.
Parameters:
- ensemble_imagesnp.ndarray
3D array of shape (y_dim, x_dim, n_ensemble) representing the scalar field with ensemble members.
- isovaluefloat
The isovalue for which to compute the contour crossing probability.
Returns:
- dict
Dictionary containing: - ‘level_crossing_probability’: np.ndarray
2D array of shape (y_dim-1, x_dim-1) with probabilities of contour presence in each cell. Values range from 0 to 1.
Modules.ProbabilisticMarchingSquares.probabilistic_marching_squares_vis module
- Modules.ProbabilisticMarchingSquares.probabilistic_marching_squares_vis.visualize_probabilistic_marching_squares(summary_statistics, ax=None, colormap='viridis')[source]
Visualize the probability map of isocontour presence using matplotlib.
Parameters:
- summary_statisticsnp.ndarray
2D array of shape (y_dim-1, x_dim-1) with probabilities of contour presence in each cell.
- 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
ProbabilisticMarchingSquares Module
This module provides functionality for performing probabilistic marching squares on 2D datasets with uncertainty. It includes methods for calculating cell crossing probabilities and visualizing the results using matplotlib.
- Modules.ProbabilisticMarchingSquares.probabilistic_marching_squares(ensemble_images, isovalue, ax=None, colormap='viridis')[source]
Compute and visualize probabilistic marching squares.
This function implements the complete stats->mesh->vis pipeline for probabilistic marching squares visualization. It calculates the probability of isocontour presence in each cell and creates a matplotlib visualization.
Parameters:
- ensemble_imagesnp.ndarray
3D array of shape (y_dim, x_dim, n_ensemble) representing the scalar field with ensemble members.
- 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.ProbabilisticMarchingSquares.probabilistic_marching_squares_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 squares.
Parameters:
- summary_statisticsdict
Dictionary containing: - ‘level_crossing_probability’: np.ndarray
2D array of shape (y_dim-1, x_dim-1) representing the probability of contour presence in each cell.
Returns:
- level_crossing_probabilitynp.ndarray
2D array of probabilities extracted from the input dictionary.
- Modules.ProbabilisticMarchingSquares.probabilistic_marching_squares_summary_statistics(ensemble_images, isovalue)[source]
Compute level crossing probability for probabilistic marching squares.
This function calculates the probability of an isocontour crossing through each cell in a 2D grid based on an ensemble of scalar fields.
Parameters:
- ensemble_imagesnp.ndarray
3D array of shape (y_dim, x_dim, n_ensemble) representing the scalar field with ensemble members.
- isovaluefloat
The isovalue for which to compute the contour crossing probability.
Returns:
- dict
Dictionary containing: - ‘level_crossing_probability’: np.ndarray
2D array of shape (y_dim-1, x_dim-1) with probabilities of contour presence in each cell. Values range from 0 to 1.
- Modules.ProbabilisticMarchingSquares.visualize_probabilistic_marching_squares(summary_statistics, ax=None, colormap='viridis')[source]
Visualize the probability map of isocontour presence using matplotlib.
Parameters:
- summary_statisticsnp.ndarray
2D array of shape (y_dim-1, x_dim-1) with probabilities of contour presence in each cell.
- 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.