2022-11-18T12:05:21,766 Created temporary directory: /tmp/pip-ephem-wheel-cache-9_s2ijtg 2022-11-18T12:05:21,771 Created temporary directory: /tmp/pip-build-tracker-xappnvym 2022-11-18T12:05:21,772 Initialized build tracking at /tmp/pip-build-tracker-xappnvym 2022-11-18T12:05:21,772 Created build tracker: /tmp/pip-build-tracker-xappnvym 2022-11-18T12:05:21,772 Entered build tracker: /tmp/pip-build-tracker-xappnvym 2022-11-18T12:05:21,773 Created temporary directory: /tmp/pip-wheel-rqx6xsl7 2022-11-18T12:05:21,781 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 2022-11-18T12:05:21,786 Created temporary directory: /tmp/pip-ephem-wheel-cache-tykj38xg 2022-11-18T12:05:21,843 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2022-11-18T12:05:21,850 2 location(s) to search for versions of pyspk: 2022-11-18T12:05:21,850 * https://pypi.org/simple/pyspk/ 2022-11-18T12:05:21,850 * https://www.piwheels.org/simple/pyspk/ 2022-11-18T12:05:21,852 Fetching project page and analyzing links: https://pypi.org/simple/pyspk/ 2022-11-18T12:05:21,853 Getting page https://pypi.org/simple/pyspk/ 2022-11-18T12:05:21,856 Found index url https://pypi.org/simple 2022-11-18T12:05:22,041 Fetched page https://pypi.org/simple/pyspk/ as application/vnd.pypi.simple.v1+json 2022-11-18T12:05:22,044 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/) 2022-11-18T12:05:22,045 Found link https://files.pythonhosted.org/packages/a8/d2/0734e1e3790826d866e4d99bdc646fba69430f90883d2ba783b2ec83ec06/pyspk-1.0.tar.gz (from https://pypi.org/simple/pyspk/), version: 1.0 2022-11-18T12:05:22,046 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/) 2022-11-18T12:05:22,046 Found link https://files.pythonhosted.org/packages/61/93/710ef3373d68aa7569f17af7a78e4dc9cb7f07aafb4cbcc56155120846f7/pyspk-1.1.tar.gz (from https://pypi.org/simple/pyspk/), version: 1.1 2022-11-18T12:05:22,047 Fetching project page and analyzing links: https://www.piwheels.org/simple/pyspk/ 2022-11-18T12:05:22,048 Getting page https://www.piwheels.org/simple/pyspk/ 2022-11-18T12:05:22,050 Found index url https://www.piwheels.org/simple 2022-11-18T12:05:24,576 Fetched page https://www.piwheels.org/simple/pyspk/ as text/html 2022-11-18T12:05:24,579 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/) 2022-11-18T12:05:24,580 Skipping link: not a file: https://www.piwheels.org/simple/pyspk/ 2022-11-18T12:05:24,580 Skipping link: not a file: https://pypi.org/simple/pyspk/ 2022-11-18T12:05:24,612 Given no hashes to check 1 links for project 'pyspk': discarding no candidates 2022-11-18T12:05:24,646 Collecting pyspk==1.1 2022-11-18T12:05:24,650 Created temporary directory: /tmp/pip-unpack-d0h4txco 2022-11-18T12:05:24,904 Downloading pyspk-1.1.tar.gz (153 kB) 2022-11-18T12:05:25,119 Added pyspk==1.1 from https://files.pythonhosted.org/packages/61/93/710ef3373d68aa7569f17af7a78e4dc9cb7f07aafb4cbcc56155120846f7/pyspk-1.1.tar.gz to build tracker '/tmp/pip-build-tracker-xappnvym' 2022-11-18T12:05:25,122 Running setup.py (path:/tmp/pip-wheel-rqx6xsl7/pyspk_08c5fca0d9264ab4ae7d19493f5f6584/setup.py) egg_info for package pyspk 2022-11-18T12:05:25,123 Created temporary directory: /tmp/pip-pip-egg-info-7pv92gca 2022-11-18T12:05:25,124 Preparing metadata (setup.py): started 2022-11-18T12:05:25,126 Running command python setup.py egg_info 2022-11-18T12:05:27,579 # py-SP(k) - A hydrodynamical simulation-based model for the impact of baryon physics on the non-linear matter power spectrum 2022-11-18T12:05:27,580 _____ ____ ____ _ 2022-11-18T12:05:27,580 ____ __ __ / ___// __ \_/_/ /__| | 2022-11-18T12:05:27,581 / __ \/ / / /_____\__ \/ /_/ / // //_// / 2022-11-18T12:05:27,581 / /_/ / /_/ /_____/__/ / ____/ // ,< / / 2022-11-18T12:05:27,581 / .___/\__, / /____/_/ / //_/|_|/_/ 2022-11-18T12:05:27,582 /_/ /____/ |_| /_/ 2022-11-18T12:05:27,582 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. 2022-11-18T12:05:27,583 ## Requirements 2022-11-18T12:05:27,584 The module requires the following: 2022-11-18T12:05:27,584 - numpy 2022-11-18T12:05:27,585 - scipy 2022-11-18T12:05:27,585 ## Installation 2022-11-18T12:05:27,586 The easiest way to install py-SP(k) is using pip: 2022-11-18T12:05:27,587 ``` 2022-11-18T12:05:27,587 pip install pyspk [--user] 2022-11-18T12:05:27,587 ``` 2022-11-18T12:05:27,588 The --user flag may be required if you do not have root privileges. 2022-11-18T12:05:27,589 ## Usage 2022-11-18T12:05:27,589 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). 2022-11-18T12:05:27,590 ### Method 1: Using a power-law fit to the $f_b$ - $M_\mathrm{halo}$ relation 2022-11-18T12:05:27,591 py-SP(k) can be provided with power-law fitted parameters to the $f_b$ - $M_\mathrm{halo}$ relation using the functional form: 2022-11-18T12:05:27,591 $$f_b/(\Omega_b/\Omega_m)=a\left(\frac{M_{SO}}{M_{\mathrm{pivot}}}\right)^{b},$$ 2022-11-18T12:05:27,592 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. 2022-11-18T12:05:27,593 Next, we show a simple example using power-law fit parameters: 2022-11-18T12:05:27,593 ``` 2022-11-18T12:05:27,593 import pyspk as spk 2022-11-18T12:05:27,594 z = 0.125 2022-11-18T12:05:27,595 fb_a = 0.4 2022-11-18T12:05:27,595 fb_pow = 0.3 2022-11-18T12:05:27,595 fb_pivot = 10 ** 13.5 2022-11-18T12:05:27,596 k, sup = spk.sup_model(SO=200, z=z, fb_a=fb_a, fb_pow=fb_pow, fb_pivot=fb_pivot) 2022-11-18T12:05:27,596 ``` 2022-11-18T12:05:27,597 ### Method 2: Redshift-dependent power-law fit to the $f_b$ - $M_\mathrm{halo}$ relation. 2022-11-18T12:05:27,597 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. 2022-11-18T12:05:27,598 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: 2022-11-18T12:05:27,599 $$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},$$ 2022-11-18T12:05:27,600 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). 2022-11-18T12:05:27,600 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. 2022-11-18T12:05:27,601 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. 2022-11-18T12:05:27,602 ``` 2022-11-18T12:05:27,602 import pyspk.model as spk 2022-11-18T12:05:27,602 from astropy.cosmology import FlatLambdaCDM 2022-11-18T12:05:27,603 H0 = 70 2022-11-18T12:05:27,603 Omega_b = 0.0463 2022-11-18T12:05:27,603 Omega_m = 0.2793 2022-11-18T12:05:27,604 cosmo = FlatLambdaCDM(H0=H0, Om0=Omega_m, Ob0=Omega_b) 2022-11-18T12:05:27,605 alpha = 4.189 2022-11-18T12:05:27,605 beta = 1.273 2022-11-18T12:05:27,605 gamma = 0.298 2022-11-18T12:05:27,606 z = 0.5 2022-11-18T12:05:27,606 k, sup = spk.sup_model(SO=500, z=z, alpha=alpha, beta=beta, gamma=gamma, cosmo=cosmo) 2022-11-18T12:05:27,606 ``` 2022-11-18T12:05:27,607 ### Method 3: Binned data for the $f_b$ - $M_\mathrm{halo}$ relation. 2022-11-18T12:05:27,608 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. 2022-11-18T12:05:27,609 ## Priors 2022-11-18T12:05:27,609 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$. 2022-11-18T12:05:27,610 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: 2022-11-18T12:05:27,611 | Parameter | Description | Prior | 2022-11-18T12:05:27,611 | ----------- | ------------------ | --------------- | 2022-11-18T12:05:27,611 | $\alpha$ | Normaliasation | G(4.189, 0.066) | 2022-11-18T12:05:27,611 | $\beta$ | Slope | G(1.273, 0.044) | 2022-11-18T12:05:27,612 | $\gamma$ | Redshift evolution | G(0.298, 0.063) | 2022-11-18T12:05:27,612 where G(x, y) is a Gaussian distribution with center x and width y. 2022-11-18T12:05:27,613 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: 2022-11-18T12:05:27,614 | Parameter | Description | Prior | 2022-11-18T12:05:27,614 | ----------- | ------------------ | --------------- | 2022-11-18T12:05:27,614 | $\alpha$ | Normaliasation | U(4.060, 4.306) | 2022-11-18T12:05:27,615 | $\beta$ | Slope | U(1.199, 1.347) | 2022-11-18T12:05:27,615 | $\gamma$ | Redshift evolution | U(0.159, 0.414) | 2022-11-18T12:05:27,616 where U(x, y) is a uniform distribution over [x, y]. 2022-11-18T12:05:27,616 Finally, the full range of fitted parameters spanned by our simulations, regardless of whether or not they agree with observational constraints is: 2022-11-18T12:05:27,617 | Parameter | Description | Prior | 2022-11-18T12:05:27,617 | ----------- | ------------------ | --------------- | 2022-11-18T12:05:27,617 | $\alpha$ | Normaliasation | U(3.060, 4.508) | 2022-11-18T12:05:27,618 | $\beta$ | Slope | U(0.989, 1.620) | 2022-11-18T12:05:27,618 | $\gamma$ | Redshift evolution | U(0.046, 0.631) | 2022-11-18T12:05:27,619 where U(x, y) is a uniform distribution over [x, y]. 2022-11-18T12:05:27,619 ## Acknowledging the code 2022-11-18T12:05:27,620 Please cite py-SP(k) using: 2022-11-18T12:05:27,620 ``` 2022-11-18T12:05:27,621 @ARTICLE{spk, 2022-11-18T12:05:27,621 author = {}, 2022-11-18T12:05:27,621 title = "{}", 2022-11-18T12:05:27,622 journal = {\mnras}, 2022-11-18T12:05:27,622 keywords = {}, 2022-11-18T12:05:27,622 year = , 2022-11-18T12:05:27,623 month = , 2022-11-18T12:05:27,623 volume = {}, 2022-11-18T12:05:27,623 number = {}, 2022-11-18T12:05:27,623 pages = {}, 2022-11-18T12:05:27,624 doi = {}, 2022-11-18T12:05:27,624 archivePrefix = {arXiv}, 2022-11-18T12:05:27,624 eprint = {}, 2022-11-18T12:05:27,625 primaryClass = {astro-ph.CO}, 2022-11-18T12:05:27,625 adsurl = {}, 2022-11-18T12:05:27,625 adsnote = {} 2022-11-18T12:05:27,626 } 2022-11-18T12:05:27,626 ``` 2022-11-18T12:05:27,626 For any questions and enquires please contact me via email at *j.salcidonegrete@ljmu.ac.uk* 2022-11-18T12:05:27,627 running egg_info 2022-11-18T12:05:27,628 creating /tmp/pip-pip-egg-info-7pv92gca/pyspk.egg-info 2022-11-18T12:05:27,649 writing /tmp/pip-pip-egg-info-7pv92gca/pyspk.egg-info/PKG-INFO 2022-11-18T12:05:27,654 writing dependency_links to /tmp/pip-pip-egg-info-7pv92gca/pyspk.egg-info/dependency_links.txt 2022-11-18T12:05:27,658 writing requirements to /tmp/pip-pip-egg-info-7pv92gca/pyspk.egg-info/requires.txt 2022-11-18T12:05:27,660 writing top-level names to /tmp/pip-pip-egg-info-7pv92gca/pyspk.egg-info/top_level.txt 2022-11-18T12:05:27,662 writing manifest file '/tmp/pip-pip-egg-info-7pv92gca/pyspk.egg-info/SOURCES.txt' 2022-11-18T12:05:27,849 reading manifest file '/tmp/pip-pip-egg-info-7pv92gca/pyspk.egg-info/SOURCES.txt' 2022-11-18T12:05:27,852 reading manifest template 'MANIFEST.in' 2022-11-18T12:05:27,863 adding license file 'LICENSE.md' 2022-11-18T12:05:27,868 writing manifest file '/tmp/pip-pip-egg-info-7pv92gca/pyspk.egg-info/SOURCES.txt' 2022-11-18T12:05:28,072 Preparing metadata (setup.py): finished with status 'done' 2022-11-18T12:05:28,085 Source in /tmp/pip-wheel-rqx6xsl7/pyspk_08c5fca0d9264ab4ae7d19493f5f6584 has version 1.1, which satisfies requirement pyspk==1.1 from https://files.pythonhosted.org/packages/61/93/710ef3373d68aa7569f17af7a78e4dc9cb7f07aafb4cbcc56155120846f7/pyspk-1.1.tar.gz 2022-11-18T12:05:28,087 Removed pyspk==1.1 from https://files.pythonhosted.org/packages/61/93/710ef3373d68aa7569f17af7a78e4dc9cb7f07aafb4cbcc56155120846f7/pyspk-1.1.tar.gz from build tracker '/tmp/pip-build-tracker-xappnvym' 2022-11-18T12:05:28,099 Created temporary directory: /tmp/pip-unpack-q_gbn_wh 2022-11-18T12:05:28,100 Building wheels for collected packages: pyspk 2022-11-18T12:05:28,109 Created temporary directory: /tmp/pip-wheel-29csf9p_ 2022-11-18T12:05:28,110 Building wheel for pyspk (setup.py): started 2022-11-18T12:05:28,112 Destination directory: /tmp/pip-wheel-29csf9p_ 2022-11-18T12:05:28,112 Running command python setup.py bdist_wheel 2022-11-18T12:05:30,109 # py-SP(k) - A hydrodynamical simulation-based model for the impact of baryon physics on the non-linear matter power spectrum 2022-11-18T12:05:30,111 _____ ____ ____ _ 2022-11-18T12:05:30,111 ____ __ __ / ___// __ \_/_/ /__| | 2022-11-18T12:05:30,111 / __ \/ / / /_____\__ \/ /_/ / // //_// / 2022-11-18T12:05:30,112 / /_/ / /_/ /_____/__/ / ____/ // ,< / / 2022-11-18T12:05:30,112 / .___/\__, / /____/_/ / //_/|_|/_/ 2022-11-18T12:05:30,112 /_/ /____/ |_| /_/ 2022-11-18T12:05:30,113 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. 2022-11-18T12:05:30,114 ## Requirements 2022-11-18T12:05:30,114 The module requires the following: 2022-11-18T12:05:30,115 - numpy 2022-11-18T12:05:30,115 - scipy 2022-11-18T12:05:30,116 ## Installation 2022-11-18T12:05:30,116 The easiest way to install py-SP(k) is using pip: 2022-11-18T12:05:30,117 ``` 2022-11-18T12:05:30,117 pip install pyspk [--user] 2022-11-18T12:05:30,117 ``` 2022-11-18T12:05:30,118 The --user flag may be required if you do not have root privileges. 2022-11-18T12:05:30,119 ## Usage 2022-11-18T12:05:30,120 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). 2022-11-18T12:05:30,120 ### Method 1: Using a power-law fit to the $f_b$ - $M_\mathrm{halo}$ relation 2022-11-18T12:05:30,121 py-SP(k) can be provided with power-law fitted parameters to the $f_b$ - $M_\mathrm{halo}$ relation using the functional form: 2022-11-18T12:05:30,121 $$f_b/(\Omega_b/\Omega_m)=a\left(\frac{M_{SO}}{M_{\mathrm{pivot}}}\right)^{b},$$ 2022-11-18T12:05:30,122 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. 2022-11-18T12:05:30,123 Next, we show a simple example using power-law fit parameters: 2022-11-18T12:05:30,123 ``` 2022-11-18T12:05:30,124 import pyspk as spk 2022-11-18T12:05:30,124 z = 0.125 2022-11-18T12:05:30,125 fb_a = 0.4 2022-11-18T12:05:30,125 fb_pow = 0.3 2022-11-18T12:05:30,125 fb_pivot = 10 ** 13.5 2022-11-18T12:05:30,126 k, sup = spk.sup_model(SO=200, z=z, fb_a=fb_a, fb_pow=fb_pow, fb_pivot=fb_pivot) 2022-11-18T12:05:30,126 ``` 2022-11-18T12:05:30,127 ### Method 2: Redshift-dependent power-law fit to the $f_b$ - $M_\mathrm{halo}$ relation. 2022-11-18T12:05:30,127 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. 2022-11-18T12:05:30,128 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: 2022-11-18T12:05:30,129 $$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},$$ 2022-11-18T12:05:30,130 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). 2022-11-18T12:05:30,131 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. 2022-11-18T12:05:30,131 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. 2022-11-18T12:05:30,132 ``` 2022-11-18T12:05:30,132 import pyspk.model as spk 2022-11-18T12:05:30,133 from astropy.cosmology import FlatLambdaCDM 2022-11-18T12:05:30,134 H0 = 70 2022-11-18T12:05:30,134 Omega_b = 0.0463 2022-11-18T12:05:30,134 Omega_m = 0.2793 2022-11-18T12:05:30,135 cosmo = FlatLambdaCDM(H0=H0, Om0=Omega_m, Ob0=Omega_b) 2022-11-18T12:05:30,135 alpha = 4.189 2022-11-18T12:05:30,136 beta = 1.273 2022-11-18T12:05:30,136 gamma = 0.298 2022-11-18T12:05:30,136 z = 0.5 2022-11-18T12:05:30,137 k, sup = spk.sup_model(SO=500, z=z, alpha=alpha, beta=beta, gamma=gamma, cosmo=cosmo) 2022-11-18T12:05:30,137 ``` 2022-11-18T12:05:30,138 ### Method 3: Binned data for the $f_b$ - $M_\mathrm{halo}$ relation. 2022-11-18T12:05:30,139 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. 2022-11-18T12:05:30,140 ## Priors 2022-11-18T12:05:30,140 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$. 2022-11-18T12:05:30,141 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: 2022-11-18T12:05:30,141 | Parameter | Description | Prior | 2022-11-18T12:05:30,142 | ----------- | ------------------ | --------------- | 2022-11-18T12:05:30,142 | $\alpha$ | Normaliasation | G(4.189, 0.066) | 2022-11-18T12:05:30,142 | $\beta$ | Slope | G(1.273, 0.044) | 2022-11-18T12:05:30,142 | $\gamma$ | Redshift evolution | G(0.298, 0.063) | 2022-11-18T12:05:30,143 where G(x, y) is a Gaussian distribution with center x and width y. 2022-11-18T12:05:30,144 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: 2022-11-18T12:05:30,144 | Parameter | Description | Prior | 2022-11-18T12:05:30,145 | ----------- | ------------------ | --------------- | 2022-11-18T12:05:30,145 | $\alpha$ | Normaliasation | U(4.060, 4.306) | 2022-11-18T12:05:30,145 | $\beta$ | Slope | U(1.199, 1.347) | 2022-11-18T12:05:30,146 | $\gamma$ | Redshift evolution | U(0.159, 0.414) | 2022-11-18T12:05:30,146 where U(x, y) is a uniform distribution over [x, y]. 2022-11-18T12:05:30,147 Finally, the full range of fitted parameters spanned by our simulations, regardless of whether or not they agree with observational constraints is: 2022-11-18T12:05:30,148 | Parameter | Description | Prior | 2022-11-18T12:05:30,148 | ----------- | ------------------ | --------------- | 2022-11-18T12:05:30,148 | $\alpha$ | Normaliasation | U(3.060, 4.508) | 2022-11-18T12:05:30,149 | $\beta$ | Slope | U(0.989, 1.620) | 2022-11-18T12:05:30,149 | $\gamma$ | Redshift evolution | U(0.046, 0.631) | 2022-11-18T12:05:30,150 where U(x, y) is a uniform distribution over [x, y]. 2022-11-18T12:05:30,150 ## Acknowledging the code 2022-11-18T12:05:30,151 Please cite py-SP(k) using: 2022-11-18T12:05:30,151 ``` 2022-11-18T12:05:30,152 @ARTICLE{spk, 2022-11-18T12:05:30,152 author = {}, 2022-11-18T12:05:30,152 title = "{}", 2022-11-18T12:05:30,153 journal = {\mnras}, 2022-11-18T12:05:30,153 keywords = {}, 2022-11-18T12:05:30,153 year = , 2022-11-18T12:05:30,154 month = , 2022-11-18T12:05:30,154 volume = {}, 2022-11-18T12:05:30,154 number = {}, 2022-11-18T12:05:30,154 pages = {}, 2022-11-18T12:05:30,155 doi = {}, 2022-11-18T12:05:30,155 archivePrefix = {arXiv}, 2022-11-18T12:05:30,155 eprint = {}, 2022-11-18T12:05:30,156 primaryClass = {astro-ph.CO}, 2022-11-18T12:05:30,156 adsurl = {}, 2022-11-18T12:05:30,156 adsnote = {} 2022-11-18T12:05:30,157 } 2022-11-18T12:05:30,157 ``` 2022-11-18T12:05:30,157 For any questions and enquires please contact me via email at *j.salcidonegrete@ljmu.ac.uk* 2022-11-18T12:05:30,544 running bdist_wheel 2022-11-18T12:05:31,279 running build 2022-11-18T12:05:31,279 running build_py 2022-11-18T12:05:31,347 creating build 2022-11-18T12:05:31,348 creating build/lib 2022-11-18T12:05:31,349 creating build/lib/pyspk 2022-11-18T12:05:31,351 copying pyspk/__init__.py -> build/lib/pyspk 2022-11-18T12:05:31,355 copying pyspk/fit_vals.py -> build/lib/pyspk 2022-11-18T12:05:31,358 copying pyspk/model.py -> build/lib/pyspk 2022-11-18T12:05:31,362 running egg_info 2022-11-18T12:05:31,507 writing pyspk.egg-info/PKG-INFO 2022-11-18T12:05:31,512 writing dependency_links to pyspk.egg-info/dependency_links.txt 2022-11-18T12:05:31,516 writing requirements to pyspk.egg-info/requires.txt 2022-11-18T12:05:31,518 writing top-level names to pyspk.egg-info/top_level.txt 2022-11-18T12:05:31,582 reading manifest file 'pyspk.egg-info/SOURCES.txt' 2022-11-18T12:05:31,588 reading manifest template 'MANIFEST.in' 2022-11-18T12:05:31,599 adding license file 'LICENSE.md' 2022-11-18T12:05:31,604 writing manifest file 'pyspk.egg-info/SOURCES.txt' 2022-11-18T12:05:31,609 /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`. 2022-11-18T12:05:31,610 !! 2022-11-18T12:05:31,611 ############################ 2022-11-18T12:05:31,611 # Package would be ignored # 2022-11-18T12:05:31,611 ############################ 2022-11-18T12:05:31,612 Python recognizes 'pyspk.__pycache__' as an importable package, 2022-11-18T12:05:31,612 but it is not listed in the `packages` configuration of setuptools. 2022-11-18T12:05:31,613 'pyspk.__pycache__' has been automatically added to the distribution only 2022-11-18T12:05:31,613 because it may contain data files, but this behavior is likely to change 2022-11-18T12:05:31,613 in future versions of setuptools (and therefore is considered deprecated). 2022-11-18T12:05:31,614 Please make sure that 'pyspk.__pycache__' is included as a package by using 2022-11-18T12:05:31,614 the `packages` configuration field or the proper discovery methods 2022-11-18T12:05:31,614 (for example by using `find_namespace_packages(...)`/`find_namespace:` 2022-11-18T12:05:31,615 instead of `find_packages(...)`/`find:`). 2022-11-18T12:05:31,615 You can read more about "package discovery" and "data files" on setuptools 2022-11-18T12:05:31,616 documentation page. 2022-11-18T12:05:31,617 !! 2022-11-18T12:05:31,617 check.warn(importable) 2022-11-18T12:05:31,618 copying pyspk/.DS_Store -> build/lib/pyspk 2022-11-18T12:05:31,618 copying pyspk/stat_errors_200.csv -> build/lib/pyspk 2022-11-18T12:05:31,633 copying pyspk/stat_errors_500.csv -> build/lib/pyspk 2022-11-18T12:05:31,647 creating build/lib/pyspk/__pycache__ 2022-11-18T12:05:31,648 copying pyspk/__pycache__/__init__.cpython-39.pyc -> build/lib/pyspk/__pycache__ 2022-11-18T12:05:31,652 copying pyspk/__pycache__/fit_vals.cpython-39.pyc -> build/lib/pyspk/__pycache__ 2022-11-18T12:05:31,656 copying pyspk/__pycache__/model.cpython-39.pyc -> build/lib/pyspk/__pycache__ 2022-11-18T12:05:31,729 /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. 2022-11-18T12:05:31,729 setuptools.SetuptoolsDeprecationWarning, 2022-11-18T12:05:31,792 installing to build/bdist.linux-armv7l/wheel 2022-11-18T12:05:31,793 running install 2022-11-18T12:05:31,855 running install_lib 2022-11-18T12:05:31,920 creating build/bdist.linux-armv7l 2022-11-18T12:05:31,920 creating build/bdist.linux-armv7l/wheel 2022-11-18T12:05:31,924 creating build/bdist.linux-armv7l/wheel/pyspk 2022-11-18T12:05:31,925 copying build/lib/pyspk/__init__.py -> build/bdist.linux-armv7l/wheel/pyspk 2022-11-18T12:05:31,929 copying build/lib/pyspk/stat_errors_500.csv -> build/bdist.linux-armv7l/wheel/pyspk 2022-11-18T12:05:31,942 copying build/lib/pyspk/stat_errors_200.csv -> build/bdist.linux-armv7l/wheel/pyspk 2022-11-18T12:05:31,959 copying build/lib/pyspk/fit_vals.py -> build/bdist.linux-armv7l/wheel/pyspk 2022-11-18T12:05:31,962 copying build/lib/pyspk/model.py -> build/bdist.linux-armv7l/wheel/pyspk 2022-11-18T12:05:31,967 copying build/lib/pyspk/.DS_Store -> build/bdist.linux-armv7l/wheel/pyspk 2022-11-18T12:05:31,972 creating build/bdist.linux-armv7l/wheel/pyspk/__pycache__ 2022-11-18T12:05:31,974 copying build/lib/pyspk/__pycache__/model.cpython-39.pyc -> build/bdist.linux-armv7l/wheel/pyspk/__pycache__ 2022-11-18T12:05:31,979 copying build/lib/pyspk/__pycache__/fit_vals.cpython-39.pyc -> build/bdist.linux-armv7l/wheel/pyspk/__pycache__ 2022-11-18T12:05:31,982 copying build/lib/pyspk/__pycache__/__init__.cpython-39.pyc -> build/bdist.linux-armv7l/wheel/pyspk/__pycache__ 2022-11-18T12:05:31,985 running install_egg_info 2022-11-18T12:05:32,059 Copying pyspk.egg-info to build/bdist.linux-armv7l/wheel/pyspk-1.1-py3.7.egg-info 2022-11-18T12:05:32,079 running install_scripts 2022-11-18T12:05:32,272 adding license file "LICENSE.md" (matched pattern "LICEN[CS]E*") 2022-11-18T12:05:32,281 creating build/bdist.linux-armv7l/wheel/pyspk-1.1.dist-info/WHEEL 2022-11-18T12:05:32,286 creating '/tmp/pip-wheel-29csf9p_/pyspk-1.1-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2022-11-18T12:05:32,291 adding 'pyspk/.DS_Store' 2022-11-18T12:05:32,294 adding 'pyspk/__init__.py' 2022-11-18T12:05:32,297 adding 'pyspk/fit_vals.py' 2022-11-18T12:05:32,302 adding 'pyspk/model.py' 2022-11-18T12:05:32,393 adding 'pyspk/stat_errors_200.csv' 2022-11-18T12:05:32,487 adding 'pyspk/stat_errors_500.csv' 2022-11-18T12:05:32,494 adding 'pyspk/__pycache__/__init__.cpython-39.pyc' 2022-11-18T12:05:32,497 adding 'pyspk/__pycache__/fit_vals.cpython-39.pyc' 2022-11-18T12:05:32,502 adding 'pyspk/__pycache__/model.cpython-39.pyc' 2022-11-18T12:05:32,507 adding 'pyspk-1.1.dist-info/LICENSE.md' 2022-11-18T12:05:32,511 adding 'pyspk-1.1.dist-info/METADATA' 2022-11-18T12:05:32,513 adding 'pyspk-1.1.dist-info/WHEEL' 2022-11-18T12:05:32,515 adding 'pyspk-1.1.dist-info/top_level.txt' 2022-11-18T12:05:32,516 adding 'pyspk-1.1.dist-info/RECORD' 2022-11-18T12:05:32,525 removing build/bdist.linux-armv7l/wheel 2022-11-18T12:05:32,782 Building wheel for pyspk (setup.py): finished with status 'done' 2022-11-18T12:05:32,794 Created wheel for pyspk: filename=pyspk-1.1-py3-none-any.whl size=153928 sha256=2c787ef97d85f7abf4348ac04aa1b05fc7f6dc20af7fb5e0dd1551349d6446ac 2022-11-18T12:05:32,796 Stored in directory: /tmp/pip-ephem-wheel-cache-tykj38xg/wheels/3d/ae/92/16f5831f6f6be1bdb3b8be502a2db7539e97e450757198e224 2022-11-18T12:05:32,824 Successfully built pyspk 2022-11-18T12:05:32,841 Removed build tracker: '/tmp/pip-build-tracker-xappnvym'