Package pylal :: Module bayespputils :: Class KDTreeVolume
[hide private]
[frames] | no frames]

Class KDTreeVolume

source code

object --+
         |
        KDTreeVolume

A kD-tree suitable for splitting parameter spaces and counting hypervolumes. Is modified from the KDTree class so that bounding boxes are stored. This means that there are no longer gaps in the hypervolume once the samples have been split into groups.

Instance Methods [hide private]
 
__init__(self, objects, boundingbox, dims=0)
Construct a kD-tree from a sequence of objects.
source code
 
_same_coords(self, objects)
True if and only if all the given objects have the same coordinates.
source code
 
objects(self)
Returns the objects in the tree.
source code
 
__iter__(self)
Iterator over all the objects contained in the tree.
source code
 
left(self)
Returns the left tree.
source code
 
right(self)
Returns the right tree.
source code
 
split_dim(self)
Returns the dimension along which this level of the kD-tree splits.
source code
 
bounds(self)
Returns the coordinates of the lower-left and upper-right corners of the bounding box for this tree: low_left, up_right
source code
 
volume(self)
Returns the volume of the bounding box of the tree.
source code
 
integrate(self, f, boxing=64)
Returns the integral of f(objects) over the tree.
source code
 
operate(self, f, g, boxing=64)
Operates on tree nodes exceeding boxing parameter depth.
source code
 
search(self, coordinates, boxing=64)
takes a set of coordinates and searches down through the tree untill it gets to a box with less than 'boxing' objects in it and returns the box bounds, number of objects in the box, and the weighting.
source code
 
fillNewTree(self, boxing=64, isArea=False)
copies tree structure, but with KDSkeleton as the new nodes.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, objects, boundingbox, dims=0)
(Constructor)

source code 

Construct a kD-tree from a sequence of objects. Each object should return its coordinates using obj.coord(). the obj should also store the bounds of the hypervolume its found in. for non-leaf objects we need the name of the dimension split and value at split.

Overrides: object.__init__

integrate(self, f, boxing=64)

source code 

Returns the integral of f(objects) over the tree. The optional boxing parameter determines how deep to descend into the tree before computing f.