tangos

Tangos is a system for building and querying databases summarising the results of numerical galaxy simulations.

Learn more in the following categories:

View the Project on GitHub

Tangos lets you build a database (along the lines of Eagle or MultiDark) for your own cosmological and zoom simulations.

Once tangos is set up, you’ll be able to access your simulations from a web browser:

Tangos and its web server

Acknowledging the code

When using tangos, please acknowledge it by citing the release paper: Pontzen & Tremmel, 2018, ApJS 237, 2. DOI 10.3847/1538-4365/aac832; arXiv:1803.00010. Optionally you can also cite the Zenodo DOI for the specific version of tangos that you are using, which may be found here.

Installation: the very quick version

To install tangos first clone the repository, then use the standard setuptools install command; for the most recent published version use:

pip install tangos

or, for the latest version from the repository use pip install git+https://github.com/pynbody/tangos.git.

This should check for and install the minimum prerequisites, but doesn’t install pynbody. That’s because tangos is written to be agnostic about how the underlying simulation snapshots are read so in principle you could use e.g. yt. For all current tutorials, pynbody is the preferred reading system and so for an easy life you should install it: pip install pynbody, or again for the latest version you can use pip install git+https://github.com/pynbody/pynbody.git.

Installation with tests and ancillary dependencies

If you wish to run the test suite (which is advised) or are planning to develop using tangos, it is preferable to keep the source repository handy, in which case instead of the instructions above use:

git clone https://github.com/pynbody/tangos.git
cd tangos
python setup.py develop

To run the tests, you will also need to install yt, pytest, webtest, pyquery and _pynbody e.g. using pip install yt pyquery pytest webtest pynbody.

Once installed, you should check that tangos is functioning correctly by entering the tests folder and typing pytest. You should see a bunch of text scrolling by, ultimately finishing with the simple message OK. If you get a failure message instead of OK, report it (with as much detail of your setup as possible) in the github issue tracker.

Setting up paths

By default tangos will look for raw simulation data in your home folder and create its database file there as well. If you don’t want it to do this, you can set the environment variables TANGOS_SIMULATION_FOLDER (for the simulation folder) and TANGOS_DB_CONNECTION (for the database file). For example, in bash:

export TANGOS_SIMULATION_FOLDER=/path/to/simulations/folder/
export TANGOS_DB_CONNECTION=/path/to/sqlite.db

or, in cshell:

setenv TANGOS_SIMULATION_FOLDER /path/to/simulations/folder/
setenv TANGOS_DB_CONNECTION /path/to/sqlite.db

The top line in each example points to the parent directory for all of your simulation data directories. If you don’t have any simulations (i.e. you are just using a database object already created) then you should not have to worry about this variable. The second line points to the database object you wish to analyze; by default this will be a sqlite file but you can also specify a sqlalchemy URL; see also the notes on MySQL / MariaDB below.

Remember, you will need to set these environment variables every time you start a new session on your computer prior to booting up the database, either with the webserver or the python interface (see below).

Where next?

Now that you’ve set up the basics, you can either make your first tangos database using some tutorial data or download an existing database to perform data analysis.