Getting Started

Installation notes

MARTINI works with python3 (version 3.10 or higher).

Stable releases are available via PyPI:

python3 -m pip install astromartini

and the numbered releases (starting from 2.0.0) on github. The github main branch is actively developed: things will change, bugs will happen. Any feedback is greatly appreciated via github issues or kyle.a.oman@durham.ac.uk.

The easiest way to install MARTINI is from PyPI by doing python3 -m pip install astromartini. Output to .fits files is supported by default; if output to .hdf5 format is desired use python3 -m pip install "astromartini[hdf5_output]" instead. This will also handle the installation of the required dependencies. Other optional features require additional dependencies hosted on PyPI. In particular, EAGLE, Illustris/TNG, Simba and FIRE users who wish to use the custom source modules for those simulations in MARTINI can automatically install the optional dependencies with python3 -m pip install "astromartini[eaglesource]", python3 -m pip install "astromartini[simbasource]", python3 -m pip install "astromartini[tngsource]", or python3 -m pip install "astromartini[firesource]".

Installing from github

You can browse releases that correspond to versions on PyPI (starting from 2.0.0) and download the source code. Unpack the zip file if necessary. If you’re feeling adventurous or looking for a feature under development you can so browse branches and choose one to clone. In either case you should then be able to do python3 -m pip install "martini/[optional]", where optional should be replaced by a comma separated list of optional dependencies. If this fails check that martini/ is a path pointing to the directory containing the pyproject.toml file for MARTINI. The currently available options are:

  • parallel: Support for parallelizing the slower parts of Martini calculations.

  • hdf5_output: Supports output to hdf5 files via the h5py package. Since h5py is hosted on PyPI, this option may be used when installing via PyPI.

  • colibresource: Dependencies for the ColibreSource module, which greatly simplifies reading input from Colibre snapshots. Install swiftsimio and swiftgalaxy.

  • eaglesource: Dependencies for the EAGLESource module, which greatly simplifies reading input from EAGLE simulation snapshots. Installs my Hdecompose package, providing implementations of the Rahmati et al. (2013) method for computing netural hydrogen fractions and the Blitz & Rosolowsky (2006) method for atomic/molecular fractions. Also installs my python-only version of John Helly’s read_eagle package for quick extraction of particles in a simulation sub-volume. h5py is also required.

  • firesource: Dependencies for the FIRESource module, which greatly simplifies reading input from FIRE simulation snapshots. Installs the gizmo-analysis, halo-analysis and utilities-awetzel packages.

  • magneticumsource: Dependencies for the MagneticumSource module, which supports the Magneticum simulations via the g3read package.

  • simbasource: Dependencies for the SimbaSource module, which greatly simplifies reading input from Simba snapshots. Installs h5py.

  • swiftgalaxysource: Dependencies for the SWIFTGalaxySource module, which greatly simplifies reading input from SWIFT simulations. Installs swiftsimio and swiftgalaxy.

  • tngsource: Dependencies for the TNGSource module, which greatly simplifies reading input from IllustrisTNG (and original Illustris) snapshots. Installs my Hdecompose package, providing implementations of the Rahmati et al. (2013) method for computing netural hydrogen fractions and the Blitz & Rosolowsky (2006) method for atomic/molecular fractions.

  • all: All of the above.

  • testing: Dependencies for code validation and testing (for developers).

  • docs: Dependencies for building the documentation (for developers).

  • dev: A full development environment with verything included in all, testing and docs (for developers).

There is also a SOSource module with additional dependencies, which provides unofficial support for several simulation datasets hosted on specific systems. This is intended mostly for my own use, but APOSTLE, C-EAGLE/Hydrangea and Auriga users may contact me for further information.

Quickstart guide

See the help for Martini for an example script to configure MARTINI and create a datacube. This example can be run by doing:

python -c "from martini import demo; demo()"

MARTINI has (so far) been successfully run on the output of these simulations:

  • EAGLE (also APOSTLE, C-EAGLE/Hydrangea)

  • IllustrisTNG (also Illustris, Auriga)

  • Simba

  • FIRE

  • Magneticum

  • MaGICC, Marvelous-Merian (and therefore in principle other N-body shop projects)

  • Colibre (test runs)

I attempt to support publicly available simulations with a customized source module. If your simulation is public and not supported, please contact me. Currently custom source modules exist for:

Example notebooks are available for supported, publicly available simulations.