pynbody.sph.render_3d_grid#
- pynbody.sph.render_3d_grid(snap, quantity='rho', nx=None, ny=None, nz=None, width='10 kpc', x2=None, out_units=None, kernel=None, approximate_fast=None, threaded=None, denoise=None, qty=None)[source]#
Create a 3d grid via SPH interpolation
- Parameters:
snap (snapshot.simsnap.SimSnap) – The snapshot to render
quantity (str | np.ndarray) – The name of the array within the simulation to render, or an actual array. Default ‘rho’
nx (int, optional) – The number of pixels wide to make the grid. If not specified, the default is to use the resolution from the configuration file.
ny (int, optional) – The number of pixels tall to make the grid. If not specified, the default is to use the same as nx.
nz (int, optional) – The number of pixels deep to make the grid. If not specified, the default is to use the same as nx.
width (float, str, optional) – The width of the grid.
x2 (float, optional) – Deprecated - use width instead. If provided, x2 overrides the width parameter and specifies half the width.
out_units (str, optional) – The units to convert the output grid into
kernel (str, kernels.KernelBase, optional) – The kernel to be used for the image rendering. If None, the default kernel is assigned. For more information see
kernels.create_kernel()
.approximate_fast (bool, optional) – Whether to render the image using a lower-resolution approximation for large smoothing lengths. The default is None, in which case the use of approximation is determined by the configuration file.
threaded (bool, optional) – Whether to render the image across multiple threads. Yes if true; no if false. The number of threads to be used is determined by the configuration file. If None, the use of threading is also determined by the configuration file.
denoise (bool, optional) – Whether to include denoising in the rendering process. If None, denoising is applied only if the image is likely to benefit from it. If True, denoising is to be forced on the image; if that is actually impossible, this routine raises an exception. If False, denoising is never applied.
qty (str, optional) – Deprecated - use ‘quantity’ instead