uvisbox.Modules.ContourBoxplot.contour_boxplot_mesh

Module Contents

uvisbox.Modules.ContourBoxplot.contour_boxplot_mesh.contour_boxplot_mesh(summary_statistics, x_coords=None, y_coords=None)[source]

Process summary statistics to create mesh data for visualization.

This function aggregates percentile bands by overwriting values in descending percentile order, creating a single image that shows all bands with appropriate color values.

Parameters:
  • summary_statistics (dict) – Output from contour_boxplot_summary_statistics. It contains the median image, percentile bands, and outlier images.

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

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

Returns:

Contains percentile_bands_image, median, outliers, extent, x_coords, and y_coords. The band image stores each pixel’s percentile divided by 100; lower percentiles overwrite higher ones. extent is (x_min, x_max, y_min, y_max) when coordinates are supplied and None otherwise.

Return type:

dict

Notes

The aggregation works by: 1. Starting with highest percentile band (e.g., 90th) 2. Painting pixels with value 0.90 where band is non-zero 3. Overwriting with lower percentile bands (e.g., 75th → 0.75) 4. Continuing until lowest percentile This creates a layered visualization where inner bands overwrite outer bands.

Examples

>>> stats = contour_boxplot_summary_statistics(ensemble, isovalue=0.5)
>>> mesh_data = contour_boxplot_mesh(stats)
>>> print(mesh_data['percentile_bands_image'].shape)
(100, 100)