https://github.com/eggplantbren/andromedamixture
The inference code for our Nature paper about globular clusters in M31/Andromeda.
https://github.com/eggplantbren/andromedamixture
andromeda astronomy bayesian-inference galaxies galaxy-formation globular-clusters markov-chain-monte-carlo model-comparison model-selection nature
Last synced: 3 months ago
JSON representation
The inference code for our Nature paper about globular clusters in M31/Andromeda.
- Host: GitHub
- URL: https://github.com/eggplantbren/andromedamixture
- Owner: eggplantbren
- License: mit
- Created: 2019-03-21T06:30:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T21:52:33.000Z (about 1 year ago)
- Last Synced: 2025-04-06T03:31:51.275Z (7 months ago)
- Topics: andromeda, astronomy, bayesian-inference, galaxies, galaxy-formation, globular-clusters, markov-chain-monte-carlo, model-comparison, model-selection, nature
- Language: C++
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Mixture Model for Andromeda Globular Clusters
=============================================(c) 2019 Brendon J. Brewer and Geraint F. Lewis.
This is free software
released under the terms of the MIT license.
It was used to do the model comparison and
parameter estimation calculations for the following paper
(Nature, 2019, accepted):_Two major accretion epochs in M31 from two distinct populations of globular clusters_
Dougal Mackey, Geraint F. Lewis, Brendon J. Brewer, Annette M. N. Ferguson, Jovan Veljanoski, Avon P. Huxor, Michelle L. M. Collins, Patrick Côté, Rodrigo A. Ibata, Mike J. Irwin, Nicolas Martin, Alan W. McConnachie, Jorge Peñarrubia, Nial Tanvir, Zhen Wan
Instructions to Reproduce Results in the Paper
==============================================You will require all the dependencies of [DNest4](https://github.com/eggplantbren/DNest4),
plus [corner.py](https://github.com/dfm/corner.py).
First, clone this repo recursively and compile the C++:```
git clone --recursive https://github.com/eggplantbren/AndromedaMixture
cd AndromedaMixture
make
```Install the DNest4 Python package (unless you already have it), like this (Mac users, see the DNest4 manual for something extra you need to do):
```
cd DNest4/python
python setup.py install
```Now go back to the directory containing the binary, and run DNest4 with ten threads
and a random number seed of 1 (this will run model V2, the favoured model):```
cd ../..
./main -t 10 -s 1
```Once that's finished (it produces 100,000 saved particles), run the postprocessing script:
```
python showresults.py
```This will produce three DNest4 plots and output the marginal likelihood to the screen
and posterior samples to `posterior_sample.txt` (one parameter per column, see the header
line for the meaning of each column).
After closing those plots, it will produce the corner plot and save it to corner.png.Changing the rotation model
===========================The default rotation model is V2 from the paper. Modify lines 13 and 14 of `main.cpp`
and re-compile by running `make` to use a different rotation model. For example, to
use model S1, these lines should be modified to```
constexpr RotationModel rotation_model = RotationModel::S;
constexpr int num_components = 1;
```To exactly reproduce the results from the paper, don't forget to use the
correct random number seed from Table 3.