uvisbox.Modules.ProbabilisticMarchingSquares.probabilistic_marching_squares

Module Contents

uvisbox.Modules.ProbabilisticMarchingSquares.probabilistic_marching_squares.probabilistic_marching_squares(ensemble_images, isovalue, ax=None, colormap='viridis', x_coords=None, y_coords=None)[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_images (np.ndarray) – 3D array of shape (y_dim, x_dim, n_ensemble) representing the scalar field with ensemble members.

  • isovalue (float) – The isovalue for which to compute the isocontour.

  • ax (matplotlib.axes.Axes, optional) – The axis to draw on. If None, a new figure and axis will be created.

  • colormap (str, optional) – Colormap for the visualization. Default is ‘viridis’.

  • x_coords (np.ndarray, optional) – 1D array of x-axis coordinates defining the spatial domain. Length must match x_dim. If None, pixel indices are used.

  • y_coords (np.ndarray, optional) – 1D array of y-axis coordinates defining the spatial domain. Length must match y_dim. If None, pixel indices are used.

Returns:

ax – The axis with the visualized probabilistic isocontour.

Return type:

matplotlib.axes.Axes