Examples#
The examples below are organized into galleries that mirror the functional
areas of the Plot3d API. Each gallery is
self-contained and can be run locally after a development install
(pip install -e ".[all]").
Note
Examples that use real coronal model data call
fetch_datasets(), which downloads a small
set of PSI MAS model files from the PSI asset server on first run and
caches them under ~/.cache/psi/ (or $PYVISUAL_CACHE if set).
Examples that use only NumPy arrays run without any network access.
Gallery Organization#
- Getting Started
Basic
Plot3dusage: instantiating the plotter, adding the Sun and reference geometry, and controlling actor visibility.- Stack Mesh Mixin
Rendering from stacked coordinate arrays via
StackMeshMixin: individual points, point clouds, single and bundled splines, and reconstructed surfaces.- Grid Mesh Mixin
Rendering from structured-grid coordinate arrays via
GridMeshMixin: 1-D, 2-D, and 3-D slices, isosurface contours, and magnetic fieldline tracing withmapflpy.- Observer Mixin
Camera positioning and field-of-view control via
ObserverMixin: spherical-coordinate observer placement, saving and restoring views, and orbit animations.- Geometry Mixin
Solar geometry primitives via
GeometryMixin: concentric shells, planar discs, the Thomson sphere, and structured spline grid lines.- SphericalMesh
The
SphericalMeshdata container: construction from NumPy arrays, arithmetic and NumPy ufunc support, and filter methods for radial scaling and coordinate remapping.- CartesianMesh
The
CartesianMeshdata container: construction from meshgrid arrays and coordinate-frame conversion from aSphericalMesh.- Extended Functionalities
Advanced observer controls: helioprojective field-of-view specification via angular extents (
observer_los_view) and minimum line-of-sight impact radius (observer_fov_view).- Advanced Examples
Multi-element scenes combining fieldline tracing, slices, contours, and interactive point-picking callbacks.
See also
- Overview
Conceptual introduction to the coordinate conventions and class hierarchy used throughout pyvisual.
- API Reference
Full API reference for all public classes and functions.
Getting Started#
Introductory examples covering the basics of
Plot3d: instantiating the plotter, adding
geometry to the scene, and controlling actor visibility.
Stack Mesh Mixin#
Examples demonstrating StackMeshMixin — the
mixin that renders geometry from stacked N-D coordinate arrays, where every
element of r, t, and p shares the same array shape and corresponds
to a single spatial location.
Grid Mesh Mixin#
Examples demonstrating GridMeshMixin — the
mixin that renders structured-grid data from independent 1-D axis arrays or
pre-broadcast 3-D arrays, including fieldline tracing with
mapflpy.
Observer Mixin#
Examples demonstrating ObserverMixin — the
mixin that positions and orients the camera in spherical coordinates, controls
the field of view, and provides a live camera-state text overlay.
Geometry Mixin#
Examples demonstrating GeometryMixin — the
mixin that adds solar geometry primitives to the scene: the Sun sphere,
concentric shells, planar discs, the Thomson sphere, and structured spline
grid lines.
SphericalMesh#
Examples demonstrating the SphericalMesh class
— the primary data container for structured \((r, \theta, \phi)\) grids.
Topics include construction from NumPy arrays, arithmetic and NumPy ufunc
support, and the filter methods for radial scaling and coordinate remapping.
CartesianMesh#
Examples demonstrating the CartesianMesh class
— the Cartesian-frame counterpart to SphericalMesh.
Topics include construction from NumPy arrays, coordinate-frame conversion from
a SphericalMesh, and direct rendering via
Plot3d.
Extended Functionalities#
Examples demonstrating additional capabilities of Plot3d
beyond basic mesh rendering: observer position and orientation controls, and
field-of-view specification via helioprojective angular extents or minimum
line-of-sight impact radius.
Advanced Examples#
More complex examples combining multiple elements of the
Plot3d API: multi-domain fieldline tracing,
interactive point picking with callbacks, and combined slice/contour/fieldline
scenes.