pynbody.kdtree

pynbody.kdtree#

Efficient 3D KDTree implementation for fast geometrical calculations such as neighbour lists and smoothing lengths.

As well as the smoothing operations built on it – sph_mean(), sph_dispersion(), sph_divergence() and sph_curl() – the tree can hand neighbour pairs back to python, so that pairwise SPH operations pynbody does not itself provide can be written without a python-level loop over particles. See pair_reduce() and pair_blocks(), and buffered_kernel() for driving the former from a compiled per-pair kernel.

Functions

buffered_kernel(kernel, *args[, ncols, ...])

Adapt a pair kernel that writes into output arrays for KDTree.pair_reduce().

Classes

KDTree(pos, mass[, leafsize, boxsize, ...])

KDTree can be used for smoothing, interpolating and geometrical queries.

Modules

kdmain

KDTree module for pynbody