Skip to content

Commit

Permalink
Small updates before 3.3 (corrected notebooks, updated output files, …
Browse files Browse the repository at this point in the history
…recompiled documentation)

* all notebooks and scripts checked and corrected. Involved the definition of a new derived parameter conf_time_reio
* updated doxygen documentation to v3.3.0
* updated output/explanatory00_* files to v3.3.0
  • Loading branch information
lesgourg authored Feb 17, 2025
1 parent b94f8e4 commit ea88b4a
Show file tree
Hide file tree
Showing 38 changed files with 6,236 additions and 6,556 deletions.
6 changes: 5 additions & 1 deletion doc/input/chap3.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ it can be interfaced with other codes, etc.

- `external/` contains auxiliary or external algorithms used by `CLASS`, in particular:

- `external/hyrec/` contains the recombination code HyRec (Lee and Ali-Haimoud 2020) that solves the recombinaiton equations by default.
- `external/HyRec2020/` contains the recombination code HyRec (Lee and Ali-Haimoud 2020) that solves the recombinaiton equations by default.

- `external/RecfastCLASS/` contains an modified version of the recombinaiton code RECFAST v1.5. It can be used as an alternative to solve the recombinaiton equations (with `recombination=recfast').

- `external/Halofit/` contains the Halofit algorithm (including Takahashi-Bird updates)

- `external/HMcode/` contains the HMcode algorithm (including the 2020 updates)

- `external/heating/` contains additional peices of code and interpolation tables for the calculation of energy injection (relevant for CMB anisotropies and spectral distorsions).

- `external/distortions/` contains interpolation tables relevant for the calculation of CMB spectral distortions with J.Chluba's Green function method.
Expand Down
Binary file modified doc/manual/CLASS_MANUAL.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions include/thermodynamics.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ struct thermodynamics
double ds_d; /**< physical sound horizon at baryon drag */
double rs_d; /**< comoving sound horizon at baryon drag */

double conf_time_reio; /**< conformal time at reionization,
not to be confused with optical depth tau_reio */

double tau_cut; /**< at at which the visibility goes below a fixed fraction of the maximum visibility, used for an approximation in perturbation module */

double angular_rescaling; /**< [ratio ra_rec / (tau0-tau_rec)]: gives CMB rescaling in angular space relative to flat model (=1 for curvature K=0) */
Expand Down
20 changes: 5 additions & 15 deletions notebooks/check_PPF_approx.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"h = {'PPF1':0.64,'PPF2':0.74,'FLD1':0.64}\n",
"\n",
"fig, axes = plt.subplots(1,2,figsize=(16,5))\n",
"for Omega_K in [-0.1, 0.0, 0.15]:\n",
"for Omega_K in [-0.1, 0.0, 0.1]:\n",
" for gauge in ['Synchronous','Newtonian']:\n",
" cosmo = {}\n",
" for M in models:\n",
Expand Down Expand Up @@ -196,7 +196,7 @@
"\n",
"fig, axes = plt.subplots(1,2,figsize=(18,8))\n",
"\n",
"for Omega_K in [-0.1, 0.0, 0.15]:\n",
"for Omega_K in [-0.1, 0.0, 0.1]:\n",
" for ppfgauge in ['Synchronous','Newtonian']:\n",
" cosmo = {}\n",
" for M in models:\n",
Expand Down Expand Up @@ -253,21 +253,11 @@
"\n",
"fig.savefig('check_PPF_Omegak2.pdf') "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print (0.31*0.64**2-0.022)\n",
"print (0.26*0.74**2-0.022)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -281,9 +271,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
42 changes: 8 additions & 34 deletions notebooks/cl_ST.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"source": [
"# import necessary modules\n",
"from classy import Class\n",
"from math import pi"
"from math import pi\n",
"%matplotlib inline\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt"
]
},
{
Expand Down Expand Up @@ -97,27 +100,6 @@
"cl_lensed = M.lensed_cl(l_max_scalars)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# modules and esthetic definitions for the plots\n",
"#\n",
"# uncomment to get plots displayed in notebook\n",
"%matplotlib inline\n",
"#\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n",
"#\n",
"font = {'size' : 16, 'family':'STIXGeneral'}\n",
"axislabelfontsize='large'\n",
"matplotlib.rc('font', **font)\n",
"matplotlib.mathtext.rcParams['legend.fontsize']='medium'\n",
"plt.rcParams[\"figure.figsize\"] = [8.0,6.0]"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -148,22 +130,14 @@
"plt.loglog(ellt,factort*clt['ee'],'b:',label=r'$\\mathrm{EE(t)}$')\n",
"plt.loglog(ellt,factort*clt['bb'],'g:',label=r'$\\mathrm{BB(t)}$')\n",
"plt.loglog(ell,factor*(cl_lensed['bb']-cl_tot['bb']),'g-',label=r'$\\mathrm{BB(lensing)}$')\n",
"plt.legend(loc='right',bbox_to_anchor=(1.4, 0.5))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.legend(loc='right',bbox_to_anchor=(1.4, 0.5))\n",
"plt.savefig('cl_ST.pdf',bbox_inches='tight')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -177,9 +151,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
41 changes: 8 additions & 33 deletions notebooks/cltt_terms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"source": [
"# import necessary modules\n",
"from classy import Class\n",
"from math import pi"
"from math import pi\n",
"%matplotlib inline\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt"
]
},
{
Expand Down Expand Up @@ -72,26 +75,6 @@
"M.empty()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# modules and settings for the plot\n",
"#\n",
"# uncomment to get plots displayed in notebook\n",
"%matplotlib inline\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n",
"# esthetic definitions for the plots\n",
"font = {'size' : 16, 'family':'STIXGeneral'}\n",
"axislabelfontsize='large'\n",
"matplotlib.rc('font', **font)\n",
"matplotlib.mathtext.rcParams['legend.fontsize']='medium'\n",
"plt.rcParams[\"figure.figsize\"] = [8.0,6.0]"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -118,22 +101,14 @@
"plt.semilogx(ell,factor*cl_tot['tt'],'r-',label=r'$\\mathrm{total}$')\n",
"plt.semilogx(ell,factor*cl_lensed['tt'],'k-',label=r'$\\mathrm{lensed}$')\n",
"#\n",
"plt.legend(loc='right',bbox_to_anchor=(1.4, 0.5))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.legend(loc='right',bbox_to_anchor=(1.4, 0.5))\n",
"plt.savefig('cltt_terms.pdf',bbox_inches='tight')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -147,9 +122,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
28 changes: 4 additions & 24 deletions notebooks/distances.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@
"from classy import Class"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"font = {'size' : 20, 'family':'STIXGeneral'}\n",
"axislabelfontsize='large'\n",
"matplotlib.rc('font', **font)\n",
"matplotlib.mathtext.rcParams['legend.fontsize']='medium'"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -100,22 +88,14 @@
"\n",
"plt.xlabel(r\"$z$\")\n",
"plt.ylabel(r\"$\\mathrm{Distance}\\times H_0$\")\n",
"plt.tight_layout()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.tight_layout()\n",
"plt.savefig('distances.pdf')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -129,9 +109,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
23 changes: 5 additions & 18 deletions notebooks/many_times.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@
"import math"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# esthetic definitions for the plots\n",
"font = {'size' : 16, 'family':'STIXGeneral'}\n",
"axislabelfontsize='large'\n",
"matplotlib.rc('font', **font)\n",
"matplotlib.mathtext.rcParams['legend.fontsize']='medium'\n",
"plt.rcParams[\"figure.figsize\"] = [8.0,6.0]"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -74,7 +60,8 @@
" 'perturbations_sampling_stepsize':'0.05',\n",
" 'P_k_max_1/Mpc':P_k_max_inv_Mpc,\n",
" 'compute damping scale':'yes', # needed to output and plot Silk damping scale\n",
" 'gauge':'newtonian'}\n",
" 'gauge':'newtonian',\n",
" 'matter_source_in_current_gauge':'yes'}\n",
"\n",
"###############\n",
"# \n",
Expand Down Expand Up @@ -281,7 +268,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -295,9 +282,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
29 changes: 4 additions & 25 deletions notebooks/neutrinohierarchy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@
"from scipy.optimize import fsolve"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# esthetic definitions for the plots\n",
"font = {'size' : 16, 'family':'STIXGeneral'}\n",
"axislabelfontsize='large'\n",
"matplotlib.rc('font', **font)\n",
"matplotlib.mathtext.rcParams['legend.fontsize']='medium'"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -128,22 +115,14 @@
"plt.xlim(kvec[0]/h,kvec[-1]/h)\n",
"plt.xlabel(r'$k [h \\mathrm{Mpc}^{-1}]$')\n",
"plt.ylabel(r'$1-P(k)^\\mathrm{NH}/P(k)^\\mathrm{IH}$')\n",
"plt.legend(legarray) "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.legend(legarray) \n",
"plt.savefig('neutrinohierarchy.pdf')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -157,9 +136,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
Loading

0 comments on commit ea88b4a

Please sign in to comment.