Closed josephko91 closed 1 year ago
I think I've found the solution to my own problem! Posting here for future reference. There is a "volume" parameter in the plot method that needs to be set to True.
Revised code:
import pyvista as pv
import pvxarray
import xarray as xr
file_path = 'path/to/file/cm1out_000030.nc' # edit path here
ds = xr.open_dataset(file_path)
ds = ds.squeeze('time')
da = ds.qi4
mesh = da.pyvista.mesh(x="xh", y="yh", z="zh")
mesh.plot(opacity='linear', cmap='bone', volume=True)
I was trying to follow one of your examples with my own data, but for some reason only data on the edge of the domain is showing in the plot. I plotted cross sections with xarray plotting functions as a sanity check. The data is there in the original xarray dataset and subsequent dataarray. Any pointers would be appreciated!
Code to reproduce error:
The file is too big to upload here. So here's a link to it in google drive: https://drive.google.com/file/d/144WYF4Q9WSGC1JW7Qw5OTjlRPyjMatqq/view?usp=sharing
Date: Wed Oct 25 16:42:08 2023 EDT
Python 3.11.0 | packaged by conda-forge | (main, Jan 14 2023, 12:26:40) [Clang 14.0.6 ]