2024-03-08 10:44:19 +00:00
{
"cells": [
2024-03-21 15:50:37 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calibrating the velocity field against observations "
]
},
2024-03-08 10:44:19 +00:00
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": null,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-04-01 22:19:14 +00:00
"outputs": [],
2024-03-08 10:44:19 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"# Copyright (C) 2024 Richard Stiskalek\n",
"# This program is free software; you can redistribute it and/or modify it\n",
"# under the terms of the GNU General Public License as published by the\n",
"# Free Software Foundation; either version 3 of the License, or (at your\n",
"# option) any later version.\n",
"#\n",
"# This program is distributed in the hope that it will be useful, but\n",
"# WITHOUT ANY WARRANTY; without even the implied warranty of\n",
"# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\n",
"# Public License for more details.\n",
"#\n",
"# You should have received a copy of the GNU General Public License along\n",
"# with this program; if not, write to the Free Software Foundation, Inc.,\n",
"# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n",
2024-03-08 10:44:19 +00:00
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import jax\n",
2024-03-16 17:16:22 +00:00
"from numpyro.infer import MCMC, NUTS, init_to_median\n",
"import corner\n",
2024-03-21 15:50:37 +00:00
"from getdist import plots\n",
"from scipy.stats import multivariate_normal\n",
2024-03-08 10:44:19 +00:00
"\n",
"import csiborgtools\n",
"\n",
2024-03-21 15:50:37 +00:00
"from flow_calibration import *\n",
"\n",
2024-03-08 10:44:19 +00:00
"%load_ext autoreload\n",
"%autoreload 2\n",
2024-03-16 17:16:22 +00:00
"%matplotlib inline\n",
2024-03-08 10:44:19 +00:00
"\n",
"paths = csiborgtools.read.Paths(**csiborgtools.paths_glamdring)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## LOS density & radial velocity plots "
]
},
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": 37,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-06-21 18:21:06 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2024-06-21 17:15:50.033499: reading the catalogue,\n",
"2024-06-21 17:15:50.046835: reading the interpolated field,\n",
"2024-06-21 17:15:50.056588: calculating the radial velocity.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/mnt/users/rstiskalek/csiborgtools/csiborgtools/flow/flow_model.py:92: UserWarning: The number of radial steps is even. Skipping the first step at 0.0 because Simpson's rule requires an odd number of steps.\n",
" warn(f\"The number of radial steps is even. Skipping the first \"\n"
]
}
],
2024-03-08 10:44:19 +00:00
"source": [
2024-06-21 18:21:06 +00:00
"fpath = \"/mnt/extraspace/rstiskalek/catalogs/PV_compilation.hdf5\"\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-06-21 18:21:06 +00:00
"loader_carrick = csiborgtools.flow.DataLoader(\"Carrick2015\", 0, \"LOSS\", fpath, paths, ksmooth=0, )\n",
"loaders_csiborg2X = [csiborgtools.flow.DataLoader(\"csiborg2X\", i, \"LOSS\", fpath, paths, ksmooth=1, verbose=False) for i in range(20)]\n",
"loaders_csiborg2 = [csiborgtools.flow.DataLoader(\"csiborg2_main\", i, \"LOSS\", fpath, paths, ksmooth=1, verbose=False) for i in range(20)]"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "code",
2024-03-21 15:50:37 +00:00
"execution_count": null,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-03-16 17:02:00 +00:00
"outputs": [],
2024-03-08 10:44:19 +00:00
"source": [
2024-06-21 18:21:06 +00:00
"ks = [i for i in range(50)]\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-06-21 18:21:06 +00:00
"for k in ks:\n",
2024-03-16 17:02:00 +00:00
" fig, axs = plt.subplots(2, 1, figsize=(7, 7), sharex=True)\n",
" fig.subplots_adjust(wspace=0)\n",
2024-06-21 18:21:06 +00:00
" cols = plt.rcParams['axes.prop_cycle'].by_key()['color']\n",
2024-03-16 17:02:00 +00:00
" # CSiBORG2\n",
2024-06-21 18:21:06 +00:00
" x = loaders_csiborg2X[0].rdist\n",
" y = np.asarray([loaders_csiborg2[i].los_density[k, :] for i in range(len(loaders_csiborg2X))])\n",
" ylow, ymed, yhigh = np.percentile(y, [16, 50, 84], axis=0)\n",
" axs[0].fill_between(x, ylow, yhigh, color=cols[0], alpha=0.25)\n",
" axs[0].plot(x, ymed, color=cols[0], label=\"CSiBORG2\")\n",
"\n",
" y = np.asarray([loaders_csiborg2[i].los_radial_velocity[k, :] for i in range(len(loaders_csiborg2X))])\n",
" ylow, ymed, yhigh = np.percentile(y, [16, 50, 84], axis=0)\n",
" axs[1].fill_between(x, ylow, yhigh, color=cols[0], alpha=0.25)\n",
" axs[1].plot(x, ymed, color=cols[0], label=\"CSiBORG2\")\n",
"\n",
" # CSiBORG2X\n",
" x = loaders_csiborg2X[0].rdist\n",
" y = np.asarray([loaders_csiborg2X[i].los_density[k, :] for i in range(len(loaders_csiborg2X))])\n",
" ylow, ymed, yhigh = np.percentile(y, [16, 50, 84], axis=0)\n",
" axs[0].fill_between(x, ylow, yhigh, color=cols[1], alpha=0.25)\n",
" axs[0].plot(x, ymed, color=cols[1], label=\"CSiBORG2X\")\n",
"\n",
" y = np.asarray([loaders_csiborg2X[i].los_radial_velocity[k, :] for i in range(len(loaders_csiborg2X))])\n",
" ylow, ymed, yhigh = np.percentile(y, [16, 50, 84], axis=0)\n",
" axs[1].fill_between(x, ylow, yhigh, color=cols[1], alpha=0.25)\n",
" axs[1].plot(x, ymed, color=cols[1], label=\"CSiBORG2X\")\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-16 17:02:00 +00:00
" # Plot Carrick+2015\n",
2024-06-21 18:21:06 +00:00
" axs[0].plot(loader_carrick.rdist, loader_carrick.los_density[k, :], color=\"red\", label=\"Carrick+2015\")\n",
" axs[1].plot(loader_carrick.rdist, loader_carrick.los_radial_velocity[k, :] * 0.43, color=\"red\")\n",
2024-03-08 10:44:19 +00:00
"\n",
"\n",
2024-03-16 17:02:00 +00:00
" axs[1].set_xlabel(r\"$r ~ [\\mathrm{Mpc} / h]$\")\n",
" axs[0].set_ylabel(r\"$\\rho_{\\rm LOS} / \\langle \\rho_{\\rm matter} \\rangle$\")\n",
" axs[1].set_ylabel(r\"$v_{\\rm LOS} ~ [\\mathrm{km/s}]$\")\n",
" axs[0].set_yscale(\"log\")\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-16 17:02:00 +00:00
" axs[0].legend(loc=\"upper right\")\n",
" axs[0].set_xlim(0, 200)\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-16 17:02:00 +00:00
" fig.tight_layout(w_pad=0, h_pad=0)\n",
2024-06-21 18:21:06 +00:00
" fig.savefig(f\"../../plots/LOSS_los_{k}.png\", dpi=500, bbox_inches=\"tight\")\n",
2024-03-16 17:02:00 +00:00
"\n",
" fig.show()"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Test running a model"
]
},
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": 91,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-06-21 18:21:06 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2024-06-21 18:08:51.114971: reading the catalogue,\n",
"2024-06-21 18:08:51.122661: reading the interpolated field,\n",
"2024-06-21 18:08:51.182633: calculating the radial velocity.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/mnt/users/rstiskalek/csiborgtools/csiborgtools/flow/flow_model.py:91: UserWarning: The number of radial steps is even. Skipping the first step at 0.0 because Simpson's rule requires an odd number of steps.\n",
" warn(f\"The number of radial steps is even. Skipping the first \"\n"
]
}
],
2024-03-08 10:44:19 +00:00
"source": [
2024-04-23 11:02:09 +00:00
"fpath_data = \"/mnt/extraspace/rstiskalek/catalogs/PV_compilation.hdf5\"\n",
2024-03-16 17:02:00 +00:00
"# fpath_data = \"/mnt/extraspace/rstiskalek/catalogs/A2.h5\"\n",
2024-04-23 11:02:09 +00:00
"# fpath_data = \"/mnt/extraspace/rstiskalek/catalogs/PV_mock_CB2_17417_large.hdf5\"\n",
2024-03-16 17:02:00 +00:00
"\n",
2024-06-20 13:33:00 +00:00
"simname = \"Carrick2015\"\n",
2024-06-21 18:21:06 +00:00
"catalogue = \"2MTF\"\n",
2024-06-20 13:33:00 +00:00
"loader = csiborgtools.flow.DataLoader(simname, 0, catalogue, fpath_data, paths, ksmooth=0)\n",
"get_model_kwargs = {\"zcmb_max\": 0.05}"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2024-03-21 15:50:37 +00:00
"#### Running HMC"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": 104,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-06-21 18:21:06 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Selected 1248/1248 galaxies.\n"
]
}
],
2024-03-08 10:44:19 +00:00
"source": [
2024-03-26 09:42:53 +00:00
"model = csiborgtools.flow.get_model(loader, **get_model_kwargs)\n",
2024-06-21 18:21:06 +00:00
"model_kwargs = {\"sample_alpha\": True, \"sample_beta\": True}"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": 105,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-06-21 18:21:06 +00:00
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"sample: 100%|██████████| 750/750 [03:34<00:00, 3.50it/s, 7 steps of size 5.63e-01. acc. prob=0.88] \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" mean std median 5.0% 95.0% n_eff r_hat\n",
" Vext_x -107.14 16.03 -107.20 -132.71 -81.92 985.54 1.00\n",
" Vext_y -103.76 18.57 -103.98 -134.73 -73.43 686.42 1.01\n",
" Vext_z -114.33 17.71 -113.60 -143.50 -86.52 489.79 1.00\n",
" a -22.28 0.02 -22.28 -22.31 -22.25 647.90 1.00\n",
" alpha 1.53 0.08 1.53 1.39 1.66 872.66 1.00\n",
" b -6.28 0.09 -6.27 -6.41 -6.12 799.07 1.00\n",
" beta 0.40 0.03 0.41 0.36 0.44 718.68 1.00\n",
" e_mu_intrinsic 0.41 0.01 0.41 0.39 0.42 594.15 1.00\n",
" sigma_v 115.92 11.15 115.45 98.05 133.76 732.54 1.00\n",
"\n",
"Number of divergences: 0\n"
]
}
],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"kernel = NUTS(model, init_strategy=init_to_median(num_samples=100))\n",
2024-03-22 17:10:40 +00:00
"mcmc = MCMC(kernel, num_warmup=250, num_samples=500)\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-06-21 18:21:06 +00:00
"rng_key = jax.random.PRNGKey(5)\n",
"mcmc.run(rng_key, **model_kwargs)\n",
"mcmc.print_summary()\n",
"samples = mcmc.get_samples()"
2024-03-16 17:02:00 +00:00
]
},
{
2024-03-21 15:50:37 +00:00
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": 88,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-06-20 13:33:00 +00:00
"outputs": [],
2024-03-16 17:02:00 +00:00
"source": [
2024-06-21 18:21:06 +00:00
"ndata = 1248\n",
"from jax import numpy as jnp\n",
"from jax import devices\n",
"\n",
"ndevices = 2\n",
"indxs = jnp.arange(ndata).reshape(ndevices, -1)"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": 90,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-06-21 18:21:06 +00:00
"outputs": [
{
"data": {
"text/plain": [
"Array([[ 0, 1, 2, ..., 621, 622, 623],\n",
" [ 624, 625, 626, ..., 1245, 1246, 1247]], dtype=int32)"
]
},
"execution_count": 90,
"metadata": {},
"output_type": "execute_result"
}
],
2024-03-16 17:02:00 +00:00
"source": [
2024-06-21 18:21:06 +00:00
"indxs"
2024-03-26 09:42:53 +00:00
]
},
{
"cell_type": "code",
2024-06-20 13:33:00 +00:00
"execution_count": null,
2024-04-23 11:02:09 +00:00
"metadata": {},
"outputs": [],
2024-06-21 18:21:06 +00:00
"source": []
},
{
"cell_type": "code",
"execution_count": 79,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"|V| = 189.18643188476562 +- 18.434009552001953\n",
"l = 328.73439952474195 +- 6.045875008151092\n",
"b = 19.147533871849525 +- 5.45638871095807\n",
"beta = 0.40421125292778015 +- 0.02472345344722271\n"
]
}
],
2024-03-08 10:44:19 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"Vmag = np.sqrt(samples[\"Vext_x\"]**2 + samples[\"Vext_y\"]**2 + samples[\"Vext_z\"]**2)\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-21 15:50:37 +00:00
"V = np.vstack([samples[\"Vext_x\"], samples[\"Vext_y\"], samples[\"Vext_z\"]]).T\n",
"V = csiborgtools.cartesian_to_radec(V)\n",
"\n",
"l, b = csiborgtools.flow.radec_to_galactic(V[:, 1], V[:, 2])\n",
"\n",
"print(f\"|V| = {np.mean(Vmag)} +- {np.std(Vmag)}\")\n",
"print(f\"l = {np.mean(l)} +- {np.std(l)}\")\n",
"print(f\"b = {np.mean(b)} +- {np.std(b)}\")\n",
2024-03-26 09:42:53 +00:00
"if \"beta\" in samples:\n",
" print(f\"beta = {np.mean(samples['beta'])} +- {np.std(samples['beta'])}\")"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": 81,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-06-21 18:21:06 +00:00
"outputs": [
{
"data": {
"text/plain": [
"[CpuDevice(id=0)]"
]
},
"execution_count": 81,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"jax.devices()"
]
},
{
"cell_type": "code",
"execution_count": 80,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "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
"text/plain": [
"<Figure size 1180x1180 with 25 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-26 09:42:53 +00:00
"data = [l, b, Vmag]\n",
"labels = [r\"$l$\", r\"$b$\", r\"$|\\bf{V}_{\\rm ext}|$\"]\n",
2024-03-21 15:50:37 +00:00
"if \"alpha\" in samples:\n",
2024-03-26 09:42:53 +00:00
" data.append(samples[\"alpha\"])\n",
" labels.append(r\"$\\alpha$\")\n",
"\n",
"if \"beta\" in samples:\n",
" data.append(samples[\"beta\"])\n",
" labels.append(r\"$\\beta$\")\n",
2024-03-21 15:50:37 +00:00
"\n",
2024-04-01 22:19:14 +00:00
"if \"h\" in samples:\n",
" data.append(samples[\"h\"])\n",
" labels.append(r\"$h$\")\n",
"\n",
2024-03-26 09:42:53 +00:00
"data = np.vstack(data).T\n",
2024-04-01 22:19:14 +00:00
"fig = corner.corner(data, labels=labels, show_titles=True, title_fmt=\".3f\", title_kwargs={\"fontsize\": 12}, smooth=1)\n",
2024-06-21 18:21:06 +00:00
"fig.savefig(f\"../../plots/mock_{simname}_{catalogue}.png\", dpi=500, bbox_inches=\"tight\")"
2024-03-16 17:02:00 +00:00
]
},
{
2024-03-21 15:50:37 +00:00
"cell_type": "markdown",
2024-03-16 17:02:00 +00:00
"metadata": {},
"source": [
2024-03-21 15:50:37 +00:00
"## Vizualize the results"
2024-03-08 10:44:19 +00:00
]
},
2024-03-16 17:02:00 +00:00
{
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": null,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-04-23 11:02:09 +00:00
"outputs": [],
2024-03-16 17:02:00 +00:00
"source": [
2024-04-23 11:02:09 +00:00
"data, names, gof = read_samples(\"Pantheon+_groups\", \"Carrick2015\", 0)\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-21 15:50:37 +00:00
"fig = corner.corner(data, labels=names_to_latex(names, True), show_titles=True,\n",
" title_fmt=\".3f\", title_kwargs={\"fontsize\": 12}, smooth=1)"
2024-03-08 10:44:19 +00:00
]
},
{
2024-03-21 15:50:37 +00:00
"cell_type": "markdown",
2024-03-16 17:02:00 +00:00
"metadata": {},
"source": [
2024-04-23 11:02:09 +00:00
"### $\\texttt{LOSS}$ comparison"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-03-21 15:50:37 +00:00
"execution_count": null,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-21 15:50:37 +00:00
"outputs": [],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"LOSS_Carrick_0 = read_samples(\"LOSS\", \"Carrick2015\", 0, return_MCsamples=True)\n",
"LOSS_Carrick_1 = read_samples(\"LOSS\", \"Carrick2015\", 1, return_MCsamples=True)\n",
"\n",
"LOSS_CB1_0 = read_samples(\"LOSS\", \"csiborg1\", 0, return_MCsamples=True)\n",
"LOSS_CB1_1 = read_samples(\"LOSS\", \"csiborg1\", 1, return_MCsamples=True)\n",
"\n",
"LOSS_CB2_0 = read_samples(\"LOSS\", \"csiborg2_main\", 0, return_MCsamples=True)\n",
"LOSS_CB2_1 = read_samples(\"LOSS\", \"csiborg2_main\", 1, return_MCsamples=True)"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-03-21 15:50:37 +00:00
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"X = [\n",
" LOSS_Carrick_0,\n",
" # LOSS_Carrick_1,\n",
" # LOSS_CB1_0,\n",
" LOSS_CB1_1,\n",
" LOSS_CB2_0,\n",
" LOSS_CB2_1,\n",
" ]\n",
"\n",
"# params = [\"l\", \"b\", \"Vmag\", \"beta\"]\n",
"params = None\n",
"\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, params=params, filled=True, legend_loc='upper right', )\n",
"g.export(f\"../plots/LOSS_comparison.png\", dpi=500,)\n"
]
},
{
"cell_type": "markdown",
2024-03-16 17:02:00 +00:00
"metadata": {},
"source": [
2024-04-23 11:02:09 +00:00
"### $\\texttt{Foundation}$ comparison"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-03-21 15:50:37 +00:00
"execution_count": null,
2024-03-08 10:44:19 +00:00
"metadata": {},
"outputs": [],
"source": [
2024-03-21 15:50:37 +00:00
"FOUNDATION_Carrick_0 = read_samples(\"Foundation\", \"Carrick2015\", 0, return_MCsamples=True)\n",
"FOUNDATION_Carrick_1 = read_samples(\"Foundation\", \"Carrick2015\", 1, return_MCsamples=True)\n",
2024-03-16 17:02:00 +00:00
"\n",
2024-03-21 15:50:37 +00:00
"FOUNDATION_CB1_0 = read_samples(\"Foundation\", \"csiborg1\", 0, return_MCsamples=True)\n",
"FOUNDATION_CB1_1 = read_samples(\"Foundation\", \"csiborg1\", 1, return_MCsamples=True)\n",
"\n",
"FOUNDATION_CB2_0 = read_samples(\"Foundation\", \"csiborg2_main\", 0, return_MCsamples=True)\n",
"FOUNDATION_CB2_1 = read_samples(\"Foundation\", \"csiborg2_main\", 1, return_MCsamples=True)"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-03-21 15:50:37 +00:00
"execution_count": null,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-21 15:50:37 +00:00
"outputs": [],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"X = [\n",
" FOUNDATION_Carrick_0,\n",
" # FOUNDATION_Carrick_1,\n",
" # FOUNDATION_CB1_0,\n",
" FOUNDATION_CB1_1,\n",
" FOUNDATION_CB2_0,\n",
" FOUNDATION_CB2_1,\n",
" ]\n",
"\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, filled=True, legend_loc='upper right')\n",
"g.export(f\"../plots/FOUNDATION_comparison.png\", dpi=500,)"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2024-04-23 11:02:09 +00:00
"### $\\texttt{Pantheon+}$ comparison"
]
},
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": null,
2024-04-23 11:02:09 +00:00
"metadata": {},
2024-06-21 18:21:06 +00:00
"outputs": [],
2024-04-23 11:02:09 +00:00
"source": [
2024-06-20 13:33:00 +00:00
"PANTHEONP_Carrick_0 = read_samples(\"Pantheon+\", \"Carrick2015\", 0, return_MCsamples=True)\n",
"PANTHEONP_Carrick_1 = read_samples(\"Pantheon+\", \"Carrick2015\", 1, return_MCsamples=True)\n",
2024-04-23 11:02:09 +00:00
"\n",
"# PANTHEONP_CB1_0 = read_samples(\"Pantheon+\", \"csiborg1\", 0, return_MCsamples=True)\n",
"# PANTHEONP_CB1_1 = read_samples(\"Pantheon+\", \"csiborg1\", 1, return_MCsamples=True)\n",
"\n",
"PANTHEONP_CB2_0 = read_samples(\"Pantheon+\", \"csiborg2_main\", 0, return_MCsamples=True)\n",
"PANTHEONP_CB2_1 = read_samples(\"Pantheon+\", \"csiborg2_main\", 1, return_MCsamples=True)\n"
]
},
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": null,
2024-04-23 11:02:09 +00:00
"metadata": {},
2024-06-21 18:21:06 +00:00
"outputs": [],
2024-04-23 11:02:09 +00:00
"source": [
"X = [\n",
2024-06-20 13:33:00 +00:00
" PANTHEONP_Carrick_0,\n",
2024-04-23 11:02:09 +00:00
" # PANTHEONP_Carrick_1,\n",
" # PANTHEONP_CB1_0,\n",
" # PANTHEONP_CB1_1,\n",
" PANTHEONP_CB2_0,\n",
" PANTHEONP_CB2_1,\n",
" ]\n",
"\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, filled=True, legend_loc='upper right')\n",
"# g.export(f\"../plots/PANTHEONP_comparison.png\", dpi=500,)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### $\\texttt{Pantheon+}$ groups"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": null,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-06-21 18:21:06 +00:00
"outputs": [],
2024-03-08 10:44:19 +00:00
"source": [
2024-06-20 13:33:00 +00:00
"LG = -1\n",
2024-03-16 17:02:00 +00:00
"\n",
2024-04-23 11:02:09 +00:00
"PANTHEONP_Carrick = read_samples(\"Pantheon+\", \"Carrick2015\", 0, return_MCsamples=True, subtract_LG_velocity=LG, )\n",
"PANTHEONP_Carrick_Groups = read_samples(\"Pantheon+_groups\", \"Carrick2015\", 0, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"PANTHEONP_Carrick_Groups_zSN = read_samples(\"Pantheon+_groups_zSN\", \"Carrick2015\", 0, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"PANTHEONP_Carrick_zSN = read_samples(\"Pantheon+_zSN\", \"Carrick2015\", 0, return_MCsamples=True, subtract_LG_velocity=LG)\n",
2024-03-16 17:02:00 +00:00
"\n",
2024-04-23 11:02:09 +00:00
"# ksmooth = 1\n",
"# PANTHEONP_CB2 = read_samples(\"Pantheon+\", \"csiborg2_main\", ksmooth, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"# PANTHEONP_CB2_Groups = read_samples(\"Pantheon+_groups\", \"csiborg2_main\", ksmooth, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"# PANTHEONP_CB2_Groups_zSN = read_samples(\"Pantheon+_groups_zSN\", \"csiborg2_main\", ksmooth, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"\n",
"\n"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "code",
2024-06-21 18:21:06 +00:00
"execution_count": null,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-06-21 18:21:06 +00:00
"outputs": [],
2024-03-16 17:02:00 +00:00
"source": [
2024-04-23 11:02:09 +00:00
"params = [\"Vmag\", \"l\", \"b\"]\n",
"CMB = MCSamples(samples=multivariate_normal([627, 276, 30], [22, 3, 3]).rvs(size=20000),\n",
" names=params, labels=names_to_latex(params, True), label=\"CMB\")\n",
"\n",
"\n",
2024-03-21 15:50:37 +00:00
"X = [\n",
2024-04-23 11:02:09 +00:00
" PANTHEONP_Carrick,\n",
2024-06-20 13:33:00 +00:00
" # PANTHEONP_Carrick_Groups,\n",
2024-04-23 11:02:09 +00:00
" # PANTHEONP_Carrick_Groups_zSN,\n",
" PANTHEONP_Carrick_zSN,\n",
" # PANTHEONP_CB2,\n",
" # PANTHEONP_CB2_Groups,\n",
" # PANTHEONP_CB2_Groups_zSN,\n",
2024-06-20 13:33:00 +00:00
" # CMB,\n",
2024-03-21 15:50:37 +00:00
" ]\n",
"\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, filled=True, legend_loc='upper right')\n",
2024-04-23 11:02:09 +00:00
"g.export(f\"../../plots/PANTHEON_GROUPS_Carrick_comparison_LG.png\", dpi=500,)"
2024-03-16 17:02:00 +00:00
]
},
{
2024-03-21 15:50:37 +00:00
"cell_type": "markdown",
2024-03-16 17:02:00 +00:00
"metadata": {},
"source": [
2024-04-23 11:02:09 +00:00
"### $\\texttt{2MTF}$ comparison"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-03-21 15:50:37 +00:00
"execution_count": null,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-21 15:50:37 +00:00
"outputs": [],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"TWOMTF_Carrick_0 = read_samples(\"2MTF\", \"Carrick2015\", 0, return_MCsamples=True)\n",
"TWOMTF_Carrick_1 = read_samples(\"2MTF\", \"Carrick2015\", 1, return_MCsamples=True)\n",
"\n",
"TWOMTF_CB1_0 = read_samples(\"2MTF\", \"csiborg1\", 0, return_MCsamples=True)\n",
"TWOMTF_CB1_1 = read_samples(\"2MTF\", \"csiborg1\", 1, return_MCsamples=True)\n",
"\n",
"TWOMTF_CB2_0 = read_samples(\"2MTF\", \"csiborg2_main\", 0, return_MCsamples=True)\n",
"TWOMTF_CB2_1 = read_samples(\"2MTF\", \"csiborg2_main\", 1, return_MCsamples=True)\n"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-03-21 15:50:37 +00:00
"execution_count": null,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-21 15:50:37 +00:00
"outputs": [],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"X = [\n",
" TWOMTF_Carrick_0,\n",
" # TWOMTF_Carrick_1,\n",
" # TWOMTF_CB1_0,\n",
" TWOMTF_CB1_1,\n",
" TWOMTF_CB2_0,\n",
" TWOMTF_CB2_1,\n",
" ]\n",
"\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, filled=True, legend_loc='upper right')\n",
"g.export(f\"../plots/2MTF_comparison.png\", dpi=500,)"
2024-03-16 17:02:00 +00:00
]
},
{
2024-03-21 15:50:37 +00:00
"cell_type": "markdown",
2024-03-08 10:44:19 +00:00
"metadata": {},
"source": [
2024-04-23 11:02:09 +00:00
"### $\\texttt{SFI++ galaxies}$ comparison"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": null,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-04-23 11:02:09 +00:00
"outputs": [],
2024-03-08 10:44:19 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"SFIGAL_Carrick_0 = read_samples(\"SFI_gals\", \"Carrick2015\", 0, return_MCsamples=True)\n",
"SFIGAL_Carrick_1 = read_samples(\"SFI_gals\", \"Carrick2015\", 1, return_MCsamples=True)\n",
"\n",
"# SFIGAL_CB1_0 = read_samples(\"SFI_gals\", \"csiborg1\", 0, return_MCsamples=True)\n",
"# SFIGAL_CB1_1 = read_samples(\"SFI_gals\", \"csiborg1\", 1, return_MCsamples=True)\n",
"\n",
"SFIGAL_CB2_0 = read_samples(\"SFI_gals\", \"csiborg2_main\", 0, return_MCsamples=True)\n",
"SFIGAL_CB2_1 = read_samples(\"SFI_gals\", \"csiborg2_main\", 1, return_MCsamples=True)"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2024-03-21 15:50:37 +00:00
"X = [\n",
" SFIGAL_Carrick_0,\n",
" # SFIGAL_Carrick_1,\n",
" # SFIGAL_CB1_0,\n",
" # SFIGAL_CB1_1,\n",
" # SFIGAL_CB2_0,\n",
" SFIGAL_CB2_1,\n",
" ]\n",
2024-03-16 17:02:00 +00:00
"\n",
2024-03-21 15:50:37 +00:00
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, filled=True, legend_loc='upper right')\n",
"g.export(f\"../plots/SFI_gals_comparison.png\", dpi=500,)"
2024-03-08 10:44:19 +00:00
]
},
2024-03-26 14:11:04 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
2024-04-23 11:02:09 +00:00
"### $\\texttt{SFI++ groups}$ comparison"
2024-03-26 14:11:04 +00:00
]
},
{
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": null,
2024-03-26 14:11:04 +00:00
"metadata": {},
2024-04-23 11:02:09 +00:00
"outputs": [],
2024-03-26 14:11:04 +00:00
"source": [
"SFIGROUP_Carrick_0 = read_samples(\"SFI_groups\", \"Carrick2015\", 0, return_MCsamples=True)\n",
"SFIGROUP_Carrick_1 = read_samples(\"SFI_groups\", \"Carrick2015\", 1, return_MCsamples=True)\n",
"\n",
"SFIGROUP_CB2_0 = read_samples(\"SFI_groups\", \"csiborg2_main\", 0, return_MCsamples=True)\n",
"SFIGROUP_CB2_1 = read_samples(\"SFI_groups\", \"csiborg2_main\", 1, return_MCsamples=True)"
]
},
{
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": null,
2024-03-26 14:11:04 +00:00
"metadata": {},
2024-04-23 11:02:09 +00:00
"outputs": [],
2024-03-26 14:11:04 +00:00
"source": [
"X = [\n",
" SFIGROUP_Carrick_0,\n",
2024-04-08 22:14:43 +00:00
" SFIGAL_Carrick_0,\n",
2024-03-26 14:11:04 +00:00
" # SFIGROUP_Carrick_1,\n",
" # SFIGROUP_CB2_0,\n",
2024-04-08 22:14:43 +00:00
" # SFIGROUP_CB2_1,\n",
2024-03-26 14:11:04 +00:00
" ]\n",
"\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, filled=True, legend_loc='upper right')\n",
2024-04-08 22:14:43 +00:00
"g.export(f\"../plots/SFI_gals_vs_groups_comparison.png\", dpi=500,)"
2024-03-26 14:11:04 +00:00
]
},
2024-04-01 22:19:14 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
2024-04-23 11:02:09 +00:00
"### SN to TF comparison"
2024-04-01 22:19:14 +00:00
]
},
{
"cell_type": "code",
2024-06-20 13:33:00 +00:00
"execution_count": null,
2024-04-01 22:19:14 +00:00
"metadata": {},
2024-06-20 13:33:00 +00:00
"outputs": [],
2024-04-01 22:19:14 +00:00
"source": [
2024-04-23 11:02:09 +00:00
"LG = 0\n",
2024-04-02 08:28:57 +00:00
"\n",
2024-04-23 11:02:09 +00:00
"# PANTHEONP_Carrick = read_samples(\"Pantheon+\", \"Carrick2015\", 0, return_MCsamples=True, subtract_LG_velocity=LG, )\n",
"# PANTHEONP_Groups_Carrick = read_samples(\"Pantheon+_groups\", \"Carrick2015\", 0, return_MCsamples=True, subtract_LG_velocity=LG, )\n",
"# TWOMTF_Carrick = read_samples(\"2MTF\", \"Carrick2015\", 0, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"# SFIGAL_Carrick = read_samples(\"SFI_gals\", \"Carrick2015\", 0, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"\n",
"k = 1\n",
"PANTHEONP_CB2 = read_samples(\"Pantheon+\", \"csiborg2_main\", k, return_MCsamples=True, subtract_LG_velocity=LG, )\n",
"PANTHEONP_Groups_CB2 = read_samples(\"Pantheon+_groups\", \"csiborg2_main\", k, return_MCsamples=True, subtract_LG_velocity=LG, )\n",
"TWOMTF_CB2 = read_samples(\"2MTF\", \"csiborg2_main\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"SFIGAL_CB2 = read_samples(\"SFI_gals\", \"csiborg2_main\", k, return_MCsamples=True, subtract_LG_velocity=LG)"
2024-04-01 22:19:14 +00:00
]
},
{
"cell_type": "code",
2024-06-20 13:33:00 +00:00
"execution_count": null,
2024-04-01 22:19:14 +00:00
"metadata": {},
2024-06-20 13:33:00 +00:00
"outputs": [],
2024-04-23 11:02:09 +00:00
"source": [
"\n",
"params = [\"Vmag\", \"l\", \"b\"]\n",
"CMB = MCSamples(samples=multivariate_normal([627, 276, 30], [22, 3, 3]).rvs(size=20000),\n",
" names=params, labels=names_to_latex(params, True), label=\"CMB\")\n",
"\n",
"\n",
"X = [\n",
" # PANTHEONP_Carrick,\n",
" # PANTHEONP_Groups_Carrick,\n",
" # TWOMTF_Carrick,\n",
" # SFIGAL_Carrick,\n",
" PANTHEONP_CB2,\n",
" PANTHEONP_Groups_CB2,\n",
" TWOMTF_CB2,\n",
" SFIGAL_CB2,\n",
" CMB,\n",
" ]\n",
"\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, filled=True, legend_loc='upper right')\n",
"# g.export(f\"../../plots/SN_TF_CB2_consistency.png\", dpi=500,)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Mock $\\texttt{CB2}$ comparison"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"SMALLMOCK_CB2_0 = read_samples(\"CB2_small\", \"csiborg2_main\", 0, return_MCsamples=True)\n",
"SMALLMOCK_CB2_1 = read_samples(\"CB2_small\", \"csiborg2_main\", 1, return_MCsamples=True)\n",
"\n",
"LARGEMOCK_CB2_0 = read_samples(\"CB2_large\", \"csiborg2_main\", 0, return_MCsamples=True)\n",
"LARGEMOCK_CB2_1 = read_samples(\"CB2_large\", \"csiborg2_main\", 1, return_MCsamples=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
2024-04-01 22:19:14 +00:00
"source": [
"X = [\n",
2024-04-02 08:28:57 +00:00
" # SMALLMOCK_CB2_0,\n",
" # SMALLMOCK_CB2_1,\n",
" LARGEMOCK_CB2_0,\n",
" LARGEMOCK_CB2_1,\n",
2024-04-01 22:19:14 +00:00
" ]\n",
"\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, filled=True, legend_loc='upper right')\n",
2024-04-02 08:28:57 +00:00
"g.export(f\"../plots/CB2_mocks_large.png\", dpi=500,)"
2024-04-01 22:19:14 +00:00
]
},
2024-03-08 10:44:19 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
2024-04-23 11:02:09 +00:00
"## External flow consistency"
2024-03-16 17:02:00 +00:00
]
},
{
2024-03-21 15:50:37 +00:00
"cell_type": "markdown",
2024-03-16 17:02:00 +00:00
"metadata": {},
"source": [
2024-03-21 15:50:37 +00:00
"#### Carrick2015"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "code",
2024-03-21 15:50:37 +00:00
"execution_count": null,
2024-03-08 10:44:19 +00:00
"metadata": {},
"outputs": [],
"source": [
2024-03-21 15:50:37 +00:00
"X = [\n",
" # LOSS_Carrick_0,\n",
" # FOUNDATION_Carrick_0,\n",
" PANTHEONP_Carrick_0,\n",
" TWOMTF_Carrick_0,\n",
" SFIGAL_Carrick_0,\n",
" ]\n",
2024-03-16 17:02:00 +00:00
"\n",
2024-03-21 15:50:37 +00:00
"params = [\"Vmag\", \"l\", \"b\", \"beta\"]\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, params=params, filled=True, legend_loc='upper right',)\n",
"g.export(f\"../plots/Carrick2015_external_flow.png\", dpi=500,)"
2024-03-16 17:02:00 +00:00
]
},
{
2024-03-21 15:50:37 +00:00
"cell_type": "markdown",
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"#### CSiBORG1"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-03-21 15:50:37 +00:00
"execution_count": null,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-21 15:50:37 +00:00
"outputs": [],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"X = [\n",
" # LOSS_CB1_1,\n",
" # FOUNDATION_CB1_1,\n",
" PANTHEONP_CB1_1,\n",
" TWOMTF_CB1_1,\n",
" # SFIGAL_CB1_1,\n",
" ]\n",
"\n",
"params = [\"Vmag\", \"l\", \"b\", \"beta\"]\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, params=params, filled=True, legend_loc='upper right',)\n",
"g.export(f\"../plots/CB1_external_flow.png\", dpi=500,)"
2024-03-16 17:02:00 +00:00
]
},
{
2024-03-21 15:50:37 +00:00
"cell_type": "markdown",
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-08 10:44:19 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"#### CSiBORG2"
2024-03-08 10:44:19 +00:00
]
},
2024-03-16 17:02:00 +00:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
2024-03-21 15:50:37 +00:00
"source": [
"X = [\n",
" # LOSS_CB2_1,\n",
" # FOUNDATION_CB2_1,\n",
" PANTHEONP_CB2_1,\n",
" TWOMTF_CB2_1,\n",
" SFIGAL_CB2_1,\n",
" ]\n",
"\n",
"params = [\"Vmag\", \"l\", \"b\", \"beta\"]\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
"g.triangle_plot(X, params=params, filled=True, legend_loc='upper right',)\n",
"g.export(f\"../plots/CB2_external_flow.png\", dpi=500,)"
]
2024-03-16 17:02:00 +00:00
},
{
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": null,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-04-23 11:02:09 +00:00
"outputs": [],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-26 09:42:53 +00:00
"k = 1\n",
2024-03-21 15:50:37 +00:00
"LG = 0\n",
2024-03-26 09:42:53 +00:00
"\n",
"# Carrick\n",
"# LOSS_Carrick_LG = read_samples(\"LOSS\", \"Carrick2015\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"# FOUNDATION_Carrick_LG = read_samples(\"Foundation\", \"Carrick2015\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
2024-03-26 14:11:04 +00:00
"# PANTHEON_Carrick_LG = read_samples(\"Pantheon+\", \"Carrick2015\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
2024-03-26 09:42:53 +00:00
"# TWOMTF_Carrick_LG = read_samples(\"2MTF\", \"Carrick2015\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
2024-03-26 14:11:04 +00:00
"SFIGAL_Carrick_LG = read_samples(\"SFI_gals\", \"Carrick2015\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"SFIGROUPS_Carrick_LG = read_samples(\"SFI_groups\", \"Carrick2015\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
2024-03-26 09:42:53 +00:00
"\n",
"\n",
"# # CSiBORG2\n",
"# LOSS_CB2_LG = read_samples(\"LOSS\", \"csiborg2_main\", k, return_MCsamples=True,subtract_LG_velocity=LG)\n",
"# FOUNDATION_CB2_LG = read_samples(\"Foundation\", \"csiborg2_main\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"# PANTHEON_CB2_LG = read_samples(\"Pantheon+\", \"csiborg2_main\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"# TWOMTF_CB2_LG = read_samples(\"2MTF\", \"csiborg2_main\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
2024-03-26 14:11:04 +00:00
"SFIGAL_CB2_LG = read_samples(\"SFI_gals\", \"csiborg2_main\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"SFIGROUP_CB2_LG = read_samples(\"SFI_groups\", \"csiborg2_main\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
2024-03-26 09:42:53 +00:00
"\n",
"# # CSiBORG1\n",
2024-03-26 14:11:04 +00:00
"# LOSS_CB1_LG = read_samples(\"LOSS\", \"csiborg1\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"# FOUNDATION_CB1_LG = read_samples(\"Foundation\", \"csiborg1\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"# PANTHEON_CB1_LG = read_samples(\"Pantheon+\", \"csiborg1\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"# TWOMTF_CB1_LG = read_samples(\"2MTF\", \"csiborg1\", k, return_MCsamples=True, subtract_LG_velocity=LG)\n",
"# SFIGAL_CB1_LG = read_samples(\"SFI_gals\", \"csiborg1\", k, return_MCsamples=True, subtract_LG_velocity=LG)"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": null,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-04-23 11:02:09 +00:00
"outputs": [],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"params = [\"Vmag\", \"l\", \"b\"]\n",
"CMB = MCSamples(samples=multivariate_normal([627, 276, 30], [22, 3, 3]).rvs(size=20000),\n",
" names=params, labels=names_to_latex(params, True), label=\"CMB\")\n",
"\n",
"X = [\n",
2024-03-26 09:42:53 +00:00
" # LOSS_Carrick_LG,\n",
" # FOUNDATION_Carrick_LG,\n",
2024-03-26 14:11:04 +00:00
" # PANTHEON_Carrick_LG,\n",
2024-03-26 09:42:53 +00:00
" # TWOMTF_Carrick_LG,\n",
" # SFIGAL_Carrick_LG,\n",
2024-03-26 14:11:04 +00:00
" # SFIGROUPS_Carrick_LG,\n",
2024-03-21 15:50:37 +00:00
" # LOSS_CB1_LG,\n",
2024-03-26 09:42:53 +00:00
" # FOUNDATION_CB1_LG,\n",
2024-03-26 14:11:04 +00:00
" # PANTHEON_CB1_LG,\n",
2024-03-26 09:42:53 +00:00
" # TWOMTF_CB1_LG,\n",
" # SFIGAL_CB1_LG,\n",
2024-03-21 15:50:37 +00:00
" # LOSS_CB2_LG,\n",
" # FOUNDATION_CB2_LG,\n",
2024-03-26 14:11:04 +00:00
" # PANTHEON_CB2_LG,\n",
2024-03-21 15:50:37 +00:00
" # TWOMTF_CB2_LG,\n",
2024-03-26 14:11:04 +00:00
" SFIGAL_CB2_LG,\n",
" SFIGROUP_CB2_LG,\n",
2024-03-21 15:50:37 +00:00
" CMB,\n",
" ]\n",
"\n",
"g = plots.get_subplot_plotter()\n",
"g.settings.figure_legend_frame = False\n",
"g.settings.alpha_filled_add = 0.75\n",
"# g.settings.title_limit_fontsize = 14\n",
2024-03-26 09:42:53 +00:00
"g.triangle_plot(X, params=params, filled=True, legend_loc='upper right', )\n",
2024-03-26 14:11:04 +00:00
"# g.export(f\"../plots/ALL_dipole.png\", dpi=500,)"
2024-03-16 17:02:00 +00:00
]
},
2024-03-08 10:44:19 +00:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "venv_csiborg",
"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",
2024-06-20 13:33:00 +00:00
"version": "3.11.4"
2024-03-08 10:44:19 +00:00
}
},
"nbformat": 4,
"nbformat_minor": 2
}