API Reference

Working with Merger Trees

The load can load all supported merger tree formats. Once loaded, the save_arbor and save_tree functions can be used to save the entire arbor or individual trees.

load(filename[, method]) Load an Arbor, determine the type automatically.
Arbor(filename) Base class for all Arbor classes.
add_alias_field(alias, field[, units, force_add]) Add a field as an alias to another field.
add_analysis_field(name, units[, dtype, default]) Add an empty field to be filled by analysis operations.
add_derived_field(name, function[, units, …]) Add a field that is a function of other fields.
add_vector_field(name) Add vector fields for a set of x,y,z component fields.
save_arbor(**kwargs) Save the arbor to a file.
select_halos(criteria[, trees, select_from, …]) Select halos from the arbor based on a set of criteria given as a string.
set_selector(selector, *args, **kwargs) Sets the tree node selector to be used.
TreeNode(uid[, arbor, root]) Class for objects stored in Arbors.
get_leaf_nodes([selector]) Get all leaf nodes from the tree of which this is the head.
get_root_nodes() Get all root nodes from the forest to which this node belongs.
get_node(selector, index) Get a single TreeNode from a tree.
save_tree([filename, fields]) Save the tree to a file.
TreeNodeSelector(function[, args, kwargs]) The TreeNodeSelector is responsible for choosing which one of a halo’s ancestors to return when querying the line of main progenitors for a halo.
TreeNodeSelector(function[, args, kwargs]) The TreeNodeSelector is responsible for choosing which one of a halo’s ancestors to return when querying the line of main progenitors for a halo.
add_tree_node_selector(name, function) Add a TreeNodeSelector to the registry of known selectors, so they can be chosen with set_selector.
max_field_value(ancestors, field) Return the TreeNode with the maximum value of the given field.
min_field_value(ancestors, field) Return the TreeNode with the minimum value of the given field.
get_yt_selection([above, below, equal, …]) Get a selection of halos meeting given criteria.
get_nodes_from_selection(container) Generate TreeNodes from a yt data container.
ytds Load as a yt dataset.

Visualizing Merger Trees

Functionality for plotting merger trees.

TreePlot(tree[, dot_kwargs, node_function, …]) Make a simple merger tree plot using pydot and graphviz.
save([filename]) Save the merger tree plot.

Analysis Pipeline

Machinery for creating a pipeline of analysis to be run on halos in a merger tree.

AnalysisPipeline([output_dir]) Initialize an AnalysisPipeline.
add_operation(function, *args[, always_do]) Add an operation to the AnalysisPipeline.
add_recipe(function, *args, **kwargs) Add a recipe to the AnalysisPipeline.
process_target(target) Process a node through the AnalysisPipeline.
AnalysisOperation(function, *args[, always_do]) An analysis task performed by an AnalysisPipeline.

Parallelism

Functions for iterating over trees and/or nodes in parallel.

parallel_trees(trees[, save_every, …]) Iterate over a list of trees in parallel.
parallel_tree_nodes(tree[, group, njobs, …]) Iterate over nodes in a single tree in parallel.
parallel_nodes(trees[, group, save_every, …]) Iterate over all nodes in a list of trees in parallel.

Internal Classes

Base Classes

All frontends inherit from these base classes for arbor, fields, and i/o.

Arbor(filename) Base class for all Arbor classes.
SegmentedArbor(filename) Arbor subclass for multi-file datasets where an entire merger tree is contained within a file (i.e., no overlap).
CatalogArbor(filename) Base class for Arbors created from a series of halo catalog files where the descendent ID for each halo has been pre-determined.
Detector Base class for detecting field dependencies and testing operations.
FieldDetector(arbor[, name]) A fake field data container used to calculate dependencies.
SelectionDetector(arbor) A TreeNode-like object to test select_halos criteria.
FieldInfoContainer(arbor) A container for information about fields.
FieldContainer(arbor) A container for field data.
FieldIO(arbor[, default_dtype]) Base class for FieldIO classes.
TreeFieldIO(arbor[, default_dtype]) IO class for getting fields for a tree.
DefaultRootFieldIO(arbor[, default_dtype]) Class for getting root fields from arbors that have no specialized storage for root fields.
DataFile(filename) Base class for data files.
CatalogDataFile(filename, arbor) Base class for halo catalog files.

Arbor Subclasses

Arbor subclasses for each frontend.

AHFArbor(filename[, log_filename, …]) Arbor for Amiga Halo Finder data.
ConsistentTreesArbor(filename) Arbors loaded from consistent-trees tree_*.dat files.
ConsistentTreesGroupArbor(filename) Arbors loaded from consistent-trees locations.dat files.
ConsistentTreesHlistArbor(filename) Class for Arbors created from consistent-trees hlist_*.list files.
ConsistentTreesHDF5Arbor(filename[, access]) Arbors loaded from consistent-trees data converted into HDF5.
LHaloTreeArbor(*args, **kwargs) Arbors for LHaloTree data.
LHaloTreeHDF5Arbor(filename[, …]) IllustrisTNG format.
MoriaArbor(filename) Arbors from Moria merger trees.
RockstarArbor(filename) Class for Arbors created from Rockstar out_*.list files.
TreeFarmArbor(filename) Class for Arbors created with TreeFarm.
YTreeArbor(filename) Class for Arbors created from the save_arbor or save_tree functions.

FieldInfo Subclasses

Subclasses for frontend-specific field definitions.

AHFFieldInfo(arbor)
ConsistentTreesFieldInfo(arbor)
ConsistentTreesHDF5FieldInfo(arbor)
LHaloTreeFieldInfo(arbor)
LHaloTreeHDF5FieldInfo(arbor)
MoriaFieldInfo(arbor)
RockstarFieldInfo(arbor)
TreeFarmFieldInfo(arbor)

FieldIO Subclasses

Subclasses for data i/o from a whole dataset.

ConsistentTreesTreeFieldIO(arbor[, …])
ConsistentTreesHDF5TreeFieldIO(arbor[, …])
ConsistentTreesHDF5RootFieldIO(arbor[, …]) Read in fields for first node in all trees/forest.
LHaloTreeTreeFieldIO(arbor[, default_dtype])
LHaloTreeRootFieldIO(arbor[, default_dtype])
LHaloTreeHDF5TreeFieldIO(arbor[, default_dtype])
MoriaTreeFieldIO(arbor[, default_dtype])
YTreeTreeFieldIO(arbor[, default_dtype])
YTreeRootFieldIO(arbor[, default_dtype])

DataFile Subclasses

Subclasses for data i/o from individual files.

AHFDataFile(filename, arbor)
ConsistentTreesDataFile(filename)
ConsistentTreesHlistDataFile(filename, arbor)
ConsistentTreesHDF5DataFile(filename, linkname)
LHaloTreeHDF5DataFile(filename, linkname)
MoriaDataFile(filename)
RockstarDataFile(filename, arbor)
TreeFarmDataFile(filename, arbor)
YTreeDataFile(filename)