Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Multicomponent dataset support #97

Open
johnkit opened this issue Aug 2, 2024 · 1 comment
Open

Feature Request: Multicomponent dataset support #97

johnkit opened this issue Aug 2, 2024 · 1 comment
Assignees

Comments

@johnkit
Copy link
Collaborator

johnkit commented Aug 2, 2024

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:

ds['mag'] = np.sqrt(ds['u']**2 + ds['v']**2 + ds['z']**2)

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.

@johnkit
Copy link
Collaborator Author

johnkit commented Aug 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants