# nbodykit.algorithms.kdtree¶

Classes

 KDDensity(source[, margin]) Estimate a proxy density based on the distance to the nearest neighbor.
class nbodykit.algorithms.kdtree.KDDensity(source, margin=1.0)[source]

Estimate a proxy density based on the distance to the nearest neighbor. The result is proportional to the density but the scale is unspecified.

Results are computed when the object is inititalized. See the documenation of run() for the attributes storing the results.

Parameters: source (CatalogSource) – the input source of particles to compute the proxy density on; must specify the ‘Position’ column margin (float, optional) – Padding region per parallel domain; relative to the mean seperation

Methods

 run() Compute the density proxy.
run()[source]

Compute the density proxy. This attaches the following attribute:

density

a unit-less, proxy density value for each object on the local rank. This is computed as the inverse cube of the distance to the closest, nearest neighbor

Type: array_like, length: size