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-04-23 11:02:09 +00:00
"execution_count": 3,
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-03-21 15:50:37 +00:00
"execution_count": null,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-03-21 15:50:37 +00:00
"outputs": [],
2024-03-08 10:44:19 +00:00
"source": [
2024-03-16 17:02:00 +00:00
"# fpath = \"/mnt/extraspace/rstiskalek/catalogs/A2.h5\"\n",
"fpath = \"/mnt/extraspace/rstiskalek/catalogs/PV_compilation_Supranta2019.hdf5\"\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-16 17:02:00 +00:00
"loader_carrick = csiborgtools.flow.DataLoader(\"Carrick2015\", \"LOSS\", fpath, paths, ksmooth=0)\n",
"loader_csiborg = csiborgtools.flow.DataLoader(\"csiborg1\", \"LOSS\", fpath, paths, ksmooth=0)\n",
"loader_csiborg2 = csiborgtools.flow.DataLoader(\"csiborg2_main\", \"LOSS\", fpath, paths, ksmooth=0)"
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": [
"# ks = [115, 53, 77, 105, 26, 61, 86, 29, 80, 21]\n",
2024-03-16 17:02:00 +00:00
"ks = [19, 8, 15, 0, 16, 6, 48, 38, 26, 44]\n",
"# ks = [19]\n",
"# ks = np.random.choice(50, 10, replace=False)\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-16 17:02:00 +00:00
"# k = 6\n",
"for k in []:\n",
" fig, axs = plt.subplots(2, 1, figsize=(7, 7), sharex=True)\n",
" # Get rid of vertical spacing\n",
" fig.subplots_adjust(wspace=0)\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-16 17:02:00 +00:00
" # Plot CSiBORG\n",
" for i in range(loader_csiborg.los_density.shape[1]):\n",
" axs[0].plot(loader_csiborg.rdist, loader_csiborg.los_density[k, i, :], alpha=0.1, color=\"black\")\n",
" axs[1].plot(loader_csiborg.rdist, loader_csiborg.los_radial_velocity[k, i, :], alpha=0.1, color=\"black\")\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-16 17:02:00 +00:00
" # CSiBORG1\n",
" axs[0].plot(loader_csiborg.rdist, loader_csiborg.los_density[k, :, :].mean(axis=0), color=\"red\", label=\"CSiBORG1\")\n",
" axs[1].plot(loader_csiborg.rdist, loader_csiborg.los_radial_velocity[k, :, :].mean(axis=0), color=\"red\")\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-16 17:02:00 +00:00
" # CSiBORG2\n",
" axs[0].plot(loader_csiborg2.rdist, loader_csiborg2.los_density[k, :, :].mean(axis=0), color=\"violet\", label=\"CSiBORG2\")\n",
" axs[1].plot(loader_csiborg2.rdist, loader_csiborg2.los_radial_velocity[k, :, :].mean(axis=0), color=\"violet\")\n",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-16 17:02:00 +00:00
" # Plot Carrick+2015\n",
" axs[0].plot(loader_carrick.rdist, loader_carrick.los_density[k, 0, :], color=\"blue\", label=\"Carrick+2015\")\n",
" axs[1].plot(loader_carrick.rdist, loader_carrick.los_radial_velocity[k, 0, :] * 0.43, color=\"blue\")\n",
2024-03-08 10:44:19 +00:00
"\n",
"\n",
2024-03-16 17:02:00 +00:00
" # for i in range(2):\n",
" # label = \"SN\"\n",
" # rdist = loader_csiborg.cat[\"r_hMpc\"][k]\n",
" # axs[i].axvline(rdist, color=\"violet\", linestyle=\"--\",\n",
" # zorder=0, label=label)\n",
2024-03-08 10:44:19 +00:00
"\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",
2024-03-08 10:44:19 +00:00
"\n",
2024-03-16 17:02:00 +00:00
" 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",
" fig.savefig(f\"../plots/LOSS_los_{k}.png\", dpi=500, bbox_inches=\"tight\")\n",
"\n",
" fig.show()"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Test running a model"
]
},
{
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": 89,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-03-22 17:10:40 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-04-23 11:02:09 +00:00
"10:16:51: reading the catalogue.\n",
"10:16:51: reading the interpolated field.\n",
"10:16:51: calculating the radial velocity.\n"
2024-03-22 17:10:40 +00:00
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
2024-04-23 11:02:09 +00:00
"/mnt/users/rstiskalek/csiborgtools/csiborgtools/flow/flow_model.py:94: 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",
2024-03-22 17:10:40 +00:00
" 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-04-01 22:19:14 +00:00
"simname = \"csiborg2_main\"\n",
2024-04-23 11:02:09 +00:00
"catalogue = \"Pantheon+_groups\"\n",
2024-04-01 22:19:14 +00:00
"loader = csiborgtools.flow.DataLoader(simname, 10, catalogue, fpath_data, paths, ksmooth=1)\n",
2024-03-22 17:10:40 +00:00
"get_model_kwargs = {\"zcmb_max\": 0.07}"
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-04-23 11:02:09 +00:00
"execution_count": 97,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-03-22 17:10:40 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-04-23 11:02:09 +00:00
"Selected 188/741 galaxies.\n"
2024-03-22 17:10:40 +00:00
]
}
],
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-04-23 11:02:09 +00:00
"model_kwargs = {\"sample_alpha\": True, \"sample_beta\": True}"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": 98,
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
"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-03-21 15:50:37 +00:00
"rng_key = jax.random.PRNGKey(5)"
2024-03-16 17:02:00 +00:00
]
},
{
2024-03-21 15:50:37 +00:00
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": 99,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-22 17:10:40 +00:00
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
2024-04-23 11:02:09 +00:00
"sample: 100%|██████████| 750/750 [00:32<00:00, 22.85it/s, 7 steps of size 4.86e-01. acc. prob=0.92] \n"
2024-03-22 17:10:40 +00:00
]
}
],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"mcmc.run(rng_key, **model_kwargs)"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": 101,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-22 17:10:40 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
2024-04-23 11:02:09 +00:00
" mean std median 5.0% 95.0% n_eff r_hat\n",
" Vext_x -7.07 28.15 -6.90 -51.51 40.12 431.62 1.00\n",
" Vext_y 11.58 27.69 12.30 -34.86 57.30 436.66 1.01\n",
" Vext_z -112.96 33.42 -113.19 -159.74 -54.83 422.45 1.00\n",
" alpha 2.70 0.54 2.66 1.82 3.51 530.76 1.00\n",
" alpha_cal 0.13 0.02 0.13 0.09 0.16 436.28 1.01\n",
" beta_cal 2.71 0.30 2.69 2.19 3.18 544.84 1.00\n",
" e_mu_intrinsic 0.14 0.02 0.14 0.10 0.17 635.61 1.00\n",
" mag_cal -18.50 0.03 -18.49 -18.55 -18.45 514.73 1.01\n",
" sigma_v 178.05 15.63 177.08 156.72 205.27 516.90 1.00\n",
2024-03-22 17:10:40 +00:00
"\n",
2024-04-01 22:19:14 +00:00
"Number of divergences: 0\n"
2024-03-22 17:10:40 +00:00
]
}
],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"mcmc.print_summary()\n",
"samples = mcmc.get_samples(group_by_chain=False)\n",
2024-04-01 22:19:14 +00:00
"# print(csiborgtools.numpyro_gof(model, mcmc, model_kwargs))"
2024-03-26 09:42:53 +00:00
]
},
{
"cell_type": "code",
2024-04-23 11:02:09 +00:00
"execution_count": 102,
"metadata": {},
"outputs": [],
"source": [
"# mean std median 5.0% 95.0% n_eff r_hat\n",
"# Vext_x 16.25 26.81 15.10 -23.17 65.77 523.48 1.00\n",
"# Vext_y 32.83 27.00 32.93 -13.96 75.47 322.45 1.01\n",
"# Vext_z -97.87 35.48 -97.78 -159.36 -42.14 422.92 1.00\n",
"# alpha 0.96 0.12 0.95 0.78 1.18 470.16 1.00\n",
"# alpha_cal 0.15 0.02 0.16 0.12 0.19 407.33 1.00\n",
"# beta_cal 2.80 0.23 2.80 2.39 3.14 481.54 1.00\n",
"# e_mu_intrinsic 0.13 0.02 0.13 0.10 0.17 511.25 1.00\n",
"# mag_cal -18.50 0.03 -18.50 -18.55 -18.45 390.57 1.01\n",
"# sigma_v 169.94 14.54 169.52 146.79 193.29 784.99 1.00\n"
]
},
{
"cell_type": "code",
"execution_count": 103,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-03-22 17:10:40 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-04-23 11:02:09 +00:00
"|V| = 120.92754364013672 +- 31.4892635345459\n",
"l = 294.0298299307121 +- 23.44887489204706\n",
"b = -23.89915683240672 +- 13.709079097191216\n"
2024-03-22 17:10:40 +00:00
]
}
],
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-04-23 11:02:09 +00:00
"execution_count": 104,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-22 17:10:40 +00:00
"outputs": [
{
"data": {
2024-04-23 11:02:09 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA58AAAO6CAYAAAAYcOP5AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3wU1f7/8femELJplKWT0EvoBBWQJlKk3AAinSgqShNRsHK9CiIRRBQVFBEUkC5cFRFQgQsICIIgRVgIPUgPLSQbUuf3B7/sl5i2gSwJm9fz8diHycyZmc/ALuadc+Yck2EYhgAAAAAAcCK3vC4AAAAAAOD6CJ8AAAAAAKcjfAIAAAAAnI7wCQAAAABwOsInAAAAAMDpCJ8AAAAAAKcjfAIAAAAAnI7wCQAAAABwOsInAAAAAMDpCJ8AAAAAAKcjfAJ5YPr06QoJCZGnp6fGjh2bbr+vr2+al5ubmz744IPbOtekSZMUGBgoPz8/NWzYUNevX5ckXbx4UZ07d5aPj49q1KihdevW5eYtAgAAAGkQPgEnefLJJzVnzpwM95UpU0Zjx47VY489luH+mJgY+ysiIkJubm7q3r17js/16aef6qefftKWLVsUHR2tuXPnqlChQpKk5557TqVLl9bFixf1/vvvq1evXrp8+fLt3SwAAACQDcKnC4qJiZGbm5umTJmS16UgE926dVOXLl1UpEiRbNsuXLhQTZs2VaVKlXJ0ruTkZIWHh2vmzJkKCgqSyWRSvXr15OXlpZiYGH3//fd6++23ZTab1aVLF9WtW1fLly/PhbsDAAAA0iN8uqC//vpLhmGobt26d+V6O3bs0PDhw1W7dm35+PgoKChIvXr1UkRERLq2O3fuVIcOHeTv7y8/Pz+1b99eu3fvTtduw4YNMplMGb62bduWa/XEx8frtddeU9myZeXt7a3GjRtrzZo1d3TO3DZv3jw98cQTOT7u77//ls1m07Jly1SqV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v//S7k4sWLKlGiRJq2e/bs0Q8//KCOHTva29psNkVGRspisdhnnXW0nh49emjy5Mn64osv9PLLL0u6Gdhmz56txo0bKzAwMFfuMSNlypTR2LFjtXDhwgz337rszJkzZxQUFKTu3btn2HbUqFGaOnWqvLy8tGPHDrVt29Ye0itWrKjNmzerfPny+uabbxQaGqoTJ07I19dXn376qX766Sdt2bJFgYGB2rdvX7rlZAAAAIDcwoRDLuTgwYMKDg7WkiVL1KtXr7t23RdffFEff/yxQkNDM7xu6iRCv/76q8aNG6f27durePHi2rZtm2bPnq127dppxYoVaWZ1ffjhh+Xt7a0HH3xQJUuW1IEDB/TFF1/I09NTW7duVXBwsCRpw4YNat26tcaMGWPvQXS0Hknq1auXvvvuO40cOVJVq1bV3LlztX37dq1bt04tW7bM8T3m1JAhQ1S6dOkMez9TTZ48WcuXL9emTZuyPd8ff/yhFi1a6Pfff1e9evXS7S9btqxWrFihBg0aKDAwUJs2bVKVKlVuq3YAAAAgRwy4jG+++caQZOzfv/+uXrdVq1aGpExfqY4cOWK0b9/esFgshpeXl1GzZk1jwoQJRnx8fLpzfvzxx8YDDzxgFCtWzPDw8DDKlCljhIWFGYcPH07Tbv369YYkY8yYMTmuxzAMIy4uznj55ZeN0qVLG15eXsb9999v/PTTT7d9jzk1ePDgNLVnpF69esYXX3yRZZuhQ4cahQsXNiQZnTp1MlJSUtK1iYiIMLy8vIyrV68aJ06cMAICAoyJEycaJUuWNKpXr57tNQAAAIA7Qc8nkIey6/ncu3evGjdurLNnz6pIkSJZnis5OVk
2024-03-22 17:10:40 +00:00
"text/plain": [
2024-04-23 11:02:09 +00:00
"<Figure size 970x970 with 16 Axes>"
2024-03-22 17:10:40 +00:00
]
},
"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-04-23 11:02:09 +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",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# PANTHEONP_Carrick_0 = read_samples(\"Pantheon+\", \"Carrick2015\", 0, return_MCsamples=True)\n",
"# PANTHEONP_Carrick_1 = read_samples(\"Pantheon+\", \"Carrick2015\", 1, return_MCsamples=True)\n",
"\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",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"X = [\n",
" # PANTHEONP_Carrick_0,\n",
" # 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-04-23 11:02:09 +00:00
"execution_count": 4,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-03-26 09:42:53 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
2024-04-23 11:02:09 +00:00
"Reading Pantheon+ fitted to Carrick2015 with ksmooth = 0.\n",
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n"
2024-03-26 09:42:53 +00:00
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-04-23 11:02:09 +00:00
"BIC = 9947.804688 +- 0.000000\n",
"AIC = 9902.613281 +- 0.000000\n",
"logZ = -4942.983398 +- 0.000000\n",
2024-03-26 09:42:53 +00:00
"chi2 = 0.000000 +- 0.000000\n",
"Removed no burn in\n",
"\n",
2024-04-23 11:02:09 +00:00
"Reading Pantheon+_groups fitted to Carrick2015 with ksmooth = 0.\n",
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n",
"BIC = 2574.760986 +- 0.000000\n",
"AIC = 2542.396484 +- 0.000000\n",
"logZ = -1258.320190 +- 0.000000\n",
"chi2 = 1.096741 +- 0.262201\n",
"Removed no burn in\n",
"\n",
"Reading Pantheon+_groups_zSN fitted to Carrick2015 with ksmooth = 0.\n",
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n",
"BIC = 2796.622070 +- 0.000000\n",
"AIC = 2764.257568 +- 0.000000\n",
"logZ = -1364.911255 +- 0.000000\n",
"chi2 = 1.072540 +- 0.119186\n",
"Removed no burn in\n",
"\n",
"Reading Pantheon+_zSN fitted to Carrick2015 with ksmooth = 0.\n",
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n",
"BIC = 10111.704102 +- 0.000000\n",
"AIC = 10066.512695 +- 0.000000\n",
"logZ = -5023.536621 +- 0.000000\n",
"chi2 = 1.089721 +- 0.062810\n",
2024-03-26 09:42:53 +00:00
"Removed no burn in\n"
]
}
],
2024-03-08 10:44:19 +00:00
"source": [
2024-04-23 11:02:09 +00:00
"LG = 0\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-04-23 11:02:09 +00:00
"execution_count": 7,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-26 09:42:53 +00:00
"outputs": [
2024-04-23 11:02:09 +00:00
{
"name": "stdout",
"output_type": "stream",
"text": [
"Removed no burn in\n"
]
},
2024-03-26 09:42:53 +00:00
{
"data": {
2024-04-23 11:02:09 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABKUAAASlCAYAAAB5vWpLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd5yU1d028OuePjtlp2zvsHSUZjAYLMgTRSyRaOwmgsQEifqSR42xRX0iiiS2iIkmFmIURB8jihqjPoiCHSkiveyyy/Y2Mzs7fe77/WOz4w67szt9duH6fj7zeZ17zn3OmaLvs1fO+R1BkiQJREREREREREREaSTL9ASIiIiIiIiIiOj4w1CKiIiIiIiIiIjSjqEUERERERERERGlHUMpIiIiIiIiIiJKO4ZSRERERERERESUdgyliIiIiIiIiIgo7RhKERERERERERFR2ikyPYF0E0UR9fX1MBgMEAQh09MhShlJktDZ2YmioiLIZMyfiYiIiIiIaGg57kKp+vp6lJaWZnoaRGlTW1uLkpKSTE+DiIiIiIiIKMxxF0oZDAYA3X+oG43GDM+GKHUcDgdKS0tDv3kiIiIiIiKioeS4C6V6tuwZjUaGUnRc4DZVIiIiIiIiGopYaIaIiIiIiIiIiNKOoRQREREREREREaUdQykiIiIiIiIiIko7hlJERERERERERJR2x12hcyIiIiIiohpnO1o9zpSOkaPRo0xvSekYRETDGUMpIiIiIiI6rtQ42zF2zd3wBAMpHUcjV2DvZb8fssFURUUFHnvsMcybNy/TUzlmvfzyy/jnP/+JV155JWl9nn322fjNb36DH/7wh1Hfw++ahipu3yMiIiIiouNKq8eZ8kAKADzBQEyrsWbNmgW1Wg29Xg+LxYJZs2bh66+/TspcKioqsHbt2qT0NdRs2rQJc+fOhdlshslkwuTJk7F8+XL4fL6Y+lmxYgW+973vQa1W9xvezJ8/HyqVCnq9PvT47LPPIvYniiLuuOMO3H333aFrs2bNwmOPPTbgezn33HNhsVhgNBoxZswY3Hjjjaiurg61ufPOO3HrrbfG9N5Sadu2bbjuuutw9tln47//+79xzz334G9/+1umpxXidrsxatQomEymsOsHDx4M/W6Ki4uxfPnymO6/8cYbUVpaCqPRiOLiYixZsmTA35zf78cNN9wAs9kMi8WCG2+8EYFA6v87NNQxlCIiIiIiIhoiHnroITidTtTX12Pq1Km48MILMz2llNuwYQNmzZoV171vvfUW5s6dizlz5mD//v2w2WxYs2YNdu3ahYaGhpjGKioqwl133YXrrrsu4niLFy+G0+kMPU455ZSIbd955x1YLBaceOKJUb2XdevWYe7cuTj77LOxZ88eOBwOfPTRRxg5ciQ+/PDDULvTTz8dNpsNn3zySVT9ptJ7772HxsZGPProo1iwYAEaGhrw8ccf45prrsn01EJ+97vfoby8POxaMBjEj370I0ybNg3Nzc1Yv349VqxYgVWrVkV1P9D9W+j5nrZv347t27dHDLYA4P7778emTZuwa9c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x1AqBQKNDej835cgetxh13d11GNjQ+TCZ5lWXV2NjRs3Yvv27f0uuSQiIiIiovRzOp2QJAl5eXmQyWR455138N5778XUR35+Pg4ePBhV24KCAsybNw833HBDKJxobGzE66+/DqB7u9yZZ56JW265BV1dXaipqcHSpUtTcuLavffeG/G0PEEQ8MQTT2DZsmV44okn0NbWBqA7KFm4cCEOHz4c01g9q6gCgQBEUYTH4wlbnfPKK6/A4XBAkiRs3rwZy5Ytw8UXXxyxvwsuuCDs1Lyjx+l
2024-03-26 09:42:53 +00:00
"text/plain": [
"<Figure size 1200x1200 with 21 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
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",
" PANTHEONP_Carrick_Groups,\n",
" # PANTHEONP_Carrick_Groups_zSN,\n",
" PANTHEONP_Carrick_zSN,\n",
" # PANTHEONP_CB2,\n",
" # PANTHEONP_CB2_Groups,\n",
" # PANTHEONP_CB2_Groups_zSN,\n",
" 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-04-23 11:02:09 +00:00
"execution_count": 73,
2024-04-01 22:19:14 +00:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
2024-04-23 11:02:09 +00:00
"Reading Pantheon+ fitted to csiborg2_main with ksmooth = 1.\n",
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n"
2024-04-02 08:28:57 +00:00
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-04-23 11:02:09 +00:00
"BIC = 10027.133105 +- 13.850270\n",
"AIC = 9981.941699 +- 13.850270\n",
"logZ = -4981.690186 +- 6.885272\n",
2024-04-01 22:19:14 +00:00
"chi2 = 0.000000 +- 0.000000\n",
"Removed no burn in\n",
"\n",
2024-04-23 11:02:09 +00:00
"Reading Pantheon+_groups fitted to csiborg2_main with ksmooth = 1.\n",
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n",
"BIC = 2651.293762 +- 12.943075\n",
"AIC = 2618.929260 +- 12.943075\n",
"logZ = -1293.734613 +- 6.356175\n",
"chi2 = 0.955844 +- 0.134530\n",
2024-04-02 08:28:57 +00:00
"Removed no burn in\n",
"\n",
2024-04-23 11:02:09 +00:00
"Reading 2MTF fitted to csiborg2_main with ksmooth = 1.\n",
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n",
"BIC = 19167.596582 +- 20.190445\n",
"AIC = 19121.432520 +- 20.190445\n",
"logZ = -9555.558252 +- 9.820362\n",
2024-04-02 08:28:57 +00:00
"chi2 = 0.000000 +- 0.000000\n",
"Removed no burn in\n",
"\n",
2024-04-23 11:02:09 +00:00
"Reading SFI_gals fitted to csiborg2_main with ksmooth = 1.\n",
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n",
"BIC = 28646.324902 +- 24.227278\n",
"AIC = 28596.914746 +- 24.227278\n",
"logZ = -14288.365332 +- 12.050230\n",
2024-04-02 08:28:57 +00:00
"chi2 = 0.000000 +- 0.000000\n",
2024-04-01 22:19:14 +00:00
"Removed no burn in\n"
]
}
],
"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-04-23 11:02:09 +00:00
"execution_count": 74,
2024-04-01 22:19:14 +00:00
"metadata": {},
"outputs": [
2024-04-23 11:02:09 +00:00
{
"name": "stdout",
"output_type": "stream",
"text": [
"Removed no burn in\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:root:2D kernel density bandwidth optimizer failed for Vmag, l. Using fallback width: f(a) and f(b) must have different signs\n",
"WARNING:root:2D kernel density bandwidth optimizer failed for l, b. Using fallback width: f(a) and f(b) must have different signs\n",
"WARNING:root:2D kernel density bandwidth optimizer failed for l, b. Using fallback width: f(a) and f(b) must have different signs\n",
"WARNING:root:2D kernel density bandwidth optimizer failed for l, sigma_v. Using fallback width: f(a) and f(b) must have different signs\n"
]
},
2024-04-01 22:19:14 +00:00
{
"data": {
2024-04-23 11:02:09 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABKYAAASlCAYAAACSitFIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3yUVb4/8M8zNZMpmRQS0kOAhCKCsLq4FMEVkCasBUHdRRbZy8Wy7lpYBduuqKBrA726q4juSpGfLgqCggsoWLBgpASSUEIgPSSZSZk+z++PkDFleiZMyuf9e83r3jzPec45Mxn93Xw853sEURRFEBERERERERERXWSScE+AiIiIiIiIiIh6JwZTREREREREREQUFgymiIiIiIiIiIgoLBhMERERERERERFRWDCYIiIiIiIiIiKisGAwRUREREREREREYcFgioiIiIiIiIiIwkIW7glcbE6nEyUlJdBqtRAEIdzTIeo0oiiirq4OSUlJkEiYQRMREREREVHX0+uCqZKSEqSmpoZ7GkQXzdmzZ5GSkhLuaRARERERERG10+uCKa1WC6Dpj3WdThfm2RB1HqPRiNTUVNd3noiIiIiIiKir6XXBVPP2PZ1Ox2CKegVuWSUiIiIiIqKuioVniIiIiIiIiIgoLBhMERERERERERFRWDCYIiIiIiIiIiKisGAwRUREREREREREYdHrip8TEREREVHPVFRUjarz9Z06RlysBmlpMZ06BhFRb8JgioiIiIiIur2iompkX/oIzBZ7p44ToZQh79Dfumw4lZGRgRdffBGzZ88O91S6nY0bN+KDDz7Ae++951f7yZMn48EHH8Q111wT0n5DOXYzfi+oK+NWPiIiIiIi6vaqztd3eigFAGaLPaBVWRMmTIBSqYRGo0FMTAwmTJiAH374ISRzycjIwJYtW0LSV1ezf/9+TJ06FdHR0dDr9Rg+fDhWrVoFq9UKoPXnqtVqMXToUGzevBkAYLF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5HNnZ2Vi4cCH+8Y9/AABOnTqFOXPmuFbl3XzzzTh8+LDr+euvvx6zZ892fUf99e233yI3Nxe33357h99bT8FgioiIiIiI6CJobGzEG2+8gfT0dMTGxiI9PR27d++G0WjEG2+8gQceeKDdCph///vf2LBhAyorK6FWq11bwjZv3oy0tDRs2LAB9fX1eO2113w+8/vf/x7V1dU4dOgQTp8+DZvNhrvuusv13C233AK5XI7Tp09j37592LJlS6utTd76DpWCggKcPn0a8+bN8/sZp9OJDz/8ECaTCSNGjGh332w249tvv/W6dSonJweDBg3yeN9TH0OGDEFOTk7Q/baUn5+PwsJC3HzzzX619zW2N75+17fccgvS09NRXl6ODRs24M0333TbT8ug8Nlnn8Xtt9/uMahZsmQJ9Hq9x5e34DBYdrsdixYtwiuvvNIuLHM6nQCaAsGW1w4dOgQA+POf/4zNmzfDYDCgtrYWGzZswMyZMzs8pzfffBNTp05FUlJSh/vqKRhMERERERERdaKHHnoIer0emZmZOH78uGuVyw033IDU1FQIgoCJEydiypQp2Lt3b6tnlyxZgn79+iEiIgK33nqrX/Wp3D1TWVmJ999/H6+88gr0er1rRdCmTZvgcDhQXFyM3bt34/nnn4dGo0F6ejqWLVuGdevWdXg+gWiu4ZOcnOyzbfPnqlarcf3112P58uWuVUbNRFHEHXfcgYEDB+L666/32FdNTQ10Op3be9760Ol0qKmpCarftqqqqgCgVWDxxBNPQK/XQ6PRYM6cOQGN7Ymv3/XZs2exb98+PPPMM1CpVMjKymq1Iq+tl19+GSNGjMAnn3yClStXwmazuW336quvora21uNr7NixXuc9Y8YMCILg8dWyBlezZ599FpdddhnGjx/f7l52djYyMjLw6KOPwmKx4OjRo1i7di2MRiMAYMyYMaioqEB0dDRiYmJQU1ODhx56yOscfWloaMDGjRtxxx13dKifnobBFBERERERUSd6+umnUVtbi7KyMnzyySeuVTfvvvsuRo4ciZiYGOj1emzfvt0VTjTr27ev639Xq9Woq6vzOZ67ZwoLC+F0OtGvXz/XCpXLL78cEokEZWVlOHfuHCIiIpCQkOB6NjMzE+fOnfN7Pi1XxMyYMQP79+8PeEVM82qb4uJin22bP1eTyYS8vDy8/fbbeP311133RVHEkiVLkJeXhy1btkAi8fznb3R0tCuQaMlXH0ajEdHR0QH3607zey8pKXFde+yxx1BbW4v777/fVfjd37E98fW7LikpQURERKuVT2lpaR77mzhxImbOnIndu3dj48aNkMvlAc/JH+vXr0dlZaXHV9s5njhxAq+99hqeffZZt/3J5XJ8+OGH+PHHH5GcnIxbb70VCxYsQGxsLJxOJyZNmoQxY8a46kKNGTMGkydP7tB72Lx5MyIjIzF9+vQO9dPTMJgiIiIiIiK6yIqKijB//nysWrUKFRUVqK2txbRp01ptK/LFW9DSVmpqKiQSCUpKSlqtUjGbzUhOTkZKSgrMZjPKy8tdzxQWFiIlJcXvMVquiNm2bRvGjh0b0IoYAMjKykJGRgY2btzo97gAMGDAAEybNg3btm0D0BQo3XnnnThw4AB27tyJqKgor8+PGDECx48fb3XNnz5yc3Pdbh/01q8nWVlZSE9Px3vvvedXe19je+Lrd52UlASz2dwqJC0qKnLbV35+PtauXYsnnnjC57iLFy9udzpdy9e+ffu8Pq/T6RAXF+fx1fafh/3796O8vBxZWVmIi4vDrFmzYDQaERcXhwMHDgAAhg4dip07d6Kqqgo5OTmwWCy46qqrUF1djTNnzuCee+5BZGQkIiMjcffdd+PAgQPtwuNAvPHGG5g/fz5kMlnQffREDKbcsJ4sgO30Cb/b5x4rwef78gMe58yZM6itrQ34uVCqMBmx5sgevHxkN3YXH4dTdIZ1PkR
2024-04-01 22:19:14 +00:00
"text/plain": [
"<Figure size 1200x1200 with 21 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
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",
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}