pynbody.plot.sph.volume#
- pynbody.plot.sph.volume(sim, qty='rho', width=None, resolution=200, color=(1.0, 1.0, 1.0), vmin=None, vmax=None, dynamic_range=4.0, log=True, create_figure=True)[source]#
Create a volume rendering of the given simulation using mayavi.
Warning
This function requires mayavi to be installed. However, mayavi does not seem to be under active development and is not compatible with the latest versions of python. As a result, this function will probably be removed in future versions of pynbody. For a more modern alternative, consider using topsy.
- Parameters:
sim (pynbody.snapshot.simsnap.SimSnap) – The simulation snapshot to visualize
qty (str, optional) – The name of the array to interpolate. Default is ‘rho’, which gives a density image.
width (str or float, optional) – The width of the cube to generate, centered on the origin. If None, the width is determined by the extent of the simulation snapshot.
resolution (int, optional) – The number of elements along each side of the cube. (Default is 200)
color (tuple, optional) – The color of the volume rendering. The value of each voxel is used to set the opacity.
vmin (float, optional) – The value for zero opacity. If None, this is inferred from vmax and dynamic_range.
vmax (float, optional) – The value for full opacity. If None, the maximum value of the image is used.
dynamic_range (float, optional) – The dynamic range in dex to use if vmin and vmax are not specified. Default is 4.0
log (bool, optional) – If True, the image is log-scaled before passing to mayavi. (Default is True)
create_figure (bool, optional) – If True, create a new mayavi figure before rendering. (Default is True)