2023-03-24T11:04:30,862 Created temporary directory: /tmp/pip-ephem-wheel-cache-r7t13vsg 2023-03-24T11:04:30,868 Created temporary directory: /tmp/pip-build-tracker-mlgxyju3 2023-03-24T11:04:30,868 Initialized build tracking at /tmp/pip-build-tracker-mlgxyju3 2023-03-24T11:04:30,869 Created build tracker: /tmp/pip-build-tracker-mlgxyju3 2023-03-24T11:04:30,869 Entered build tracker: /tmp/pip-build-tracker-mlgxyju3 2023-03-24T11:04:30,870 Created temporary directory: /tmp/pip-wheel-0io9gvk0 2023-03-24T11:04:30,885 DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453 2023-03-24T11:04:30,891 Created temporary directory: /tmp/pip-ephem-wheel-cache-lljeh5a8 2023-03-24T11:04:30,944 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2023-03-24T11:04:30,951 2 location(s) to search for versions of pyspk: 2023-03-24T11:04:30,951 * https://pypi.org/simple/pyspk/ 2023-03-24T11:04:30,951 * https://www.piwheels.org/simple/pyspk/ 2023-03-24T11:04:30,952 Fetching project page and analyzing links: https://pypi.org/simple/pyspk/ 2023-03-24T11:04:30,953 Getting page https://pypi.org/simple/pyspk/ 2023-03-24T11:04:30,957 Found index url https://pypi.org/simple 2023-03-24T11:04:31,141 Fetched page https://pypi.org/simple/pyspk/ as application/vnd.pypi.simple.v1+json 2023-03-24T11:04:31,145 Skipping link: No binaries permitted for pyspk: https://files.pythonhosted.org/packages/5e/28/45cc983684e34adf374c2d114a24861d4d9e1c2250a56078fa251ecde3fa/pyspk-1.0-py3-none-any.whl (from https://pypi.org/simple/pyspk/) 2023-03-24T11:04:31,146 Found link https://files.pythonhosted.org/packages/a8/d2/0734e1e3790826d866e4d99bdc646fba69430f90883d2ba783b2ec83ec06/pyspk-1.0.tar.gz (from https://pypi.org/simple/pyspk/), version: 1.0 2023-03-24T11:04:31,147 Skipping link: No binaries permitted for pyspk: https://files.pythonhosted.org/packages/b1/c7/ee2389a93f921f2c51aac240ab5039aa4d26a5ffcb617b68cbe0e469b4b7/pyspk-1.1-py3-none-any.whl (from https://pypi.org/simple/pyspk/) 2023-03-24T11:04:31,147 Found link https://files.pythonhosted.org/packages/61/93/710ef3373d68aa7569f17af7a78e4dc9cb7f07aafb4cbcc56155120846f7/pyspk-1.1.tar.gz (from https://pypi.org/simple/pyspk/), version: 1.1 2023-03-24T11:04:31,148 Skipping link: No binaries permitted for pyspk: https://files.pythonhosted.org/packages/c2/6b/7271ba22fe0d78e89f627a570997ae4a369fecda22088c350bfe8b9f9b9f/pyspk-1.2-py3-none-any.whl (from https://pypi.org/simple/pyspk/) 2023-03-24T11:04:31,148 Found link https://files.pythonhosted.org/packages/ba/6d/e1283dfc400ad9f9eceacc38e56c49b7614fdb996001ab298678bd394e90/pyspk-1.2.tar.gz (from https://pypi.org/simple/pyspk/), version: 1.2 2023-03-24T11:04:31,149 Fetching project page and analyzing links: https://www.piwheels.org/simple/pyspk/ 2023-03-24T11:04:31,150 Getting page https://www.piwheels.org/simple/pyspk/ 2023-03-24T11:04:31,152 Found index url https://www.piwheels.org/simple 2023-03-24T11:04:31,369 Fetched page https://www.piwheels.org/simple/pyspk/ as text/html 2023-03-24T11:04:31,373 Skipping link: No binaries permitted for pyspk: https://www.piwheels.org/simple/pyspk/pyspk-1.1-py3-none-any.whl#sha256=2c787ef97d85f7abf4348ac04aa1b05fc7f6dc20af7fb5e0dd1551349d6446ac (from https://www.piwheels.org/simple/pyspk/) 2023-03-24T11:04:31,373 Skipping link: No binaries permitted for pyspk: https://www.piwheels.org/simple/pyspk/pyspk-1.0-py3-none-any.whl#sha256=cfc057fd75e4214b94b5938b6e9840b03b3933ac7e44d0c84e2ce139ee2f42da (from https://www.piwheels.org/simple/pyspk/) 2023-03-24T11:04:31,374 Skipping link: not a file: https://www.piwheels.org/simple/pyspk/ 2023-03-24T11:04:31,374 Skipping link: not a file: https://pypi.org/simple/pyspk/ 2023-03-24T11:04:31,408 Given no hashes to check 1 links for project 'pyspk': discarding no candidates 2023-03-24T11:04:31,437 Collecting pyspk==1.2 2023-03-24T11:04:31,442 Created temporary directory: /tmp/pip-unpack-btqcjdrp 2023-03-24T11:04:31,681 Downloading pyspk-1.2.tar.gz (153 kB) 2023-03-24T11:04:31,891 Added pyspk==1.2 from https://files.pythonhosted.org/packages/ba/6d/e1283dfc400ad9f9eceacc38e56c49b7614fdb996001ab298678bd394e90/pyspk-1.2.tar.gz to build tracker '/tmp/pip-build-tracker-mlgxyju3' 2023-03-24T11:04:31,894 Running setup.py (path:/tmp/pip-wheel-0io9gvk0/pyspk_3c93ec38e0ee4c42a20f1089b53326a9/setup.py) egg_info for package pyspk 2023-03-24T11:04:31,895 Created temporary directory: /tmp/pip-pip-egg-info-zkhs2w1j 2023-03-24T11:04:31,896 Preparing metadata (setup.py): started 2023-03-24T11:04:31,898 Running command python setup.py egg_info 2023-03-24T11:04:33,310 # py-SP(k) - A hydrodynamical simulation-based model for the impact of baryon physics on the non-linear matter power spectrum 2023-03-24T11:04:33,311 _____ ____ ____ _ 2023-03-24T11:04:33,311 ____ __ __ / ___// __ \_/_/ /__| | 2023-03-24T11:04:33,312 / __ \/ / / /_____\__ \/ /_/ / // //_// / 2023-03-24T11:04:33,312 / /_/ / /_/ /_____/__/ / ____/ // ,< / / 2023-03-24T11:04:33,312 / .___/\__, / /____/_/ / //_/|_|/_/ 2023-03-24T11:04:33,313 /_/ /____/ |_| /_/ 2023-03-24T11:04:33,313 py-SP(k) is a python package aimed at predicting the suppression of the total matter power spectrum due to baryonic physics as a function of the baryon fraction of haloes and redshift. 2023-03-24T11:04:33,314 ## Requirements 2023-03-24T11:04:33,315 The module requires the following: 2023-03-24T11:04:33,315 - numpy 2023-03-24T11:04:33,316 - scipy 2023-03-24T11:04:33,316 ## Installation 2023-03-24T11:04:33,317 The easiest way to install py-SP(k) is using pip: 2023-03-24T11:04:33,318 ``` 2023-03-24T11:04:33,318 pip install pyspk [--user] 2023-03-24T11:04:33,318 ``` 2023-03-24T11:04:33,319 The --user flag may be required if you do not have root privileges. 2023-03-24T11:04:33,320 ## Usage 2023-03-24T11:04:33,320 py-SP(k) is not restrictive to a particular shape of the baryon fraction – halo mass relation. In order to provide flexibility to the user, we have implemented 3 different methods to provide py-SP(k) with the required $f_b$ - $M_\mathrm{halo}$ relation. In the following sections we describe these implementations. A jupyter notebook with more detailed examples can be found within this [repository](https://github.com/jemme07/pyspk/blob/main/examples/pySPk_Examples.ipynb). 2023-03-24T11:04:33,321 ### Method 1: Using a power-law fit to the $f_b$ - $M_\mathrm{halo}$ relation 2023-03-24T11:04:33,322 py-SP(k) can be provided with power-law fitted parameters to the $f_b$ - $M_\mathrm{halo}$ relation using the functional form: 2023-03-24T11:04:33,322 $$f_b/(\Omega_b/\Omega_m)=a\left(\frac{M_{SO}}{M_{\mathrm{pivot}}}\right)^{b},$$ 2023-03-24T11:04:33,323 where $M_{SO}$ could be either $M_{200c}$ or $M_{500c}$ in $\mathrm{M}_ \odot$, $a$ is the normalisation of the $f_b$ - $M_\mathrm{halo}$ relation at $M_\mathrm{pivot}$, and $b$ is the power-law slope. The power-law can be normalised at any pivot point in units of $\mathrm{M}_ {\odot}$. If a pivot point is not given, `spk.sup_model()` uses a default pivot point of $M_{\mathrm{pivot}} = 1 \mathrm{M}_ \odot$. $a$, $b$ and $M_\mathrm{pivot}$ can be specified at each redshift independently. 2023-03-24T11:04:33,324 Next, we show a simple example using power-law fit parameters: 2023-03-24T11:04:33,324 ``` 2023-03-24T11:04:33,325 import pyspk as spk 2023-03-24T11:04:33,325 z = 0.125 2023-03-24T11:04:33,326 fb_a = 0.4 2023-03-24T11:04:33,326 fb_pow = 0.3 2023-03-24T11:04:33,326 fb_pivot = 10 ** 13.5 2023-03-24T11:04:33,327 k, sup = spk.sup_model(SO=200, z=z, fb_a=fb_a, fb_pow=fb_pow, fb_pivot=fb_pivot) 2023-03-24T11:04:33,327 ``` 2023-03-24T11:04:33,328 ### Method 2: Redshift-dependent power-law fit to the $f_b$ - $M_\mathrm{halo}$ relation. 2023-03-24T11:04:33,328 For the mass range that can be relatively well probed in current X-ray and Sunyaev-Zel'dovich effect observations (roughly $10^{13} \leq M_{500c} [\mathrm{M}_ \odot] \leq 10^{15}$), the total baryon fraction of haloes can be roughly approximated by a power-law with constant slope (e.g. Mulroy et al. 2019; Akino et al. 2022). Akino et al. 2022 determined the of the baryon budget for X-ray-selected galaxy groups and clusters using weak-lensing mass measurements. They provide a parametric redshift-dependent power-law fit to the gas mass - halo mass and stellar mass - halo mass relations, finding very little redshift evolution. 2023-03-24T11:04:33,329 We implemented a modified version of the functional form presented in Akino et al. 2022, to fit the total $f_b$ - $M_\mathrm{halo}$ relation as follows: 2023-03-24T11:04:33,330 $$f_b/(\Omega_b/\Omega_m)= \left(\frac{0.1658}{\Omega_b/\Omega_m}\right) \left(\frac{e^\alpha}{100}\right) \left(\frac{M_{500c}}{10^{14} \mathrm{M}_ \odot}\right)^{\beta - 1} \left(\frac{E(z)}{E(0.3)}\right)^{\gamma},$$ 2023-03-24T11:04:33,330 where $\alpha$ sets the power-law normalisation, $\beta$ sets power-law slope, $\gamma$ provides the redshift dependence and $E(z)$ is the usual dimensionless Hubble parameter. For simplicity, we use the cosmology implementation of `astropy` to specify the cosmological parameters in py-SP(k). 2023-03-24T11:04:33,331 Note that this power-law has a normalisation that is redshift dependent, while the the slop is constant in redshift. While this provides a less flexible approach compared with Methods 1 (simple power-law) and Method 3 (binned data), we find that this parametrisation agrees well with our simulations up to redshift $z=1$, which is the redshift range proved by Akino et al. 2022. For higher redshifts, we find that simulations require a mass-dependent slope, especially at the lower mass range required to predict the suppression of the total matter power spectrum at such redshifts. 2023-03-24T11:04:33,332 In the following example we use the redshift-dependent power-law fit parameters with a flat LambdaCDM cosmology. Note that any `astropy` cosmology could be used instead. 2023-03-24T11:04:33,332 ``` 2023-03-24T11:04:33,333 import pyspk.model as spk 2023-03-24T11:04:33,333 from astropy.cosmology import FlatLambdaCDM 2023-03-24T11:04:33,334 H0 = 70 2023-03-24T11:04:33,334 Omega_b = 0.0463 2023-03-24T11:04:33,334 Omega_m = 0.2793 2023-03-24T11:04:33,335 cosmo = FlatLambdaCDM(H0=H0, Om0=Omega_m, Ob0=Omega_b) 2023-03-24T11:04:33,336 alpha = 4.189 2023-03-24T11:04:33,336 beta = 1.273 2023-03-24T11:04:33,336 gamma = 0.298 2023-03-24T11:04:33,336 z = 0.5 2023-03-24T11:04:33,337 k, sup = spk.sup_model(SO=500, z=z, alpha=alpha, beta=beta, gamma=gamma, cosmo=cosmo) 2023-03-24T11:04:33,337 ``` 2023-03-24T11:04:33,338 ### Method 3: Binned data for the $f_b$ - $M_\mathrm{halo}$ relation. 2023-03-24T11:04:33,339 The final, and most flexible method is to provide py-SP(k) with the baryon fraction binned in bins of halo mass. This could be, for example, obtained from observational constraints, measured directly form simulations, or sampled from a predefined distribution or functional form. For an example using data obtained from the BAHAMAS simulations ([McCarthy et al. 2017](https://academic.oup.com/mnras/article/465/3/2936/2417021)), please refer to the [examples](https://github.com/jemme07/pyspk/blob/main/examples/pySPk_Examples.ipynb) provided. 2023-03-24T11:04:33,340 ## Priors 2023-03-24T11:04:33,340 While py-SP(k) was calibrated using a wide range of sub-grid feedback parameters, some applications may require a more limited range of baryon fractions that encompass current observational constraints. For such applications, we used the gas mass - halo mass and stellar mass - halo mass constraints from Table 5 in Akino et al. 2022, and find the subset of simulations from our 400 models that agree with the inferred baryon budget at redshift $z=0.1$. We note that we constrained our simulations to within a normalisation of $\pm 3 \times \sigma$ at $M_{500c} = 10^{14} \mathrm{M}_ \odot$. 2023-03-24T11:04:33,341 Using the simulations that fall within these constraints, we can impose observational priors for the redshift-dependent power-law fitting parameters for the $f_b$ - $M_\mathrm{halo}$ relation in Method 3 as follows: 2023-03-24T11:04:33,342 | Parameter | Description | Prior | 2023-03-24T11:04:33,342 | ----------- | ------------------ | --------------- | 2023-03-24T11:04:33,342 | $\alpha$ | Normaliasation | G(4.189, 0.066) | 2023-03-24T11:04:33,343 | $\beta$ | Slope | G(1.273, 0.044) | 2023-03-24T11:04:33,343 | $\gamma$ | Redshift evolution | G(0.298, 0.063) | 2023-03-24T11:04:33,344 where G(x, y) is a Gaussian distribution with center x and width y. 2023-03-24T11:04:33,344 A less conservative approach could be to use a flat priors over the entire range of parameters fitted to simulations that fall within Akino et al. 2022 these constraints: 2023-03-24T11:04:33,345 | Parameter | Description | Prior | 2023-03-24T11:04:33,345 | ----------- | ------------------ | --------------- | 2023-03-24T11:04:33,346 | $\alpha$ | Normaliasation | U(4.060, 4.306) | 2023-03-24T11:04:33,346 | $\beta$ | Slope | U(1.199, 1.347) | 2023-03-24T11:04:33,346 | $\gamma$ | Redshift evolution | U(0.159, 0.414) | 2023-03-24T11:04:33,347 where U(x, y) is a uniform distribution over [x, y]. 2023-03-24T11:04:33,347 Finally, the full range of fitted parameters spanned by our simulations, regardless of whether or not they agree with observational constraints is: 2023-03-24T11:04:33,348 | Parameter | Description | Prior | 2023-03-24T11:04:33,348 | ----------- | ------------------ | --------------- | 2023-03-24T11:04:33,349 | $\alpha$ | Normaliasation | U(3.060, 4.508) | 2023-03-24T11:04:33,349 | $\beta$ | Slope | U(0.989, 1.620) | 2023-03-24T11:04:33,349 | $\gamma$ | Redshift evolution | U(0.046, 0.631) | 2023-03-24T11:04:33,350 where U(x, y) is a uniform distribution over [x, y]. 2023-03-24T11:04:33,351 ## Acknowledging the code 2023-03-24T11:04:33,351 Please cite py-SP(k) using: 2023-03-24T11:04:33,352 ``` 2023-03-24T11:04:33,352 @ARTICLE{spk, 2023-03-24T11:04:33,352 author = {}, 2023-03-24T11:04:33,353 title = "{}", 2023-03-24T11:04:33,353 journal = {\mnras}, 2023-03-24T11:04:33,353 keywords = {}, 2023-03-24T11:04:33,354 year = , 2023-03-24T11:04:33,354 month = , 2023-03-24T11:04:33,354 volume = {}, 2023-03-24T11:04:33,355 number = {}, 2023-03-24T11:04:33,355 pages = {}, 2023-03-24T11:04:33,355 doi = {}, 2023-03-24T11:04:33,356 archivePrefix = {arXiv}, 2023-03-24T11:04:33,356 eprint = {}, 2023-03-24T11:04:33,356 primaryClass = {astro-ph.CO}, 2023-03-24T11:04:33,356 adsurl = {}, 2023-03-24T11:04:33,357 adsnote = {} 2023-03-24T11:04:33,357 } 2023-03-24T11:04:33,357 ``` 2023-03-24T11:04:33,358 For any questions and enquires please contact me via email at *j.salcidonegrete@ljmu.ac.uk* 2023-03-24T11:04:33,359 running egg_info 2023-03-24T11:04:33,359 creating /tmp/pip-pip-egg-info-zkhs2w1j/pyspk.egg-info 2023-03-24T11:04:33,372 writing /tmp/pip-pip-egg-info-zkhs2w1j/pyspk.egg-info/PKG-INFO 2023-03-24T11:04:33,377 writing dependency_links to /tmp/pip-pip-egg-info-zkhs2w1j/pyspk.egg-info/dependency_links.txt 2023-03-24T11:04:33,382 writing requirements to /tmp/pip-pip-egg-info-zkhs2w1j/pyspk.egg-info/requires.txt 2023-03-24T11:04:33,384 writing top-level names to /tmp/pip-pip-egg-info-zkhs2w1j/pyspk.egg-info/top_level.txt 2023-03-24T11:04:33,387 writing manifest file '/tmp/pip-pip-egg-info-zkhs2w1j/pyspk.egg-info/SOURCES.txt' 2023-03-24T11:04:33,556 reading manifest file '/tmp/pip-pip-egg-info-zkhs2w1j/pyspk.egg-info/SOURCES.txt' 2023-03-24T11:04:33,559 reading manifest template 'MANIFEST.in' 2023-03-24T11:04:33,570 adding license file 'LICENSE.md' 2023-03-24T11:04:33,575 writing manifest file '/tmp/pip-pip-egg-info-zkhs2w1j/pyspk.egg-info/SOURCES.txt' 2023-03-24T11:04:33,694 Preparing metadata (setup.py): finished with status 'done' 2023-03-24T11:04:33,707 Source in /tmp/pip-wheel-0io9gvk0/pyspk_3c93ec38e0ee4c42a20f1089b53326a9 has version 1.2, which satisfies requirement pyspk==1.2 from https://files.pythonhosted.org/packages/ba/6d/e1283dfc400ad9f9eceacc38e56c49b7614fdb996001ab298678bd394e90/pyspk-1.2.tar.gz 2023-03-24T11:04:33,709 Removed pyspk==1.2 from https://files.pythonhosted.org/packages/ba/6d/e1283dfc400ad9f9eceacc38e56c49b7614fdb996001ab298678bd394e90/pyspk-1.2.tar.gz from build tracker '/tmp/pip-build-tracker-mlgxyju3' 2023-03-24T11:04:33,721 Created temporary directory: /tmp/pip-unpack-97qae1hh 2023-03-24T11:04:33,722 Building wheels for collected packages: pyspk 2023-03-24T11:04:33,731 Created temporary directory: /tmp/pip-wheel-vtx1cay1 2023-03-24T11:04:33,732 Building wheel for pyspk (setup.py): started 2023-03-24T11:04:33,734 Destination directory: /tmp/pip-wheel-vtx1cay1 2023-03-24T11:04:33,734 Running command python setup.py bdist_wheel 2023-03-24T11:04:34,793 # py-SP(k) - A hydrodynamical simulation-based model for the impact of baryon physics on the non-linear matter power spectrum 2023-03-24T11:04:34,795 _____ ____ ____ _ 2023-03-24T11:04:34,795 ____ __ __ / ___// __ \_/_/ /__| | 2023-03-24T11:04:34,795 / __ \/ / / /_____\__ \/ /_/ / // //_// / 2023-03-24T11:04:34,796 / /_/ / /_/ /_____/__/ / ____/ // ,< / / 2023-03-24T11:04:34,796 / .___/\__, / /____/_/ / //_/|_|/_/ 2023-03-24T11:04:34,796 /_/ /____/ |_| /_/ 2023-03-24T11:04:34,797 py-SP(k) is a python package aimed at predicting the suppression of the total matter power spectrum due to baryonic physics as a function of the baryon fraction of haloes and redshift. 2023-03-24T11:04:34,798 ## Requirements 2023-03-24T11:04:34,798 The module requires the following: 2023-03-24T11:04:34,799 - numpy 2023-03-24T11:04:34,799 - scipy 2023-03-24T11:04:34,800 ## Installation 2023-03-24T11:04:34,801 The easiest way to install py-SP(k) is using pip: 2023-03-24T11:04:34,801 ``` 2023-03-24T11:04:34,802 pip install pyspk [--user] 2023-03-24T11:04:34,802 ``` 2023-03-24T11:04:34,803 The --user flag may be required if you do not have root privileges. 2023-03-24T11:04:34,803 ## Usage 2023-03-24T11:04:34,804 py-SP(k) is not restrictive to a particular shape of the baryon fraction – halo mass relation. In order to provide flexibility to the user, we have implemented 3 different methods to provide py-SP(k) with the required $f_b$ - $M_\mathrm{halo}$ relation. In the following sections we describe these implementations. A jupyter notebook with more detailed examples can be found within this [repository](https://github.com/jemme07/pyspk/blob/main/examples/pySPk_Examples.ipynb). 2023-03-24T11:04:34,805 ### Method 1: Using a power-law fit to the $f_b$ - $M_\mathrm{halo}$ relation 2023-03-24T11:04:34,805 py-SP(k) can be provided with power-law fitted parameters to the $f_b$ - $M_\mathrm{halo}$ relation using the functional form: 2023-03-24T11:04:34,806 $$f_b/(\Omega_b/\Omega_m)=a\left(\frac{M_{SO}}{M_{\mathrm{pivot}}}\right)^{b},$$ 2023-03-24T11:04:34,807 where $M_{SO}$ could be either $M_{200c}$ or $M_{500c}$ in $\mathrm{M}_ \odot$, $a$ is the normalisation of the $f_b$ - $M_\mathrm{halo}$ relation at $M_\mathrm{pivot}$, and $b$ is the power-law slope. The power-law can be normalised at any pivot point in units of $\mathrm{M}_ {\odot}$. If a pivot point is not given, `spk.sup_model()` uses a default pivot point of $M_{\mathrm{pivot}} = 1 \mathrm{M}_ \odot$. $a$, $b$ and $M_\mathrm{pivot}$ can be specified at each redshift independently. 2023-03-24T11:04:34,807 Next, we show a simple example using power-law fit parameters: 2023-03-24T11:04:34,808 ``` 2023-03-24T11:04:34,808 import pyspk as spk 2023-03-24T11:04:34,809 z = 0.125 2023-03-24T11:04:34,809 fb_a = 0.4 2023-03-24T11:04:34,810 fb_pow = 0.3 2023-03-24T11:04:34,810 fb_pivot = 10 ** 13.5 2023-03-24T11:04:34,811 k, sup = spk.sup_model(SO=200, z=z, fb_a=fb_a, fb_pow=fb_pow, fb_pivot=fb_pivot) 2023-03-24T11:04:34,811 ``` 2023-03-24T11:04:34,812 ### Method 2: Redshift-dependent power-law fit to the $f_b$ - $M_\mathrm{halo}$ relation. 2023-03-24T11:04:34,812 For the mass range that can be relatively well probed in current X-ray and Sunyaev-Zel'dovich effect observations (roughly $10^{13} \leq M_{500c} [\mathrm{M}_ \odot] \leq 10^{15}$), the total baryon fraction of haloes can be roughly approximated by a power-law with constant slope (e.g. Mulroy et al. 2019; Akino et al. 2022). Akino et al. 2022 determined the of the baryon budget for X-ray-selected galaxy groups and clusters using weak-lensing mass measurements. They provide a parametric redshift-dependent power-law fit to the gas mass - halo mass and stellar mass - halo mass relations, finding very little redshift evolution. 2023-03-24T11:04:34,813 We implemented a modified version of the functional form presented in Akino et al. 2022, to fit the total $f_b$ - $M_\mathrm{halo}$ relation as follows: 2023-03-24T11:04:34,814 $$f_b/(\Omega_b/\Omega_m)= \left(\frac{0.1658}{\Omega_b/\Omega_m}\right) \left(\frac{e^\alpha}{100}\right) \left(\frac{M_{500c}}{10^{14} \mathrm{M}_ \odot}\right)^{\beta - 1} \left(\frac{E(z)}{E(0.3)}\right)^{\gamma},$$ 2023-03-24T11:04:34,814 where $\alpha$ sets the power-law normalisation, $\beta$ sets power-law slope, $\gamma$ provides the redshift dependence and $E(z)$ is the usual dimensionless Hubble parameter. For simplicity, we use the cosmology implementation of `astropy` to specify the cosmological parameters in py-SP(k). 2023-03-24T11:04:34,815 Note that this power-law has a normalisation that is redshift dependent, while the the slop is constant in redshift. While this provides a less flexible approach compared with Methods 1 (simple power-law) and Method 3 (binned data), we find that this parametrisation agrees well with our simulations up to redshift $z=1$, which is the redshift range proved by Akino et al. 2022. For higher redshifts, we find that simulations require a mass-dependent slope, especially at the lower mass range required to predict the suppression of the total matter power spectrum at such redshifts. 2023-03-24T11:04:34,816 In the following example we use the redshift-dependent power-law fit parameters with a flat LambdaCDM cosmology. Note that any `astropy` cosmology could be used instead. 2023-03-24T11:04:34,816 ``` 2023-03-24T11:04:34,817 import pyspk.model as spk 2023-03-24T11:04:34,817 from astropy.cosmology import FlatLambdaCDM 2023-03-24T11:04:34,817 H0 = 70 2023-03-24T11:04:34,818 Omega_b = 0.0463 2023-03-24T11:04:34,818 Omega_m = 0.2793 2023-03-24T11:04:34,819 cosmo = FlatLambdaCDM(H0=H0, Om0=Omega_m, Ob0=Omega_b) 2023-03-24T11:04:34,819 alpha = 4.189 2023-03-24T11:04:34,820 beta = 1.273 2023-03-24T11:04:34,820 gamma = 0.298 2023-03-24T11:04:34,820 z = 0.5 2023-03-24T11:04:34,821 k, sup = spk.sup_model(SO=500, z=z, alpha=alpha, beta=beta, gamma=gamma, cosmo=cosmo) 2023-03-24T11:04:34,821 ``` 2023-03-24T11:04:34,822 ### Method 3: Binned data for the $f_b$ - $M_\mathrm{halo}$ relation. 2023-03-24T11:04:34,823 The final, and most flexible method is to provide py-SP(k) with the baryon fraction binned in bins of halo mass. This could be, for example, obtained from observational constraints, measured directly form simulations, or sampled from a predefined distribution or functional form. For an example using data obtained from the BAHAMAS simulations ([McCarthy et al. 2017](https://academic.oup.com/mnras/article/465/3/2936/2417021)), please refer to the [examples](https://github.com/jemme07/pyspk/blob/main/examples/pySPk_Examples.ipynb) provided. 2023-03-24T11:04:34,824 ## Priors 2023-03-24T11:04:34,824 While py-SP(k) was calibrated using a wide range of sub-grid feedback parameters, some applications may require a more limited range of baryon fractions that encompass current observational constraints. For such applications, we used the gas mass - halo mass and stellar mass - halo mass constraints from Table 5 in Akino et al. 2022, and find the subset of simulations from our 400 models that agree with the inferred baryon budget at redshift $z=0.1$. We note that we constrained our simulations to within a normalisation of $\pm 3 \times \sigma$ at $M_{500c} = 10^{14} \mathrm{M}_ \odot$. 2023-03-24T11:04:34,825 Using the simulations that fall within these constraints, we can impose observational priors for the redshift-dependent power-law fitting parameters for the $f_b$ - $M_\mathrm{halo}$ relation in Method 3 as follows: 2023-03-24T11:04:34,826 | Parameter | Description | Prior | 2023-03-24T11:04:34,826 | ----------- | ------------------ | --------------- | 2023-03-24T11:04:34,826 | $\alpha$ | Normaliasation | G(4.189, 0.066) | 2023-03-24T11:04:34,826 | $\beta$ | Slope | G(1.273, 0.044) | 2023-03-24T11:04:34,827 | $\gamma$ | Redshift evolution | G(0.298, 0.063) | 2023-03-24T11:04:34,827 where G(x, y) is a Gaussian distribution with center x and width y. 2023-03-24T11:04:34,828 A less conservative approach could be to use a flat priors over the entire range of parameters fitted to simulations that fall within Akino et al. 2022 these constraints: 2023-03-24T11:04:34,829 | Parameter | Description | Prior | 2023-03-24T11:04:34,829 | ----------- | ------------------ | --------------- | 2023-03-24T11:04:34,829 | $\alpha$ | Normaliasation | U(4.060, 4.306) | 2023-03-24T11:04:34,830 | $\beta$ | Slope | U(1.199, 1.347) | 2023-03-24T11:04:34,830 | $\gamma$ | Redshift evolution | U(0.159, 0.414) | 2023-03-24T11:04:34,831 where U(x, y) is a uniform distribution over [x, y]. 2023-03-24T11:04:34,831 Finally, the full range of fitted parameters spanned by our simulations, regardless of whether or not they agree with observational constraints is: 2023-03-24T11:04:34,832 | Parameter | Description | Prior | 2023-03-24T11:04:34,832 | ----------- | ------------------ | --------------- | 2023-03-24T11:04:34,832 | $\alpha$ | Normaliasation | U(3.060, 4.508) | 2023-03-24T11:04:34,833 | $\beta$ | Slope | U(0.989, 1.620) | 2023-03-24T11:04:34,833 | $\gamma$ | Redshift evolution | U(0.046, 0.631) | 2023-03-24T11:04:34,834 where U(x, y) is a uniform distribution over [x, y]. 2023-03-24T11:04:34,834 ## Acknowledging the code 2023-03-24T11:04:34,835 Please cite py-SP(k) using: 2023-03-24T11:04:34,835 ``` 2023-03-24T11:04:34,836 @ARTICLE{spk, 2023-03-24T11:04:34,836 author = {}, 2023-03-24T11:04:34,836 title = "{}", 2023-03-24T11:04:34,837 journal = {\mnras}, 2023-03-24T11:04:34,837 keywords = {}, 2023-03-24T11:04:34,837 year = , 2023-03-24T11:04:34,838 month = , 2023-03-24T11:04:34,838 volume = {}, 2023-03-24T11:04:34,838 number = {}, 2023-03-24T11:04:34,838 pages = {}, 2023-03-24T11:04:34,839 doi = {}, 2023-03-24T11:04:34,839 archivePrefix = {arXiv}, 2023-03-24T11:04:34,839 eprint = {}, 2023-03-24T11:04:34,840 primaryClass = {astro-ph.CO}, 2023-03-24T11:04:34,840 adsurl = {}, 2023-03-24T11:04:34,840 adsnote = {} 2023-03-24T11:04:34,841 } 2023-03-24T11:04:34,841 ``` 2023-03-24T11:04:34,841 For any questions and enquires please contact me via email at *j.salcidonegrete@ljmu.ac.uk* 2023-03-24T11:04:35,646 running bdist_wheel 2023-03-24T11:04:36,330 running build 2023-03-24T11:04:36,331 running build_py 2023-03-24T11:04:36,393 creating build 2023-03-24T11:04:36,394 creating build/lib 2023-03-24T11:04:36,404 creating build/lib/pyspk 2023-03-24T11:04:36,406 copying pyspk/fit_vals.py -> build/lib/pyspk 2023-03-24T11:04:36,411 copying pyspk/model.py -> build/lib/pyspk 2023-03-24T11:04:36,416 copying pyspk/__init__.py -> build/lib/pyspk 2023-03-24T11:04:36,418 running egg_info 2023-03-24T11:04:36,548 writing pyspk.egg-info/PKG-INFO 2023-03-24T11:04:36,553 writing dependency_links to pyspk.egg-info/dependency_links.txt 2023-03-24T11:04:36,557 writing requirements to pyspk.egg-info/requires.txt 2023-03-24T11:04:36,559 writing top-level names to pyspk.egg-info/top_level.txt 2023-03-24T11:04:36,622 reading manifest file 'pyspk.egg-info/SOURCES.txt' 2023-03-24T11:04:36,628 reading manifest template 'MANIFEST.in' 2023-03-24T11:04:36,639 adding license file 'LICENSE.md' 2023-03-24T11:04:36,645 writing manifest file 'pyspk.egg-info/SOURCES.txt' 2023-03-24T11:04:36,649 /usr/local/lib/python3.7/dist-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning: Installing 'pyspk.__pycache__' as data is deprecated, please list it in `packages`. 2023-03-24T11:04:36,650 !! 2023-03-24T11:04:36,651 ############################ 2023-03-24T11:04:36,651 # Package would be ignored # 2023-03-24T11:04:36,651 ############################ 2023-03-24T11:04:36,652 Python recognizes 'pyspk.__pycache__' as an importable package, 2023-03-24T11:04:36,652 but it is not listed in the `packages` configuration of setuptools. 2023-03-24T11:04:36,653 'pyspk.__pycache__' has been automatically added to the distribution only 2023-03-24T11:04:36,653 because it may contain data files, but this behavior is likely to change 2023-03-24T11:04:36,653 in future versions of setuptools (and therefore is considered deprecated). 2023-03-24T11:04:36,655 Please make sure that 'pyspk.__pycache__' is included as a package by using 2023-03-24T11:04:36,655 the `packages` configuration field or the proper discovery methods 2023-03-24T11:04:36,655 (for example by using `find_namespace_packages(...)`/`find_namespace:` 2023-03-24T11:04:36,656 instead of `find_packages(...)`/`find:`). 2023-03-24T11:04:36,656 You can read more about "package discovery" and "data files" on setuptools 2023-03-24T11:04:36,657 documentation page. 2023-03-24T11:04:36,658 !! 2023-03-24T11:04:36,658 check.warn(importable) 2023-03-24T11:04:36,659 copying pyspk/.DS_Store -> build/lib/pyspk 2023-03-24T11:04:36,659 copying pyspk/stat_errors_200.csv -> build/lib/pyspk 2023-03-24T11:04:36,671 copying pyspk/stat_errors_500.csv -> build/lib/pyspk 2023-03-24T11:04:36,686 creating build/lib/pyspk/__pycache__ 2023-03-24T11:04:36,688 copying pyspk/__pycache__/__init__.cpython-39.pyc -> build/lib/pyspk/__pycache__ 2023-03-24T11:04:36,692 copying pyspk/__pycache__/fit_vals.cpython-39.pyc -> build/lib/pyspk/__pycache__ 2023-03-24T11:04:36,696 copying pyspk/__pycache__/model.cpython-39.pyc -> build/lib/pyspk/__pycache__ 2023-03-24T11:04:36,763 /usr/local/lib/python3.7/dist-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. 2023-03-24T11:04:36,764 setuptools.SetuptoolsDeprecationWarning, 2023-03-24T11:04:36,820 installing to build/bdist.linux-armv7l/wheel 2023-03-24T11:04:36,821 running install 2023-03-24T11:04:36,880 running install_lib 2023-03-24T11:04:36,938 creating build/bdist.linux-armv7l 2023-03-24T11:04:36,939 creating build/bdist.linux-armv7l/wheel 2023-03-24T11:04:36,943 creating build/bdist.linux-armv7l/wheel/pyspk 2023-03-24T11:04:36,945 copying build/lib/pyspk/stat_errors_500.csv -> build/bdist.linux-armv7l/wheel/pyspk 2023-03-24T11:04:36,959 copying build/lib/pyspk/stat_errors_200.csv -> build/bdist.linux-armv7l/wheel/pyspk 2023-03-24T11:04:36,973 copying build/lib/pyspk/.DS_Store -> build/bdist.linux-armv7l/wheel/pyspk 2023-03-24T11:04:36,978 creating build/bdist.linux-armv7l/wheel/pyspk/__pycache__ 2023-03-24T11:04:36,979 copying build/lib/pyspk/__pycache__/fit_vals.cpython-39.pyc -> build/bdist.linux-armv7l/wheel/pyspk/__pycache__ 2023-03-24T11:04:36,983 copying build/lib/pyspk/__pycache__/__init__.cpython-39.pyc -> build/bdist.linux-armv7l/wheel/pyspk/__pycache__ 2023-03-24T11:04:36,986 copying build/lib/pyspk/__pycache__/model.cpython-39.pyc -> build/bdist.linux-armv7l/wheel/pyspk/__pycache__ 2023-03-24T11:04:36,991 copying build/lib/pyspk/fit_vals.py -> build/bdist.linux-armv7l/wheel/pyspk 2023-03-24T11:04:36,995 copying build/lib/pyspk/model.py -> build/bdist.linux-armv7l/wheel/pyspk 2023-03-24T11:04:36,999 copying build/lib/pyspk/__init__.py -> build/bdist.linux-armv7l/wheel/pyspk 2023-03-24T11:04:37,002 running install_egg_info 2023-03-24T11:04:37,070 Copying pyspk.egg-info to build/bdist.linux-armv7l/wheel/pyspk-1.2-py3.7.egg-info 2023-03-24T11:04:37,089 running install_scripts 2023-03-24T11:04:37,121 creating build/bdist.linux-armv7l/wheel/pyspk-1.2.dist-info/WHEEL 2023-03-24T11:04:37,125 creating '/tmp/pip-wheel-vtx1cay1/pyspk-1.2-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2023-03-24T11:04:37,131 adding 'pyspk/.DS_Store' 2023-03-24T11:04:37,134 adding 'pyspk/__init__.py' 2023-03-24T11:04:37,137 adding 'pyspk/fit_vals.py' 2023-03-24T11:04:37,142 adding 'pyspk/model.py' 2023-03-24T11:04:37,233 adding 'pyspk/stat_errors_200.csv' 2023-03-24T11:04:37,328 adding 'pyspk/stat_errors_500.csv' 2023-03-24T11:04:37,335 adding 'pyspk/__pycache__/__init__.cpython-39.pyc' 2023-03-24T11:04:37,338 adding 'pyspk/__pycache__/fit_vals.cpython-39.pyc' 2023-03-24T11:04:37,343 adding 'pyspk/__pycache__/model.cpython-39.pyc' 2023-03-24T11:04:37,349 adding 'pyspk-1.2.dist-info/LICENSE.md' 2023-03-24T11:04:37,353 adding 'pyspk-1.2.dist-info/METADATA' 2023-03-24T11:04:37,355 adding 'pyspk-1.2.dist-info/WHEEL' 2023-03-24T11:04:37,357 adding 'pyspk-1.2.dist-info/top_level.txt' 2023-03-24T11:04:37,359 adding 'pyspk-1.2.dist-info/RECORD' 2023-03-24T11:04:37,367 removing build/bdist.linux-armv7l/wheel 2023-03-24T11:04:37,542 Building wheel for pyspk (setup.py): finished with status 'done' 2023-03-24T11:04:37,554 Created wheel for pyspk: filename=pyspk-1.2-py3-none-any.whl size=153932 sha256=83010a88648bf4bbe2dffd0eb64c5a1892d598c03297cd19ce0d785f28662c28 2023-03-24T11:04:37,556 Stored in directory: /tmp/pip-ephem-wheel-cache-lljeh5a8/wheels/8a/5a/ef/f4c4b7fc2ff6bad651576649522d76e2a027110375a487b87f 2023-03-24T11:04:37,583 Successfully built pyspk 2023-03-24T11:04:37,603 Removed build tracker: '/tmp/pip-build-tracker-mlgxyju3'