phantom-setup: generate initial conditions for Phantom simulations in pure Python!
Install via pip.
pip install phantomsetup
Python 3.7+ with h5py, numba, numpy, phantomconfig, scipy, and tomlkit.
To generate initial conditions for a Phantom simulation via a Python script with phantom-setup:
- Instantiate a
phantomsetup.Setup
object. - Add particles, set arrays, units, equation of state, sinks, dust, and other parameters.
- Write a Phantom HDF5 dump file containing the particle arrays.
- Write a Phantom in file containing the run time parameters.
- Compile Phantom with the correct Makefile variables.
Then run Phantom.
The examples
folder contains examples in the form of Jupyter notebooks.
phantom-build is a Python package designed to make it easy to generate reproducible Phantom builds for writing reproducible papers. You can generate .in
and .setup
files with phantom-config and then, with phantom-build, you can compile Phantom and set up multiple runs, and schedule them via, for example, the Slurm job scheduler.
phantom-config is a Python package designed to parse, convert, modify, and generate Phantom config files. It also facilitates generating multiple files from dictionaries for parameter sweeps.