A post-processing model for globular cluster formation in cosmological simulations.
The code is open source under a BSD 3-Clause License, which allows you to redistribute and modify the code with moderate limitations. If you use this code for a publication, we kindly request you to cite the following original papers.
- A. L. Muratov & O. Y. Gnedin (2010), ApJ, 718, 1266
- H. Li & O. Y. Gnedin (2014), ApJ, 796, 10
- N. Choksi, O. Y. Gnedin, & H. Li (2018), MNRAS, 480, 2343
- Y. Chen & O. Y. Gnedin (2022), MNRAS, 514, 4736
- Y. Chen & O. Y. Gnedin (2023), MNRAS, 522, 5638
- Y. Chen & O. Y. Gnedin (2024a), MNRAS, 527, 3692
- Y. Chen & O. Y. Gnedin (2024b), OJAp submitted (arXiv:2401.17420)
We also provide a toolkit for parallelization. If you are planning to use the toolkit, please contact us for access!
This is a long developing project starting from Muratov & Gnedin (2010). Some important milestones are Li & Gnedin (2014), Choksi, Gnedin, & Li (2018), Chen & Gnedin (2022), and Chen & Gnedin (2023). This version is the most recent model by Chen & Gnedin (2024a).
We have tested GC_formation_model
on python >= 3.8
. However, lower versions may also work. The prerequisites of this package are
numpy
scipy
h5py
To download the packge, git clone
the source code from GitHub:
$ git clone https://github.com/ybillchen/GC_formation_model.git
Next, cd
the folder and use pip
to install it:
$ cd GC_formation_model/
$ pip install -e .
The -e
command allows you to make changes to the code.
To start with, let's run the model with default parameters
>>> from GC_formation_model import run
>>> from params_example import params
>>> run(params)
You may want to use your own paramters. Then simply replace params_example
with the name of your paramter file.
Feel free to dive in! Raise an issue or submit pull requests.
We recommend you to contribute code to GC_formation_model
following GitHub flow. To summarize, you submit a pull request via the following steps:
- Clone the repository.
- Create and checkout a new branch. For example, a new branch called
new_feature
. - Make changes on
new_feature
and never touch themain
branch again until you are ready to merge. - When you feel ready, submit a pull request on GitHub.
- There may be conflicts. If so, you need to
- Checkout the
main
branch and pull fromorigin
. - Rebase
new_feature
onmain
and address the conflicts (recommended). - Alternatively, you can compare
new_feature
withmain
and fix all conflicts. - Your pull request will update automatically.
- Checkout the
- If your pull request is approved, we will squash and merge your commits.
- We will delete
new_feature
on GitHub when it's merged. You can choose to delete it loacally as well.
NOTE: Any slight modification may entirely change the random number generation! To keep repeatability of the model, please construct a new random generator for the need of new random numbers