Skip to main content

An extension of yt for working with merger-tree data.

Project description

ytree

Build Status Coverage Status Documentation Status PyPI version DOI

This is ytree, a yt extension for working with merger tree data.

Structure formation in cosmology proceeds in a hierarchical fashion, where dark matter halos grow via mergers with other halos. This type of evolution can be conceptualized as a tree, with small branches connecting to successively larger ones, and finally to the trunk. A merger tree describes the growth of halos in a cosmological simulation by linking a halo appearing in a given snapshot to its direct ancestors in a previous snapshot and its descendent in the next snapshot.

Merger trees are computationally expensive to generate and a great number of codes exist for computing them. However, each of these codes saves the resulting data to a different format. ytree is Python package for reading and working with merger tree data from multiple formats. If you are already familiar with using yt to analyze snapshots from cosmological simulations, then think of ytree as the yt of merger trees.

To load a merger tree data set with ytree and print the masses of all the halos in a single tree, one could do:

>>> import ytree
>>> a = ytree.load('tree_0_0_0.dat')
>>> my_tree = a[0]
>>> print(my_tree['tree', 'mass'].to('Msun'))
[6.57410072e+14 6.57410072e+14 6.53956835e+14 6.50071942e+14 ...
 2.60575540e+12 2.17122302e+12 2.17122302e+12] Msun

A list of all currently supported formats can be found in the online documentation. If you would like to see support added for another format, we would be happy to work with you to make it happen. In principle, any type of tree-like data where an object has one or more ancestors and a single descendent can be supported.

Installation

ytree can be installed with pip:

pip install ytree

To get the development version, clone this repository and install like this:

git clone https://github.com/ytree-project/ytree
cd ytree
pip install -e .

Getting Started

Below is a notebook that demonstrates how to use ytree with merger tree data. For more information, see the full ytree documentation.

Sample Data

Sampled data for all merger tree formats supported by ytree is available on the yt Hub in the ytree data collection.

Contributing

ytree would be much better with your contribution! As an extension of the yt Project, we follow the yt guidelines for contributing.

Citing ytree

If you use ytree in your work, please cite the following:

Britton Smith, & Meagan Lang. (2018, February 16). ytree: merger-tree toolkit. Zenodo.
https://doi.org/10.5281/zenodo.1174374

For BibTeX users:

  @misc{britton_smith_2018_1174374,
    author       = {Britton Smith and
                    Meagan Lang},
    title        = {ytree: merger-tree toolkit},
    month        = feb,
    year         = 2018,
    doi          = {10.5281/zenodo.1174374},
    url          = {https://doi.org/10.5281/zenodo.1174374}
  }

If possible, please also add a footnote pointing to https://ytree.readthedocs.io.

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ytree-2.3.tar.gz (154.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ytree-2.3-py2.py3-none-any.whl (73.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ytree-2.3.tar.gz.

File metadata

  • Download URL: ytree-2.3.tar.gz
  • Upload date:
  • Size: 154.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.4

File hashes

Hashes for ytree-2.3.tar.gz
Algorithm Hash digest
SHA256 6f9974efa84d0f58fe96ada165241a39248bf500670a170b1d3186856b175d0e
MD5 7a945f0445b324919571e8fdb91a3130
BLAKE2b-256 3bf56c0650a47ae9dc69436dd96141be040121a4fb9ae136397eef03a149852f

See more details on using hashes here.

File details

Details for the file ytree-2.3-py2.py3-none-any.whl.

File metadata

  • Download URL: ytree-2.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 73.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.4

File hashes

Hashes for ytree-2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5375463c8f22102d242b5de0fe60a59db405ba0c9cbd80db4494646773a29ce0
MD5 4b49988b5a78160006c4ccfc46d23815
BLAKE2b-256 c377d7985cdaee64afc7f2edb15819b8d193b62bfef7a789448e3b771b7732f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page