ytree.arbor.tree_node.TreeNode

class ytree.arbor.tree_node.TreeNode(uid, arbor=None, root=False)

Class for objects stored in Arbors.

Each TreeNode represents a halo in a tree. A TreeNode knows its halo ID, the level in the tree, and its global ID in the Arbor that holds it. It also has a list of its ancestors. Fields can be queried for it, its progenitor list, and the tree beneath.

__init__(uid, arbor=None, root=False)

Initialize a TreeNode with at least its halo catalog ID and its level in the tree.

Methods

__init__(uid[, arbor, root]) Initialize a TreeNode with at least its halo catalog ID and its level in the tree.
add_ancestor(ancestor) Add another TreeNode to the list of ancestors.
clear_fields() If a root node, delete field data.
pwalk() An iterator over all TreeNodes in the progenitor list, starting with this TreeNode.
query(key) Return field values for this TreeNode, progenitor list, or tree.
reset() Reset all data structures.
save_tree([filename, fields]) Save the tree to a file.
twalk() An iterator over all TreeNodes in the tree beneath, starting with this TreeNode.

Attributes

ancestors
desc_uids
is_root
nodes
tree_size
uids