Teetool
Probabilistic modelling of trajectories
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
teetool.world.World Class Reference

World class handles all trajectory data. More...

Inheritance diagram for teetool.world.World:

Public Member Functions

def __init__ (self, name="", ndim=3, resolution=[10)
 initialise World More...
 
def clear (self)
 clear previously stored calculations More...
 
def overview (self)
 prints an overview (text) More...
 
def addCluster (self, cluster_data, cluster_name="")
 add a cluster to the world More...
 
def getName (self)
 returns the name of the world More...
 
def getCluster (self, list_icluster=None)
 obtain cluster data More...
 
def getClusterPoints (self, x1, list_icluster=None)
 obtain cluster data at specific points [0, 1] More...
 
def getTubeStats (self, list_icluster=None, sdwidth=1., resolution=None)
 obtain statistics of confidence region in scenarios More...
 
def isInside (self, P, sdwidth=1, list_icluster=None)
 
def getSamples (self, icluster, nsamples=50)
 returns samples in a list of (x, Y) data More...
 
def buildModel (self, settings, list_icluster=None)
 generates a model from the trajectory data More...
 
def getMean (self, list_icluster=None)
 returns the mean trajectory [x, y, z] for list_icluster More...
 
def getTube (self, list_icluster=None, sdwidth=1, resolution=None, z=None)
 returns a grid with bools to specify whether a point falls within the confidence region or not More...
 
def getLogLikelihood (self, list_icluster=None, resolution=None, z=None)
 returns a grid with the maximum log-likelihood More...
 

Public Attributes

 fraction_to_expand
 fraction on edges, default 0.1 More...
 

Private Member Functions

def _check_icluster (self, icluster)
 checks the validity of icluster More...
 
def _check_list_icluster (self, list_icluster)
 checks the validity of a list of icluster More...
 
def _getGrid (self, outline, resolution=None)
 returns a grid based on outline and resolution More...
 
def _get_outline_expanded (self, list_icluster=None, fraction_to_expand=0.1)
 returns an expanded grid based on the outline of trajectory data in list_icluster More...
 
def _get_outline (self, list_icluster=None)
 returns a grid based on the outline of trajectory data in list_icluster More...
 
def _get_outline_tube (self, sdwidth=1, list_icluster=None)
 returns the outline of a tube of specified clusters More...
 
def _get_point_from_cluster_data (self, cluster_data, x1)
 
def _get_point_from_xY (self, x, Y, x1)
 returns the points nearest to x1 More...
 

Private Attributes

 _name
 name of world More...
 
 _ndim
 number of dimensions trajectory data More...
 
 _clusters
 list holding clusters More...
 
 _resolution
 resolution of grid More...
 

Detailed Description

World class handles all trajectory data.

This class provides the direct interface to the trajectory data and produce models

Constructor & Destructor Documentation

§ __init__()

def teetool.world.World.__init__ (   self,
  name = "",
  ndim = 3,
  resolution = [10 
)

initialise World

Parameters
selfobject pointer
nameworld name, used in title and saving image
ndimnumber of dimensions in trajectory data
resolutionspecify resolution of grid

Member Function Documentation

§ _check_icluster()

def teetool.world.World._check_icluster (   self,
  icluster 
)
private

checks the validity of icluster

Parameters
selfobject pointer
iclustervalue to test

§ _check_list_icluster()

def teetool.world.World._check_list_icluster (   self,
  list_icluster 
)
private

checks the validity of a list of icluster

Parameters
selfobject pointer
list_iclusterlist of icluster to test

§ _get_outline()

def teetool.world.World._get_outline (   self,
  list_icluster = None 
)
private

returns a grid based on the outline of trajectory data in list_icluster

Parameters
selfobject pointer
list_iclusterlist of clusters to take into account
Returns
xx grid in x-domain
yy grid in y-domain
zz grid in z-domain
returns the outline of specified clusters

list_icluster is list of clusters, if None, show all

§ _get_outline_expanded()

def teetool.world.World._get_outline_expanded (   self,
  list_icluster = None,
  fraction_to_expand = 0.1 
)
private

returns an expanded grid based on the outline of trajectory data in list_icluster

Parameters
selfobject pointer
list_iclusterlist of clusters to take into account
fraction_to_expandfraction to expand the outline with
Returns
xx grid in x-domain
yy grid in y-domain
zz grid in z-domain

§ _get_outline_tube()

def teetool.world.World._get_outline_tube (   self,
  sdwidth = 1,
  list_icluster = None 
)
private

returns the outline of a tube of specified clusters

Parameters
selfobject pointer
sdwidthvariance to evaluate confidence region on
list_iclusterclusters to evaluate confidence on. None shows all
Returns
global_outline global outline of the tube (maximum dimensions)

§ _get_point_from_cluster_data()

def teetool.world.World._get_point_from_cluster_data (   self,
  cluster_data,
  x1 
)
private

§ _get_point_from_xY()

def teetool.world.World._get_point_from_xY (   self,
  x,
  Y,
  x1 
)
private

returns the points nearest to x1

Parameters
selfobject pointer
xx from (x, Y), to find the relevant index
YY from (x, Y), one of these values gets returned
x1timing [0, 1] to visualise points
Returns
a a point in space, along the position x, value Y

§ _getGrid()

def teetool.world.World._getGrid (   self,
  outline,
  resolution = None 
)
private

returns a grid based on outline and resolution

Parameters
selfobject pointer
outlineoutline to generate grid from
resolutionresolution to generate grid from
Returns
xx grid in x-domain
yy grid in y-domain
zz grid in z-domain

§ addCluster()

def teetool.world.World.addCluster (   self,
  cluster_data,
  cluster_name = "" 
)

add a cluster to the world

Parameters
selfobject pointer
cluster_datalist of (x, Y) trajectory data
cluster_namename of added cluster

§ buildModel()

def teetool.world.World.buildModel (   self,
  settings,
  list_icluster = None 
)

generates a model from the trajectory data

Parameters
selfobject pointer
settingsspecify settings in dictionary model_type is resampling, ML, or EM ngaus is number of Gaussians
list_icluster

§ clear()

def teetool.world.World.clear (   self)

clear previously stored calculations

Parameters
selfobject pointer

§ getCluster()

def teetool.world.World.getCluster (   self,
  list_icluster = None 
)

obtain cluster data

Parameters
selfobject pointer
list_iclusterlist of clusters to return
Returns
clusters a list of clusters as specified, holds (x, Y)

§ getClusterPoints()

def teetool.world.World.getClusterPoints (   self,
  x1,
  list_icluster = None 
)

obtain cluster data at specific points [0, 1]

Parameters
selfobject pointer
x1timing [0, 1] to visualise points
list_iclusterlist of clusters to return
Returns
clusters a list of points A, with points

§ getLogLikelihood()

def teetool.world.World.getLogLikelihood (   self,
  list_icluster = None,
  resolution = None,
  z = None 
)

returns a grid with the maximum log-likelihood

Parameters
selfobject pointer
list_iclusterwhich clusters to return
resolutionthe resolution to produce the grid on
z(optional) height parameter to produce 2d grids for 3d trajectories
Returns
ss_list a list with ss, representing the bools for each cluster
xx grid in x-domain
yy grid in y-domain
zz grid in z-domain

§ getMean()

def teetool.world.World.getMean (   self,
  list_icluster = None 
)

returns the mean trajectory [x, y, z] for list_icluster

Parameters
selfobject pointer
list_iclusterspecify clusters
Returns
mean_list a list of means

§ getName()

def teetool.world.World.getName (   self)

returns the name of the world

Parameters
selfobject pointer
Returns
name of the world

§ getSamples()

def teetool.world.World.getSamples (   self,
  icluster,
  nsamples = 50 
)

returns samples in a list of (x, Y) data

Parameters
selfobject pointer
iclusterspecify from which cluster to sample
nsamplesnumber of samples to generate

§ getTube()

def teetool.world.World.getTube (   self,
  list_icluster = None,
  sdwidth = 1,
  resolution = None,
  z = None 
)

returns a grid with bools to specify whether a point falls within the confidence region or not

Parameters
selfobject pointer
list_iclusterwhich clusters to return
sdwidthvariance to test
resolutionthe resolution to produce the grid on
z(optional) height parameter to produce 2d grids for 3d trajectories
Returns
ss_list a list with ss, representing the bools for each cluster
xx grid in x-domain
yy grid in y-domain
zz grid in z-domain

§ getTubeStats()

def teetool.world.World.getTubeStats (   self,
  list_icluster = None,
  sdwidth = 1.,
  resolution = None 
)

obtain statistics of confidence region in scenarios

Parameters
selfobject pointer
list_iclusterlist of clusters to analyse
sdwidthvariance to evaluate
resolutionresolution of grid

§ isInside()

def teetool.world.World.isInside (   self,
  P,
  sdwidth = 1,
  list_icluster = None 
)
returns list of bools, whether or not the points P are inside any of the models

list_icluster can be set to limit the check to a single values

§ overview()

def teetool.world.World.overview (   self)

prints an overview (text)

Parameters
selfobject pointer

Member Data Documentation

§ _clusters

teetool.world.World._clusters
private

list holding clusters

§ _name

teetool.world.World._name
private

name of world

§ _ndim

teetool.world.World._ndim
private

number of dimensions trajectory data

§ _resolution

teetool.world.World._resolution
private

resolution of grid

§ fraction_to_expand

teetool.world.World.fraction_to_expand

fraction on edges, default 0.1


The documentation for this class was generated from the following file: