Skip to content

jacobseiler/sage-model

 
 

Repository files navigation

Travis Badge RTD Badge Codacy Badge

Semi-Analytic Galaxy Evolution (SAGE)

SAGE is a publicly available code-base for modelling galaxy formation in a cosmological context. A description of the model and its default calibration results can be found in Croton et al. (2016). SAGE is a significant update to that previously used in Croton et al. (2006).

SAGE is written in C and was built to be modular and customisable. It will run on any N-body simulation whose trees are organised in a supported format and contain a minimum set of basic halo properties. For testing purposes, treefiles for the mini-Millennium Simulation are available here.

Galaxy formation models built using SAGE on the Millennium, Bolshoi and simulations can be downloaded at the Theoretical Astrophysical Observatory (TAO). You can also find SAGE on ascl.net.

Getting Started

Pre-Requisites

SAGE should compile on most systems out of the box and the only required tool is a C99 compiler. GSL is recommended but not necessary.

Downloading

SAGE can be installed by cloning the GitHub repository:

$ git clone https://github.com/sage-home/sage-model
$ cd sage-model/

Building

To create the SAGE executable, simply run the following command:

$ make

SAGE is MPI compatible which can be enabled setting USE-MPI = yes in the Makefile. To run in parallel, ensure that you have a installed an MPI distribution (OpenMPI, MPICH, Intel MPI etc). When compiling with MPI support, the Makefile expects that the MPI compiler is called mpicc and is configured appropriately.

Addtionally, SAGE can be configured to read trees in HDF5 format by setting USE-HDF5 = yes in the Makefile. If the input trees are in HDF5 format, or you wish to output the catalogs in HDF5 (rather than the default binary format), then please compile with the USE-HDF5 = yes option.

Running the code

If this the first time running the code, we recommend executing first_run.sh. This script will initialize the directories for the default parameter file and download the Mini-millennium dark matter halo trees:

$ ./first_run.sh

After this, the model can be run using:

$ ./sage input/millennium.par

or in parallel as:

$ mpirun -np <NUMBER_PROCESSORS> ./sage input/millennium.par

Plotting the Output

Requirements

Analysis can only be performed in Python version >3.6

We recommend first setting a Python virtual environment to perform analysis in. We refer to the official documentation but a virtual environment can be quickly created and activated through:

$ python3 -m venv .sage_venv
$ source .sage_venv/bin/activate

The packages in requirements.txt can then be safely installed.

$ pip install -r requirements.txt

Plotting

The plotting directory contains an example.py script that can be run to plot the basic output from SAGE.

$ cd plotting/
$ python example.py

This will create a number of plots in the plotting/plots/ directory. Please refer to the sage_analysis documentation for a thorough guide on how to adjust the plotting script to suit your needs.

Citation

If you use SAGE in a publication, please cite the following items:

@ARTICLE{2016ApJS..222...22C,
    author = {{Croton}, D.~J. and {Stevens}, A.~R.~H. and {Tonini}, C. and
            {Garel}, T. and {Bernyk}, M. and {Bibiano}, A. and {Hodkinson}, L. and
            {Mutch}, S.~J. and {Poole}, G.~B. and {Shattow}, G.~M.},
    title = "{Semi-Analytic Galaxy Evolution (SAGE): Model Calibration and Basic Results}",
    journal = {\apjs},
    archivePrefix = "arXiv",
    eprint = {1601.04709},
    keywords = {galaxies: active, galaxies: evolution, galaxies: halos, methods: numerical},
    year = 2016,
    month = feb,
    volume = 222,
    eid = {22},
    pages = {22},
    doi = {10.3847/0067-0049/222/2/22},
    adsurl = {http://adsabs.harvard.edu/abs/2016ApJS..222...22C},
    adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Author

Questions and comments can be sent to Darren Croton: dcroton@astro.swin.edu.au.

Maintainers

  • Jacob Seiler (@jacobseiler)
  • Manodeep Sinha (@manodeep)
  • Darren Croton (@darrencroton)

About

Code for Semi-Analytic Galaxy Evolution (sage)

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 92.7%
  • Python 3.9%
  • Shell 2.0%
  • Makefile 1.4%