You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Develop an Xarray acessor for importing numpy data from Xarray arrays and converting to the applicable vtkDataSet type. Use https://github.com/pyvista/pyvista-xarray as an exemplar.
import pvxarray
import xarray as xr
ds = xr.tutorial.load_dataset("air_temperature")
da = ds.air[dict(time=0)] # Select DataArray for a timestep
# Plot in 3D
da.pyvista.plot(x="lon", y="lat", show_edges=True, cpos='xy')
# Or grab the mesh object for use with PyVista
mesh = da.pyvista.mesh(x="lon", y="lat")
Todo (vtk-xarray module)
import vtk_xarray # <== new module
import xarray as xr
ds = xr.tutorial.load_dataset("air_temperature")
da = ds.air[dict(time=0)] # Select DataArray for a timestep
# Get/create corresponding mesh object
mesh = da.vtk.mesh(x="lon", y="lat") # <== da.vtk property replaces da.pyvista
# Plot in 3D
# ...
Develop an Xarray acessor for importing numpy data from Xarray arrays and converting to the applicable vtkDataSet type. Use https://github.com/pyvista/pyvista-xarray as an exemplar.
Xarray accessor documentation at https://docs.xarray.dev/en/stable/internals/extending-xarray.html
First step probably an explicit function to return vtkDataSet from input numpy arrays for coordinates & values.
To start, let's support "current" examples (rectilinear, structured, image)
The text was updated successfully, but these errors were encountered: