Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.1%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: sambit-giri
- License: mit
- Language: Python
- Default Branch: master
- Size: 162 MB
Statistics
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 1
- Releases: 2
Metadata Files
README.md
BCemu
A Python package for modelling baryonic effects in cosmological simulations.
Package details
The package provides emulators to model the suppression in the power spectrum due to baryonic feedback processes. These emulators are based on the baryonification model (Schneider et al. 2019), where gravity-only N-body simulation results are manipulated to include the impact of baryonic feedback processes. For a detailed description, see Giri & Schneider (2021).
INSTALLATION
One can install a stable version of this package using pip by running the following command::
pip install BCemu
In order to use the latest version, one can clone this package running the following::
git clone https://github.com/sambit-giri/BCemu.git
To install the package in the standard location, run the following in the root directory::
python setup.py install
In order to install it in a separate directory::
python setup.py install --home=directory
One can also install it using pip by running the following command::
pip install git+https://github.com/sambit-giri/BCemu.git
The dependencies should be installed automatically during the installation process. If they fail, you can install them manually before installing BCemu. The list of required packages can be found in the requirements.txt file in the root directory.
Tests
For testing, one can use pytest or nosetests. Both packages can be installed using pip. To run all the test script, run either of the following::
python -m pytest tests
nosetests -v
Citation
If you use BCemu in your research, please cite the following paper:
Giri, S. K., & Schneider, A. (2021). Emulation of baryonic effects on the matter power spectrum and constraints from galaxy cluster data. Journal of Cosmology and Astroparticle Physics, 2021(12), 046. https://doi.org/10.1088/1475-7516/2021/12/046
BibTeX entries:
bibtex
@article{giri2021emulation,
title={Emulation of baryonic effects on the matter power spectrum and constraints from galaxy cluster data},
author={Giri, Sambit K and Schneider, Aurel},
journal={Journal of Cosmology and Astroparticle Physics},
volume={2021},
number={12},
pages={046},
year={2021},
publisher={IOP Publishing}
}
USAGE
Script to get the baryonic power suppression.
```python import numpy as np import matplotlib.pyplot as plt import BCemu
bfcemu = BCemu.BCM_7param(Ob=0.05, Om=0.27)
bcmdict = {'log10Mc': 13.32,
'mu' : 0.93,
'thej' : 4.235,
'gamma' : 2.25,
'delta' : 6.40,
'eta' : 0.15,
'deta' : 0.14,
}
z = 0 keval = 10**np.linspace(-1,1.08,50) peval = bfcemu.getboost(z, bcmdict, keval)
plt.semilogx(keval, peval, c='C0', lw=3) plt.axis([1e-1,12,0.73,1.04]) plt.yticks(fontsize=14) plt.xticks(fontsize=14) plt.xlabel(r'$k$ (h/Mpc)', fontsize=14) plt.ylabel(r'$\frac{P{\rm DM+baryon}}{P{\rm DM}}$', fontsize=21) plt.tight_layout() plt.show()
```

The package also has a three-parameter baryonification model. Model A assumes all three parameters to be independent of redshift while model B assumes the parameters to be redshift-dependent via the following form:
.
Below an example fit to the BAHAMAS simulation result is shown.
```python import numpy as np import matplotlib.pyplot as plt import BCemu import pickle
BAH = pickle.load(open('examples/BAHAMAS_data.pkl', 'rb'))
bfcemu = BCemu.BCM_3param(Ob=0.0463, Om=0.2793)
bcmdict = {'log10Mc': 13.25,
'thej' : 4.711,
'deta' : 0.097}
zs = [0,0.5] keval = 10**np.linspace(-1,1.08,50) p0eval1 = bfcemu.getboost(zs[0], bcmdict, keval) p1eval1 = bfcemu.getboost(zs[1], bcmdict, k_eval)
bfcemu = BCemu.BCM3param(Ob=0.0463, Om=0.2793)
bcmdict = {'log10Mc': 13.25,
'thej' : 4.711,
'deta' : 0.097,
'nuMc' : 0.038,
'nuthej': 0.0,
'nudeta': 0.060}
zs = [0,0.5] keval = 10**np.linspace(-1,1.08,50) p0eval2 = bfcemu.getboost(zs[0], bcmdict, keval) p1eval2 = bfcemu.getboost(zs[1], bcmdict, k_eval)
plt.figure(figsize=(10,4.5)) plt.subplot(121); plt.title('z=0') plt.semilogx(BAH['z=0']['k'], BAH['z=0']['S'], '-', c='k', lw=5, alpha=0.2, label='BAHAMAS') plt.semilogx(keval, p0eval1, c='C0', lw=3, label='A', ls='--') plt.semilogx(keval, p0eval1, c='C2', lw=3, label='B', ls=':') plt.axis([1e-1,12,0.73,1.04]) plt.yticks(fontsize=14) plt.xticks(fontsize=14) plt.legend() plt.xlabel(r'$k$ (h/Mpc)', fontsize=14) plt.ylabel(r'$\frac{P{\rm DM+baryon}}{P{\rm DM}}$', fontsize=21) plt.subplot(122); plt.title('z=0.5') plt.semilogx(BAH['z=0.5']['k'], BAH['z=0.5']['S'], '-', c='k', lw=5, alpha=0.2, label='BAHAMAS') plt.semilogx(keval, p1eval1, c='C0', lw=3, label='A', ls='--') plt.semilogx(keval, p1eval2, c='C2', lw=3, label='B', ls=':') plt.axis([1e-1,12,0.73,1.04]) plt.yticks(fontsize=14) plt.xticks(fontsize=14) plt.xlabel(r'$k$ (h/Mpc)', fontsize=14) plt.ylabel(r'$\frac{P{\rm DM+baryon}}{P{\rm DM}}$', fontsize=21) plt.tight_layout() plt.show()
```

CONTRIBUTING
If you find any bugs or unexpected behaviour in the code, please feel free to open a Github issue. The issue page is also good if you seek help or have suggestions for us.
References
[1] Schneider, A., Teyssier, R., Stadel, J., Chisari, N. E., Le Brun, A. M., Amara, A., & Refregier, A. (2019). Quantifying baryon effects on the matter power spectrum and the weak lensing shear correlation. Journal of Cosmology and Astroparticle Physics, 2019(03), 020. arXiv:1810.08629.
[2] Giri, S. K. & Schneider, A. (2021). Emulation of baryonic effects on the matter power spectrum and constraints from galaxy cluster data. Journal of Cosmology and Astroparticle Physics, 2021(12), 046. arXiv:2108.08863.
Owner
- Name: Sambit Kumar Giri
- Login: sambit-giri
- Kind: user
- Location: Zurich
- Company: University of Zurich
- Website: https://sambit-giri.github.io/
- Twitter: sam_giri
- Repositories: 10
- Profile: https://github.com/sambit-giri
GitHub Events
Total
- Push event: 19
- Fork event: 1
Last Year
- Push event: 19
- Fork event: 1
Committers
Last synced: about 3 years ago
All Time
- Total Commits: 58
- Total Committers: 1
- Avg Commits per committer: 58.0
- Development Distribution Score (DDS): 0.0
Top Committers
| Name | Commits | |
|---|---|---|
| sambit-giri | s****i@o****m | 58 |
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 100 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 6
- Total maintainers: 1
pypi.org: bcemu
Using emulators to implement baryonic effects.
- Homepage: https://github.com/sambit-giri/BCemu.git
- Documentation: https://bcemu.readthedocs.io/
- License: mit
-
Latest release: 1.1.4
published 9 months ago
Rankings
Maintainers (1)
Dependencies
- astropy *
- cython *
- matplotlib *
- numpy *
- pickle *
- scikit-learn *
- scipy *
- smt ==1.0.0
- astropy *
- cython *
- matplotlib *
- numpy *
- scikit-learn *
- scipy *
- smt ==1.0.0
- wget *