pygplates.ReconstructionTreeEdge
- class pygplates.ReconstructionTreeEdge
Bases:
Boost.Python.instance
A reconstruction tree edge represents a moving/fixed plate pair in the graph of the plate-reconstruction hierarchy. See Plate reconstruction hierarchy.
- __init__()
Raises an exception This class cannot be instantiated from Python
Methods
Raises an exception This class cannot be instantiated from Python
Returns a view, of the child
edges
of this edge, that supports iteration over the child edges as well as indexing into the child edges.Return equivalent (relative to the anchor plate) finite rotation of the moving plate of this edge.
Return the fixed plate id of this edge.
Return the moving plate id of this edge.
Return the parent edge of this edge, or
None
if this edge has no parent.Return finite rotation of the moving plate of this edge relative to the fixed plated id of this edge.
- get_child_edges()
Returns a view, of the child
edges
of this edge, that supports iteration over the child edges as well as indexing into the child edges.A child edge is one step further from the top (or root) of the reconstruction tree (further from the anchor plate). The fixed plate id of each child edge matches the moving plate id of this edge.
Note that the view object returned by this method is not a
list
or an iterator but, like dictionary views in Python 3, alist
or iterator can be obtained from the view as inlist(edge.get_child_edges())
oriter(edge.get_child_edges())
.The returned view provides the following operations for accessing the child edges:
Operation
Result
len(child_edges)
number of child edges
for e in child_edges
iterates over the child edges e
child_edges[i]
the child edge at index i
The following example demonstrates top-down (starting at the anchored plate) traversal of the reconstruction tree:
def traverse_sub_tree(edge): print 'Parent plate: %d, child plate:%d' % (edge.get_fixed_plate_id(), edge.get_moving_plate_id()) # Recurse into the children sub-trees. for child_edge in edge.get_child_edges(): traverse_sub_tree(child_edge) for anchor_plate_edge in reconstruction_tree.get_anchor_plate_edges(): traverse_sub_tree(anchor_plate_edge)
- get_equivalent_total_rotation()
Return equivalent (relative to the anchor plate) finite rotation of the moving plate of this edge.
- Return type
The total in the method name indicates that the rotation is also relative to present day.
This method returns the precomputed equivalent of the following (see
FiniteRotation
for the maths):def get_equivalent_total_rotation(edge): finite_rotation = pygplates.FiniteRotation.create_identity_rotation() while edge: finite_rotation = edge.get_relative_total_rotation() * finite_rotation edge = edge.get_parent_edge() return finite_rotation
- get_fixed_plate_id()
Return the fixed plate id of this edge.
- Return type
int
- get_moving_plate_id()
Return the moving plate id of this edge.
- Return type
int
- get_parent_edge()
Return the parent edge of this edge, or
None
if this edge has no parent.This method can be used to traverse the plate circuit from an arbitrary plate (moving plate id on an edge) to the anchor plate (terminating at
None
) and visiting moving/fixed relative platerotations
along the way.- Return type
ReconstructionTreeEdge
or None
The parent edge is one step closer to the top (or root) of the reconstruction tree (closer to the anchor plate). The moving plate id of the parent edge matches the fixed plate id of this edge.
None
is returned if this edge is already at the top of the reconstruction tree (if its fixed plate id is the anchor plate id).The following example demonstrates following the plate circuit path from a plate (moving plate of an edge) to the anchor plate (at the top/root of the reconstruction tree):
while True: print 'Plate: %d' % edge.get_moving_plate_id() if not edge.get_parent_edge(): print 'Anchored plate: %d' % edge.get_fixed_plate_id() break edge = edge.get_parent_edge()
- get_relative_total_rotation()
Return finite rotation of the moving plate of this edge relative to the fixed plated id of this edge.
- Return type
The total in the method name indicates that the rotation is also relative to present day.