Modules.SquidGlyphs package

Submodules

Modules.SquidGlyphs.squid_glyphs module

Modules.SquidGlyphs.squid_glyphs.squid_glyph_2D(positions, ensemble_vectors, percentil1, scale=0.2, ax=None)[source]

Draws uncertainty squid glyphs for the given positions and ensemble vectors in 2D. This a 2D version of the 3D uncertainty squid glyphs in T. A. J. Ouermi, J. Li, Z. Morrow, B. Van Bloemen Waanders and C. R. Johnson, “Glyph-Based Uncertainty Visualization and Analysis of Time-Varying Vector Fields,” 2024 IEEE Workshop on Uncertainty Visualization: Applications, Techniques, Software, and Decision Frameworks, St Pete Beach, FL, USA, 2024, pp. 73-77, doi: 10.1109/UncertaintyVisualization63963.2024.00014.

Parameters:

positionsnumpy.ndarray

Array of shape (n, 2) representing the positions of the squid glyphs.

ensemble_vectorsnumpy.ndarray

Array of shape (n, m, 2) representing the ensemble vectors for each position.

percentil1float

The first percentile for depth filtering.

scalefloat

The scale factor for the glyphs.

axmatplotlib axis

The axis to draw on. If None, a new figure and axis will be created.

Returns:

axmatplotlib axis

The axis with the drawn squid glyphs.

Modules.SquidGlyphs.squid_glyphs.squid_glyph_3D(positions, ensemble_vectors, percentil, scale=0.5, show_edges=True, glyph_color='lightblue', ax=None)[source]

Draws uncertainty squid glyphs for the given positions and ensemble vectors in 3D. this implementation is based on T. A. J. Ouermi, J. Li, Z. Morrow, B. Van Bloemen Waanders and C. R. Johnson, “Glyph-Based Uncertainty Visualization and Analysis of Time-Varying Vector Fields,” 2024 IEEE Workshop on Uncertainty Visualization: Applications, Techniques, Software, and Decision Frameworks, St Pete Beach, FL, USA, 2024, pp. 73-77, doi: 10.1109/UncertaintyVisualization63963.2024.00014.

Parameters:

positionsnumpy.ndarray

Array of shape (n, 3) The positions of the squid glyphs.

ensemble_vectorsnumpy.ndarray

Array of shape (n, m, 3) The ensemble vectors in spherical coordinates. The ensemble vectors for each position in Cartesian coordinates.

percentilfloat

The first percentile for depth filtering.

scalefloat, optional

The scale factor for the glyphs. Default is 0.5.

show_edgesbool, optional

Whether to show edges of the glyphs. Default is True.

glyph_colorstr, optional

The color of the glyphs. Default is ‘lightblue’.

axpyvista.Plotter, optional

The pyvista plotter to use. If None, a new plotter will be created.

Returns:

plotterpyvista.Plotter

The pyvista plotter with the drawn squid glyphs.

pointsnumpy.ndarray

The points of the squid glyphs.

polygonsnumpy.ndarray

The polygon connectivity for the glyphs.

Modules.SquidGlyphs.squid_glyphs_mesh module

Modules.SquidGlyphs.squid_glyphs_mesh.squid_glyphs_meshing_2D(positions, ensemble_polar_vectors, vector_depths, percentil1, scale=0.2)[source]

Build squid glyphs for 2D visualization. Assumes vectors are in polar coordinates (magnitude, angle).

Parameters:

positionsnumpy.ndarray

Array of shape (n, 2) The positions of the squid glyphs.

ensemble_polar_vectorsnumpy.ndarray

Array of shape (n, m, 2) The ensemble polar vectors for each position.

vector_depthsnumpy.ndarray

Array of shape (n, m) The vector depths for each position.

percentil1float

The first percentile for depth filtering.

scalefloat

The scale factor for the glyphs.

Returns:

glyphs_pointsnumpy.ndarray

Array of shape (k, 2) The points of the squid glyphs.

glyphs_polygonsnumpy.ndarray

Array of shape (k, 3) The polygons of the squid glyphs.

Modules.SquidGlyphs.squid_glyphs_mesh.squid_glyphs_meshing_3D(directional_variations, positions, vectors, min_vectors, median_vectors, max_vectors, glyph_markers, scale, resolution, num_of_glyphs)[source]

Build superelliptical squid glyphs for 3D visualization. Assumes vectors are in spherical coordinates (magnitude, theta, phi).

Parameters:

directional_variationsnumpy.ndarray

Array of shape (n, 4, 2) where the 4 represents the (pca variance, pca first component, pca second component, pca mean) and the 2 represents the x and y components of the pca components.

positionsnumpy.ndarray

Array of shape (n, 3) The positions of the squid glyphs.

vectorsnumpy.ndarray

Array of shape (n, m, 3) The ensemble vectors in spherical coordinates.

min_vectorsnumpy.ndarray

Array of shape (n, 3) The minimum vectors in spherical coordinates.

median_vectorsnumpy.ndarray

Array of shape (n, 3) The median vectors in spherical coordinates.

max_vectorsnumpy.ndarray

Array of shape (n, 3) The maximum vectors in spherical coordinates.

glyph_markersnumpy.ndarray

Array of shape (n,) with values 0 (no glyph), 1 (full glyph), 2 (arrow only)

scalefloat

The scale factor for the glyphs.

resolutionint

The resolution of the base circle of the squid glyph.

num_of_glyphsint

The number of glyphs to be created.

Returns:

pointsnumpy.ndarray

Array of shape (m, 3) The points of the squid glyphs.

polygonsnumpy.ndarray

Array of shape (k,) The polygon connectivity for the glyphs.

Modules.SquidGlyphs.squid_glyphs_stats module

Modules.SquidGlyphs.squid_glyphs_stats.getDirectionalVariations(vectors, depths, depth_threshold, min_vectors, median_vectors, max_vectors)[source]

Compute the directional variation of the vectors.

Parameters:

positionsnumpy.ndarray

Array of shape (num_points, 3) where the last dimension contains the x, y, and z coordinates of the positions.

vectorsnumpy.ndarray

Array of shape (num_points, num_ensemble_members, 3) where the last dimension contains the vector components.

median_vectorsnumpy.ndarray

Array of shape (num_points, 3) where the last dimension contains the median vector components.

max_vectorsnumpy.ndarray

Array of shape (num_points, 3) where the last dimension contains the max vector components.

min_vectorsnumpy.ndarray

Array of shape (num_points, 3) where the last dimension contains the min vector components.

domainnumpy.ndarray

Array of shape (3, 2) where the first dimension contains the x, y, and z domain limits.

Returns:

directional_variationnumpy.ndarray

Array of shape (num_points, 4, 2) where the 4 represents the (pca variance, pca first component, pca second component, pca mean) and the 2 represents the x and y components of the pca components.

Modules.SquidGlyphs.squid_glyphs_vis module

Modules.SquidGlyphs.squid_glyphs_vis.matplotlib_uncertainty_squid_glyphs_2D_vis(glyphs_points, glyphs_polygons, ax=None)[source]

Plots the squid glyphs in 2D using matplotlib.

Parameters:

glyphs_pointsnumpy.ndarray

Array of shape (k, 2) The points of the squid glyphs.

glyphs_polygonsnumpy.ndarray

Array of shape (m, 3) The polygons of the squid glyphs.

axmatplotlib axis

The axis to draw on. If None, a new figure and axis will be created.

Returns:

axmatplotlib axis

The axis with the drawn squid glyphs.

Modules.SquidGlyphs.squid_glyphs_vis.pyvista_uncertainty_squid_glyphs_3D_vis(points, triangles, ax=None, show_edges=True, glyph_color='lightblue')[source]

Plots the 3D squid glyphs using pyvista.

Parameters:

pointsnumpy.ndarray

Array of shape (m, 3) The points of the squid glyphs.

trianglesnumpy.ndarray

Array of shape (n, 3) The triangle connectivity of the squid glyphs.

axpyvista.Plotter, optional

The pyvista plotter to use. If None, a new plotter will be created.

show_edgesbool, optional

Whether to show edges of the glyphs. Default is True.

glyph_colorstr, optional

The color of the glyphs. Default is ‘lightblue’.

Returns:

axpyvista.Plotter

The pyvista plotter with the drawn squid glyphs.

Module contents