Closed johnkit closed 1 week ago
A strawman approach for this is to implement a DataArraySet
class to encapsulate multiple Xarray.DataArray
objects and maintain matching coordinates. It would implement many (most?) of the DataArray
methods by applying them to each encapsulated array.
Supported in 0.10.1 see https://github.com/Kitware/pan3d/blob/main/examples/jupyter/computed_field.ipynb for details
This feature request applies to both pyvista-xarray and pan3d.
Our current software for vtk-numpy interoperability maps one Xarray DataArray -- comprising one variable in an Xarray DataSet (plus coordinates) -- to a corresponding vtkDataSet. It would be useful to also be able to map multiple variables from an Xarray DataSet to a single vtkDataSet with multiple data components.
For example, issue #95 includes a screenshot with the magnitude of velocity computed from 3 component variables. This was done by adding a new variable at the Xarray dataset level using NumPy:
It would be preferable to add a function that maps an Xarray dataset plus list of variable names to a single vtkDataset, and then have a display option to compute the magnitude on demand by vtk.