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.
Underlying all of the above is the KDTree, which finds the neighbours and provides the
lower-level SPH operations themselves, such as sph_mean() and
sph_divergence(). It also supports user-defined SPH operations, which are not
otherwise available in pynbody: pair_reduce() accumulates an arbitrary pairwise
function over neighbour pairs, so that operations such as artificial viscosity or conduction can be expressed
without a python-level loop over particles. For finer control, pair_blocks() exposes
the neighbour pairs themselves.
Functions
|
Create a 3d grid via SPH interpolation |
|
Render an SPH image. |
|
Render an SPH image onto the sky around the origin, in healpix format with the specified nside. |
|
Derived: Return the SPH density array for the simulation, using the configured number of neighbours |
|
Derived: Return the smoothing length array for the simulation, using the configured number of neighbours |
|
Deprecated alias for |
Modules