{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Initializing the Halo Model" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# preamble\n", "from __future__ import annotations\n", "\n", "import numpy as np\n", "import pyccl as ccl" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We create a cosmology object using `pyccl`. We then choose our halo mass definition $M_{\\rm 200m}$, \n", "the [Tinker et al 2008](https://arxiv.org/abs/0803.2706]) halo mass function, the [Duffy et al 2008](https://arxiv.org/abs/0804.2486) concentration-mass relation, and [Tinker et al 2010](https://arxiv.org/abs/1001.3162) halo bias function. With these halo model components we can construct the `HMCalculator` object from `pyccl` which will serve as the backbone for our halo model calculations. Our halo model integrals will integrate over halos with a range of masses [$10^{10}, 10^{15}$]." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Cosmological parameters\n", "Omega_b = 0.044\n", "Omega_c = 0.25 - Omega_b\n", "h = 0.7\n", "sigma8 = 0.8344\n", "n_s = 0.9624\n", "\n", "cosmo = ccl.Cosmology(Omega_c=Omega_c, Omega_b=Omega_b, h=h, sigma8=sigma8, n_s=n_s)\n", "\n", "# We will use the Δ=200 mass definition\n", "hmd = ccl.halos.MassDef200m\n", "\n", "# The Tinker 2008 mass function\n", "nM = ccl.halos.MassFuncTinker08(mass_def=hmd)\n", "\n", "# The Duffy 2008 concentration-mass relation\n", "cM_relation = ccl.halos.concentration.ConcentrationDuffy08(mass_def=hmd)\n", "\n", "# The Tinker 2010 halo bias\n", "bM = ccl.halos.HaloBiasTinker10(mass_def=hmd)\n", "\n", "# The HMF and bias are combined in a `HMCalculator` object, along with mass definition\n", "hmc = ccl.halos.HMCalculator(\n", " mass_function=nM, # Mass function\n", " halo_bias=bM, # Halo bias\n", " mass_def=hmd, # Mass definition\n", " log10M_min=np.log10(1e10), # Minimum halo mass\n", " log10M_max=np.log10(1e15), # Maximum halo mass\n", " nM=32, # Number of bins in mass\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For all other notebooks, these components will be predefined in `init_halo_model.py`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [] } ], "metadata": { "kernelspec": { "display_name": "glasz_docs", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.11" } }, "nbformat": 4, "nbformat_minor": 2 }