pynbody.sph

pynbody.sph#

Low-level functionality for SPH interpolation and rendering

For most users, SPH functionality is accessed through the derived arrays rho and smooth in a snapshot object. These arrays are calculated on-the-fly when accessed.

SPH-interpolated images and grids can also be generated. For most users, the pynbody.plot.sph.image() function is the most convenient interface for rendering images of SPH simulations.

A slightly lower-level approach is to call render_image() directly; or to get closer still to the underlying machinery, use make_render_pipeline() to create a renderer object, which then produces an image when the render() method is called.

The to_3d_grid() function can be used to create a 3D grid of interpolated values from an SPH simulation. This functionality is also a thin wrapper around the make_render_pipeline() function and its associated classes in the renderers module.

Functions

render_3d_grid(snap[, quantity, nx, ny, nz, ...])

Create a 3d grid via SPH interpolation

render_image(*args, **kwargs)

Render an SPH image.

render_spherical_image(snap[, quantity, ...])

Render an SPH image projected onto the sky around the origin.

rho(sim)

Derived: Return the SPH density array for the simulation, using the configured number of neighbours

smooth(sim)

Derived: Return the smoothing length array for the simulation, using the configured number of neighbours

to_3d_grid(*args, **kwargs)

Deprecated alias for render_3d_grid()

Modules

kernels

SPH kernel details

renderers

Core classes for rendering images of SPH simulations.