Sbozzolo / kuibit

Python 3 post-processing tools for simulations performed with the Einstein Toolkit
GNU General Public License v3.0
38 stars 11 forks source link

Integration with `yt` #18

Open Yurlungur opened 3 years ago

Yurlungur commented 3 years ago

It strikes me that it would be extremely easy to use kuibit as the backend for loading data into yt to enable, e.g., volume rendering. In fact, volume rendering a uniform grid, after resampling in kuibit should work essentially out of the box.

This isn't a feature request, just a suggestion for a straightforward enhancement, should you decide you want volume rendering.

Sbozzolo commented 3 years ago

Yes, this is a good point and something I definitely have thought about. At the moment (version 1.0.0) kuibit doesn't provide any function to make visualizations: it is up to the user to use the tools they prefer to visualize the data. Modules for plotting will be added to kuibit in a future release and the experimental branch contains already some basic integration with matplotlib and mayavi. It is likely that yt will become another of the supported backends for visualization.

Sbozzolo commented 3 years ago

I have some 3D data (attached here--zipped) that I wanted to render and I tried to do it with yt. In my quick tests, I couldn't get much out of yt (but I've never used the tool before and I didn't try too hard).

This is what how I visualize the data with mayavi:

from kuibit.grid_data_utils import load_UniformGridData
from numpy import log10 

data = load_UniformGridData("rhob.xyz.npz")
mlab.contour3d(*data.coordinates_from_grid(as_same_shape=True),
                           log10(data.data), transparent=True)

And this is the output: snapshot

I don't know how to get something similar with yt.

I leave this data here, in case anyone with more experience with yt wants to try to play with it and help integrating the tool with kuibit.

Yurlungur commented 3 years ago

I might be able to get something out of yt. I will try to find the time to give it a shot.

matthewturk commented 3 years ago

@Yurlungur If you want a hand, let me know!