Once tangos is set up, you’ll be able to access your simulations from a web browser:
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.
To install tangos first clone the repository, then use the standard setuptools
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.
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
pytest. You should see a bunch of text scrolling by, ultimately finishing with the simple message
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.
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)
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).
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.