Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
39bfb32
add Paper_v2.0/paper_formating.py
m-aguena Sep 20, 2024
2cd7dd9
Merge branch 'main' into issue/639/paper_2.0_figs
m-aguena Sep 24, 2024
0c7385d
Merge branch 'main' into issue/639/paper_2.0_figs
combet Jan 29, 2025
7b83e07
Merge branch 'main' into issue/639/paper_2.0_figs
combet Jan 30, 2025
cf18c6c
NB for v2.0 paper figure showing miscentering, boost and 2-halo term
combet Jan 30, 2025
7e3669b
Rename NB
combet Jan 30, 2025
9a0593e
Notebook that makes Figure 7
rkrishnan2912 May 30, 2025
dd2a76f
add mass_conversion.ipynb
m-aguena Jun 5, 2025
d9753e8
add magnification_bias.ipynb
m-aguena Jun 5, 2025
f4f5fea
add add_grid in paper_formating.py
m-aguena Jun 6, 2025
10e974a
format fig_2halo_miscentering_boost_theory.ipynb
m-aguena Jun 6, 2025
bee33c2
add examples/Paper_v2.0/theo_diff_z_types.ipynb
m-aguena Jun 6, 2025
01f4f6a
add subplots_kwargs to prep_plot
m-aguena Jun 7, 2025
9574d14
add profiles to examples/Paper_v2.0/theo_diff_z_types.ipynb
m-aguena Jun 7, 2025
fa464ae
add nb for hsc fig
shenmingfu Aug 18, 2025
b3fda3a
add nb for des fig
shenmingfu Aug 19, 2025
1c26518
add nb for des fig
shenmingfu Aug 19, 2025
272ba94
Revert "add nb for des fig"
shenmingfu Aug 19, 2025
193be06
revert accidental change to mass_fitting/Example4_Fit_Halo_mass_to_HS…
shenmingfu Aug 19, 2025
cb35123
update data nbs
m-aguena Dec 17, 2025
341ec00
Merge branch 'main' into issue/639/paper_2.0_figs
m-aguena Dec 17, 2025
32cc662
Rename Figure_2_halo_miscentering_boost_theory.ipynb
marina-ricci Mar 27, 2026
db12eba
Rename magnification_bias.ipynb to Figure_3_magnification_bias.ipynb
marina-ricci Mar 27, 2026
dc96ca7
Rename mass_conversion.ipynb to Figure_4_mass_conversion.ipynb
marina-ricci Mar 27, 2026
84f6822
Rename theo_diff_z_types.ipynb to Figures_5_6_theo_diff_z_types.ipynb
marina-ricci Mar 27, 2026
b577bde
Rename Figure_5_6_theo_diff_z_types.ipynb
marina-ricci Mar 27, 2026
c37b1b7
Rename Example4 notebook to Figure 8
marina-ricci Mar 27, 2026
949d493
Add Figure 9 notebook for halo mass fitting
marina-ricci Mar 27, 2026
661f4d2
add common cosmology for all figures
m-aguena Apr 2, 2026
beaaf3b
update fig 4
m-aguena Apr 2, 2026
b31bfc4
update cosmo in fig 4
m-aguena Apr 2, 2026
bde2ab8
fix merge conflicts
m-aguena Apr 2, 2026
60f290c
update cosmo in fig 7
m-aguena Apr 2, 2026
bda43ae
run black
m-aguena Apr 2, 2026
c798738
add examples/Paper_v2.0/Figure_10_DC2_redMaPPer_clusterensemble_objec…
m-aguena Apr 2, 2026
bdeb65f
rename Fig <10 notebooks
m-aguena Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions examples/Paper_v2.0/Figure_02_halo_miscentering_boost_theory.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Figure to show the new 2-halo term and miscentering functionality"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from paper_formating import add_grid, prep_plot"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Imports specific to clmm "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import clmm\n",
"import clmm.utils as u\n",
"from cosmology_set import dc2_cosmo as cosmo"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Make sure we know which version we're using"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"clmm.__version__"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Define the galaxy cluster model. Here, we choose parameters that describe the galaxy cluster model, including the mass definition, concentration, and mass distribution. For the mass distribution, we choose a distribution that follows an NFW profile."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"moo = clmm.Modeling(massdef=\"mean\", delta_mdef=200, halo_profile_model=\"nfw\")\n",
"\n",
"mass_cl = 1.0e14\n",
"z_cl = 0.4\n",
"\n",
"conc_cl = 5.4 # Duffy08 value for this halo mass and redshift (see last commented cell)\n",
"halo_bias = 2.4 # Tkinker10 value for this halo mass and redshift (see last commented cell)\n",
"\n",
"moo.set_cosmo(cosmo)\n",
"moo.set_concentration(conc_cl)\n",
"moo.set_mass(mass_cl)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"r_proj = np.logspace(-2, 2, 100)\n",
"\n",
"DeltaSigma = moo.eval_excess_surface_density(r_proj, z_cl)\n",
"\n",
"# Miscentered DeltaSigma\n",
"DeltaSigma_mis = moo.eval_excess_surface_density(r_proj, z_cl, r_mis=0.2)\n",
"\n",
"# 2halo DeltaSigma\n",
"DeltaSigma_2h = moo.eval_excess_surface_density_2h(r_proj, z_cl, halobias=6)\n",
"\n",
"# boost model\n",
"r_scale = 0.3\n",
"nfw_boost = u.compute_nfw_boost(r_proj, r_scale, boost0=0.2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Plot the predicted profiles"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig = prep_plot(figsize=(9, 9))\n",
"ax = plt.axes()\n",
"\n",
"ax.loglog(r_proj, DeltaSigma, label=\"1-halo (reference)\", color=\"k\")\n",
"ax.loglog(r_proj, DeltaSigma_mis, ls=\"--\", label=r\"1-halo ($R_{\\rm mis} = 0.2$Mpc)\")\n",
"ax.loglog(r_proj, DeltaSigma / nfw_boost, ls=\":\", label=\"1-halo (boost correction)\")\n",
"ax.loglog(r_proj, DeltaSigma_2h, ls=\"dashdot\", label=\"2-halo\")\n",
"ax.legend(loc=1, fontsize=6.5)\n",
"\n",
"ax.set_xlabel(\"R [Mpc]\")\n",
"ax.set_ylabel(r\"$\\Delta\\Sigma$ [M$_\\odot$ Mpc$^{-2}$]\")\n",
"ax.set_ylim(8.0e10, 1e15)\n",
"ax.set_xlim(1e-2, 1e2)\n",
"\n",
"add_grid(ax)\n",
"\n",
"fig.tight_layout()\n",
"fig.savefig(\"2h_miscentering_boost.png\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "clmm",
"language": "python",
"name": "clmm"
},
"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.8"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
168 changes: 168 additions & 0 deletions examples/Paper_v2.0/Figure_03_magnification_bias.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Plot magnification bias"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Imports specific to clmm "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import clmm\n",
"from cosmology_set import dc2_cosmo as cosmo"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Make sure we know which version we're using"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"clmm.__version__"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Define the galaxy cluster model. Here, we choose parameters that describe the galaxy cluster model, including the mass definition, concentration, and mass distribution. For the mass distribution, we choose a distribution that follows an NFW profile."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"moo = clmm.Modeling(massdef=\"mean\", delta_mdef=200, halo_profile_model=\"nfw\")\n",
"\n",
"moo.set_cosmo(cosmo)\n",
"moo.set_concentration(4)\n",
"moo.set_mass(1.0e15)\n",
"\n",
"z_cl = 1.0\n",
"\n",
"# source properties\n",
"z_src = 2.0 # all sources in the same plane\n",
"z_distrib_func = (\n",
" clmm.utils.redshift_distributions.chang2013\n",
") # sources redshift following a distribution\n",
"alpha = [2, -0.5]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Compute quantity"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"r3d = np.logspace(-2, 2, 100)\n",
"mu_bias = moo.eval_magnification_bias(r3d, z_cl, z_src, alpha)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Plot the predicted profiles"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from paper_formating import prep_plot"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig = prep_plot(figsize=(9, 9))\n",
"ax = plt.axes()\n",
"\n",
"ax.plot(r3d, mu_bias[0] - 1, label=\"$\\\\alpha$ =\" + str(alpha[0]))\n",
"ax.plot(r3d, mu_bias[1] - 1, label=\"$\\\\alpha$ =\" + str(alpha[1]))\n",
"\n",
"ax.set_ylabel(\"$\\delta_{\\mu}$\")\n",
"ax.set_xlabel(\"R [Mpc]\")\n",
"ax.legend() # fontsize=\"xx-large\")\n",
"ax.set_xscale(\"log\")\n",
"\n",
"ax.set_ylim(-1.1, 3)\n",
"ax.set_xlim(0.06, 1e1)\n",
"\n",
"ax.grid(lw=0.5)\n",
"ax.minorticks_on()\n",
"ax.grid(which=\"minor\", lw=0.1)\n",
"ax.set_axisbelow(True)\n",
"\n",
"plt.tight_layout()\n",
"plt.savefig(\"delta_mu.png\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "clmm",
"language": "python",
"name": "clmm"
},
"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.8"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading
Loading