LALInference 4.1.10.1-bf6a62b
lalinference.bayespputils.KDTreeVolume Class Reference

Detailed Description

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.

Definition at line 2499 of file bayespputils.py.

Inherits object.

Public Member Functions

def __init__ (self, objects, boundingbox, dims=0)
 Construct a kD-tree from a sequence of objects. More...
 
def objects (self)
 Returns the objects in the tree. More...
 
def __iter__ (self)
 Iterator over all the objects contained in the tree. More...
 
def left (self)
 Returns the left tree. More...
 
def right (self)
 Returns the right tree. More...
 
def split_dim (self)
 Returns the dimension along which this level of the kD-tree splits. More...
 
def bounds (self)
 Returns the coordinates of the lower-left and upper-right corners of the bounding box for this tree: low_left, up_right. More...
 
def volume (self)
 Returns the volume of the bounding box of the tree. More...
 
def integrate (self, f, boxing=64)
 Returns the integral of f(objects) over the tree. More...
 
def operate (self, f, g, boxing=64)
 Operates on tree nodes exceeding boxing parameter depth. More...
 
def 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. More...
 
def fillNewTree (self, boxing=64, isArea=False)
 copies tree structure, but with KDSkeleton as the new nodes. More...
 

Constructor & Destructor Documentation

◆ __init__()

def lalinference.bayespputils.KDTreeVolume.__init__ (   self,
  objects,
  boundingbox,
  dims = 0 
)

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.

Definition at line 2506 of file bayespputils.py.

Member Function Documentation

◆ objects()

def lalinference.bayespputils.KDTreeVolume.objects (   self)

Returns the objects in the tree.

Definition at line 2570 of file bayespputils.py.

◆ __iter__()

def lalinference.bayespputils.KDTreeVolume.__iter__ (   self)

Iterator over all the objects contained in the tree.

Definition at line 2576 of file bayespputils.py.

◆ left()

def lalinference.bayespputils.KDTreeVolume.left (   self)

Returns the left tree.

Definition at line 2582 of file bayespputils.py.

◆ right()

def lalinference.bayespputils.KDTreeVolume.right (   self)

Returns the right tree.

Definition at line 2588 of file bayespputils.py.

◆ split_dim()

def lalinference.bayespputils.KDTreeVolume.split_dim (   self)

Returns the dimension along which this level of the kD-tree splits.

Definition at line 2595 of file bayespputils.py.

◆ bounds()

def lalinference.bayespputils.KDTreeVolume.bounds (   self)

Returns the coordinates of the lower-left and upper-right corners of the bounding box for this tree: low_left, up_right.

Definition at line 2602 of file bayespputils.py.

◆ volume()

def lalinference.bayespputils.KDTreeVolume.volume (   self)

Returns the volume of the bounding box of the tree.

Definition at line 2608 of file bayespputils.py.

◆ integrate()

def lalinference.bayespputils.KDTreeVolume.integrate (   self,
  f,
  boxing = 64 
)

Returns the integral of f(objects) over the tree.

The optional boxing parameter determines how deep to descend into the tree before computing f.

Definition at line 2620 of file bayespputils.py.

◆ operate()

def lalinference.bayespputils.KDTreeVolume.operate (   self,
  f,
  g,
  boxing = 64 
)

Operates on tree nodes exceeding boxing parameter depth.

Definition at line 2632 of file bayespputils.py.

◆ search()

def lalinference.bayespputils.KDTreeVolume.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.

Definition at line 2643 of file bayespputils.py.

◆ fillNewTree()

def lalinference.bayespputils.KDTreeVolume.fillNewTree (   self,
  boxing = 64,
  isArea = False 
)

copies tree structure, but with KDSkeleton as the new nodes.

Definition at line 2654 of file bayespputils.py.