@@ -10,8 +10,8 @@ and maintained by `Predictive Science Inc. (PSI) <https://www.predsci.com/>`_ an
1010is tightly coupled to the PSI data ecosystem — in particular
1111`psi-io <https://predsci.com/doc/psi-io/guide/index.html >`_ (HDF4/HDF5 file I/O)
1212and `mapflpy <https://predsci.com/doc/mapflpy/ >`_ (magnetic fieldline tracing).
13- Any rectilinear grid defined in spherical coordinates is compatible with the API,
14- regardless of whether it originates from a PSI model .
13+ With that said, any rectilinear grid defined in spherical coordinates is compatible
14+ with the API .
1515
1616.. attention ::
1717
@@ -41,8 +41,24 @@ Cartesian frame (``'cartesian'``)
4141 Accepted aliases include ``'xyz' ``, ``'cart' ``, ``'rectilinear' ``, and any
4242 permutation of the individual axis letters.
4343
44- Conversion between the two frames is handled transparently — methods that accept a
45- ``frame `` argument convert to Cartesian before passing data to PyVista.
44+ .. note ::
45+
46+ **pyvisual ** is principally concerned with rendering rectilinear spherical grids,
47+ *viz. * those produced by PSI's MAS code; more specificially, this package is
48+ designed to facilitate the visualization of such datasets by converting these
49+ structured :math: `(r, \theta , \phi )` grids into the native Cartesian coordinate
50+ system used by PyVista and VTK for rendering.
51+
52+ The coordinate system of the :class: `~pyvista.Plotter ` is always a Cartesian
53+ coordinate system in the Heliographic Carrington frame. Input data (however)
54+ is generally expected to be in the spherical frame, and the API provides utilities for
55+ converting between the two.
56+
57+ The spherical frame is used for all observer controls,
58+ reference geometry, and mesh construction; the Cartesian frame is used for all
59+ rendering and camera manipulation. The API abstracts away the details of converting
60+ between the two, but it is important to understand the distinction when working with
61+ the package.
4662
4763The Plotter: ``Plot3d ``
4864-----------------------
@@ -97,7 +113,27 @@ Mesh Classes
97113------------
98114
99115Two mesh classes are provided for loading and manipulating model data before
100- adding it to a plotter.
116+ adding it to a plotter. These classes can be instantiated from an HDF file
117+ path, from raw coordinate and data arrays, or from an existing PyVista dataset.
118+
119+ .. note ::
120+
121+ When instantiating from an HDF filepath, the :mod: `psi-io ` library is used
122+ to read the file and extract the coordinate and data arrays by index.
123+ As such, the file must be in a format compatible with :mod: `psi-io ` (e.g. HDF4 with
124+ Fortran-order arrays, or HDF5 with the same structure).
125+
126+ *It is generally
127+ recommended to explicitly load the data arrays to ensure that the scales
128+ and data-values are properly interpreted, rather than relying on the mesh
129+ classes to infer them from the file. *
130+
131+ The motivation behind these classes is to provide a convenient container for solar
132+ physics model data that can make full use of the powerful PyVista/VTK
133+ `Filters <https://docs.pyvista.org/api/core/filters.html >`_ (along with a few
134+ additional "filters" provided by **pyvisual ** in the
135+ :class: `~pyvisual.core.mesh3d.CartesianMeshFilters ` and
136+ :class: `~pyvisual.core.mesh3d.SphericalMeshFilters ` mixin classes).
101137
102138:class: `~pyvisual.core.mesh3d.SphericalMesh `
103139 Wraps :class: `pyvista.RectilinearGrid ` with a spherical-frame tag. Can be
@@ -111,6 +147,25 @@ adding it to a plotter.
111147 The Cartesian counterpart, wrapping :class: `pyvista.StructuredGrid `. It shares
112148 the same operator API as :class: `~pyvisual.core.mesh3d.SphericalMesh `.
113149
150+ .. note ::
151+
152+ The general motivation behind the latter class (in contrast to the :class: `~pyvisual.core.mesh3d.SphericalMesh `
153+ class) is to facilitate the use of PyVista/VTK's
154+ `filters <https://docs.pyvista.org/api/core/filters >`_ on spherical grids that have
155+ been converted to Cartesian coordinates. This :func: `~pyvisual.utils.geometry.spherical_to_cartesian `
156+ transformation yeilds topological structured meshes that are, nevertheless, not composed
157+ of monotonically increasing coordinate arrays. Therefore, the grid's internal structure
158+ has to be stored explicitly *viz. * through a :class: `pyvista.StructuredGrid ` rather than a
159+ :class: `pyvista.RectilinearGrid `.
160+
161+ .. warning ::
162+
163+ The consequence of the above note is that the point arrays of this class are
164+ derived from a :func: `~numpy.meshgrid `-like Cartesian product of the input scales,
165+ and are not stored as the three separate 1-D arrays that are typical of rectilinear grids.
166+ As such, these grids can be substantially more memory-intensive than their
167+ :class: `~pyvisual.core.mesh3d.SphericalMesh ` counterparts.
168+
114169Both classes are available from the top-level package::
115170
116171 from pyvisual import SphericalMesh, CartesianMesh
0 commit comments