tracktable.domain module¶
Submodules¶
Module contents¶
Tracktable Trajectory Library - Domains module
Here you will find the modules containing point, trajectory and reader types for each different point domain.
- tracktable.domain.domain_class(domain_name, class_name)[source]¶
Fetch the class object for a named class in a named domain
Given the name of a Tracktable domain (terrestrial, cartesian2d, cartesian3d, feature_vectores) and the name of a class (BasePoint, TrajectoryPoint, Trajectory, BoundingBox), return the class object so that you can instantiate it.
- Parameters
{string} (class_name) – Name of point domain. Must be one of “terrestrial”, “cartesian2d”, “cartesian3d”, or “feature_vectors”.
{string} – Name of class. Must be one of “BasePoint”, “TrajectoryPoint”, “Trajectory”, or “BoundingBox”.
- Returns
Class object for the specified class.
- Raises
AttributeError – you specified a domain or a class that doesn’t exist
- tracktable.domain.domain_class_for_object(thing: object, class_name: string) class object [source]¶
Given a Tracktable object (point, trajectory point, trajectory or bounding box) and the name of a related class, return the class object for that related class.
This helps you retrieve related classes for a domain object if you don’t know the domain a priori. For example, if the user wants a bounding box for some arbitrary trajectory, you can ask for “whatever BoundingBox type corresponds to this object”.
- Parameters
thing (object) – Tracktable domain object
desired_class (string) – Name of desired class
- Returns
Class object for the requested class
- Raises
AttributeError – you supplied an object that does not have a ‘domain’ attribute or asked for a domain class that does not exist
- tracktable.domain.domain_module_for_object(thing: object) domain module [source]¶
Given a Tracktable object (point, trajectory point, trajectory or bounding box), return the module for that object’s point domain.
This helps you retrieve related classes for a domain object if you don’t know the domain a priori.
- Parameters
thing (object) – Tracktable domain object
- Returns
Module object for that point’s domain
- Raises
AttributeError – you supplied an object that does not have a ‘domain’ attribute
- tracktable.domain.domain_module_from_name(name: string) domain module [source]¶
Given the name of one of Tracktable’s point domains (terrestrial, cartesian2d, cartesian3d), return the module object for that domain.
This helps you retrieve related classes for a domain object when you don’t know the domain a priori.
- Parameters
[string] (_domain) – Name of point domain
- Returns
Module object for specified domain
- Raises
AttributeError – you’ve asked for a domain that doesn’t exist