Skip to content

Commit

Permalink
documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
cinthianlima committed Aug 20, 2021
1 parent bcb7732 commit 8dbbaef
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 150 deletions.
117 changes: 42 additions & 75 deletions notebooks/.ipynb_checkpoints/NC_CCL_mass_function-checkpoint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,30 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Importing the libraries\n",
"# Contents\n",
"\n",
"In the cell below we import the libraries <code>CCL</code> and <code>NumCosmo</code> for comparison between their mass functions for different multiplicity functions.\n",
"### 1. [Importing the libraries](#libraries)\n",
"### 2. [Cosmological constants](#constants)\n",
"### 3. [Initializing the libraries ](#Initializing)\n",
"### 4. [Linear matter power spectrum](#powerspectrum)\n",
"### 5. [Multiplicity functions](#multiplicity)\n",
"### 6. [Mass function and plot](#mass)\n",
"\n",
"To the import <code>NumCosmo</code>, we should import <code>GObject</code> . This is important because <code>GObject</code> help us to maps the C language in other languages, like python.\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<a class=\"anchor\" id=\"libraries\"></a>\n",
"## 1. Importing the libraries\n",
"\n",
"The package <code>sys</code> is related to the manipulation and obtaining information from the python environment. Now, the packages <code>numpy</code> and <code>math</code> help us with the calculations, gives us access to mathematical functions.\n",
"In the cell below we import the libraries `CCL` and `NumCosmo` for comparison between their mass functions for different multiplicity functions.\n",
"\n",
"To the import `NumCosmo`, we should import `GObject` . This is important because `GObject` help us to maps the C language in other languages, like python.\n",
"\n",
"The package `sys` is related to the manipulation and obtaining information from the python environment. Now, the packages `numpy` and `math` help us with the calculations, gives us access to mathematical functions.\n",
"\n",
"\n"
]
Expand Down Expand Up @@ -84,7 +101,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Cosmological constants\n",
"<a class=\"anchor\" id=\"constants\"></a>\n",
"## 2. Cosmological constants\n",
"\n",
"In this cell below we fix the cosmological constants to avoid conflits in the calculations and comparisons between the libraries.\n",
"\n",
Expand Down Expand Up @@ -125,11 +143,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Initializing the libraries \n",
"<a class=\"anchor\" id=\"Initializing\"></a>\n",
"## 3. Initializing the libraries \n",
"\n",
"First we create the cosmology object of CCL, <code>cosmo_ccl</code>.Next, we initialize the <code>NumCosmo</code> using <code>Ncm.cfg_init ()</code>, this function should be placed before any NumCosmo function, and then we create the cosmology object of <code>NumCosmo</code>.\n",
"First we create the cosmology object of CCL, `cosmo_ccl`.Next, we initialize the `NumCosmo` using `Ncm.cfg_init ()`, this function should be placed before any NumCosmo function, and then we create the cosmology object of `NumCosmo`.\n",
"\n",
"We also create the homogeneous and isotropic object, <code> hiprim </code>, this is necessary to calculate the linear power spectrum P(k).\n",
"We also create the homogeneous and isotropic object, ` hiprim `, this is necessary to calculate the linear power spectrum P(k).\n",
"\n",
"\n",
"\n"
Expand Down Expand Up @@ -182,11 +201,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Linear matter power spectrum\n",
"<a class=\"anchor\" id=\"powerspectrum\"></a>\n",
"## 4. Linear matter power spectrum\n",
"\n",
"The linear matter power spectrum P(k) describes the linear evolution of the density pertubations. To calculate it we use the transfer function T(k) and apply a tophat filter.\n",
"\n",
"The code <code> TransferFunc.new_from_name </code> returns a new <code>NcTransferFunc</code>, whose type is defined in this case by \"NcTransferFuncEH\" .\n",
"The code `TransferFunc.new_from_name` returns a new `NcTransferFunc`, whose type is defined in this case by \"NcTransferFuncEH\" .\n",
" \n",
"The transfer function, T(k), is defined as,\n",
"$$\n",
Expand All @@ -195,7 +215,7 @@
"\n",
"$\\hat{\\delta}(k,z) $ is the density pertubation and, by definition, $\\lim_{k\\rightarrow 0} T (k) \\rightarrow 1$.\n",
"\n",
"We create a new linear matter power spectrum object using <code> PowspecMLTransfer.new (tf)</code> calculated over a range of small to large scales of the wavenumber,k, and apply a tophat filter using <code> Ncm.PowspecFilter.new (psml, Ncm.PowspecFilterType.TOPHAT) </code>."
"We create a new linear matter power spectrum object using `PowspecMLTransfer.new (tf)` calculated over a range of small to large scales of the wavenumber,k, and apply a tophat filter using ` Ncm.PowspecFilter.new (psml, Ncm.PowspecFilterType.TOPHAT)`."
]
},
{
Expand All @@ -222,31 +242,32 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Multiplicity functions\n",
"<a class=\"anchor\" id=\"multiplicity\"></a>\n",
"## 5. Multiplicity functions\n",
"\n",
"The multiplicity function contains information about the collapse process and halo formation. In the cell above we defined the multiplicity functions objects for different formalisms.\n",
"\n",
"For the Press-Schechter (1974ApJ...187..425P) formalism the multiplicity function is:\n",
"For the Press-Schechter [(1974ApJ...187..425P)](http://articles.adsabs.harvard.edu/pdf/1974ApJ...187..425P>) formalism the multiplicity function is:\n",
"$$\n",
"f_{PS}(\\sigma_{R}) = \\sqrt{\\frac{2}{\\pi}}(\\delta_{c}{\\sigma_{R}}^{-1})exp[-\\delta_{c}^{2}{\\sigma_{R}}^{-2}/2]\n",
"$$\n",
"$\\delta_{c}$ is the critical density; $\\sigma_{R}$ is the filtered variance.\n",
"\n",
"The Sheth-Tormen (arXiv:astro-ph/9901122) multiplicity function is:\n",
"The Sheth-Tormen [(arXiv:astro-ph/9901122)](https://arxiv.org/pdf/astro-ph/9901122.pdf) multiplicity function is:\n",
"$$\n",
"f_{ST}(\\sigma)= A_{ST}\\sqrt{\\frac{2a}{\\pi}}[1 + (a\\delta_{c}{\\sigma_{R}}^{-1})^{-p}]exp[-{(a\\delta_{c}{\\sigma_{R}}^{-1})}^{2} /2] \n",
"$$\n",
"\n",
"$A_{ST}$=0.3222; a = 0.707; p = 0.3.\n",
"\n",
"For Jenkins 2001 (arXiv:astro-ph/0005260), the multiplicity function is:\n",
"For Jenkins 2001 [(arXiv:astro-ph/0005260)](https://arxiv.org/pdf/astro-ph/0005260.pdf), the multiplicity function is:\n",
"$$\n",
"f_{Jenkins}(\\sigma)= A exp [-{|{ln{(\\sigma)}^{-1} + B}|}^{\\epsilon}\n",
"$$\n",
"\n",
"A = 0.315; B=0.61; $\\epsilon$ = 3.8.\n",
"\n",
"In Tinker 2008 (astro-ph/0803.2706) is:\n",
"In Tinker 2008 [(astro-ph/0803.2706)](https://arxiv.org/pdf/0803.2706.pdf) is:\n",
"\n",
"$$\n",
"f_{T08}(\\sigma(z), z)= A \\left[ { \\left( \\frac {\\sigma(z)}{b} \\right)}^{-a} + 1 \\right] exp (- c{\\sigma(z)}^{-2})\n",
Expand All @@ -264,7 +285,7 @@
"b(z) = b_{0} {(1 + z)}^{−α}.\n",
"$$\n",
"\n",
"In Tinker 2010 (arXiv:1001.3162) is:\n",
"In Tinker 2010 [(arXiv:1001.3162)](https://arxiv.org/pdf/1001.3162.pdf) is:\n",
"\n",
"$$\n",
"f_{T10}(\\nu) = \\alpha [1 + {(\\beta \\nu)}^{−2\\phi}]{\\nu}^{ 2 \\eta} exp[−\\gamma \\nu^{2}/2]\n",
Expand All @@ -287,7 +308,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 11,
"metadata": {
"scrolled": true
},
Expand Down Expand Up @@ -385,9 +406,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Mass function and plot\n",
"<a class=\"anchor\" id=\"mass\"></a>\n",
"## 6. Mass function and plot\n",
"\n",
"In the cell below we created a list <code> multiplicity_functions </code> of pairs, containing the multiplicity function of <code> ccl </code> and <code> numcosmo </code>, respectively, for each formalism. Then we use the multiplicity functions to calculate the mass function in each case.\n",
"In the cell below we created a list `multiplicity_functions` of pairs, containing the multiplicity function of ` ccl` and `numcosmo`, respectively, for each formalism. Then we use the multiplicity functions to calculate the mass function in each case.\n",
"\n",
"We plot first the graph of mass functions calculated using data of ccl and the second graph plotted is the difference of the mass function of libraries, for each formalism.\n"
]
Expand Down Expand Up @@ -475,61 +497,6 @@
"source": [
"print (\"% 22.15g\" % (hmf_PS.delta_c))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 8dbbaef

Please sign in to comment.