Skip to content

Commit

Permalink
Update demo_mock_ensemble_realistic.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
hsinfan1996 committed Jul 2, 2023
1 parent f96f432 commit dcd95af
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/demo_mock_ensemble_realistic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@
" n_s=0.96,\n",
" Neff=3.04,\n",
" m_nu=1.0e-05,\n",
" m_nu_type=\"single\",\n",
" mass_split=\"single\",\n",
")\n",
"hmd_200c = ccl.halos.MassDef(200, \"critical\")\n",
"\n",
"\n",
"# For a different multiplicty function, the user must change this function below\n",
"def tinker08_ccl(logm, z):\n",
" mass = 10 ** (logm)\n",
" hmf_200c = ccl.halos.MassFuncTinker08(cosmo, mass_def=hmd_200c)\n",
" nm = hmf_200c.get_mass_function(cosmo, mass, 1.0 / (1 + z))\n",
" hmf_200c = ccl.halos.MassFuncTinker08(mass_def=hmd_200c)\n",
" nm = hmf_200c(cosmo, mass, 1.0 / (1 + z))\n",
" return nm # dn/dlog10M\n",
"\n",
"\n",
Expand Down Expand Up @@ -633,12 +633,12 @@
"cluster_z = ran_z[indices]\n",
"\n",
"# Concentration CCL object to compute the theoretical concentration\n",
"conc_obj = ccl.halos.ConcentrationDuffy08(hmd_200c)\n",
"conc_obj = ccl.halos.ConcentrationDuffy08(mass_def=hmd_200c)\n",
"conc_list = []\n",
"for number in range(0, len(cluster_m)):\n",
" a = 1.0 / (1.0 + (cluster_z[number]))\n",
" # mean value of the concentration for that cluster\n",
" lnc_mean = np.log(conc_obj.get_concentration(cosmo, M=(cluster_m[number]), a=a))\n",
" lnc_mean = np.log(conc_obj(cosmo, M=(cluster_m[number]), a=a))\n",
" # random draw of actual concentration from normal distribution around lnc_mean, with a 0.14 scatter\n",
" lnc = np.random.normal(lnc_mean, 0.14)\n",
" conc_list.append(np.exp(lnc))\n",
Expand Down Expand Up @@ -1179,9 +1179,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3.11",
"language": "python",
"name": "python3"
"name": "python3.11"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1193,7 +1193,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit dcd95af

Please sign in to comment.