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-03-26 14:11:04 +00:00
"execution_count": 51,
2024-03-08 10:44:19 +00:00
"metadata": {},
2024-03-26 14:11:04 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
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-03-26 14:11:04 +00:00
"execution_count": 37,
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-03-26 14:11:04 +00:00
"10:32:21: reading the catalogue.\n",
"10:32:21: reading the interpolated field.\n",
"10:32:22: calculating the radial velocity.\n"
2024-03-22 17:10:40 +00:00
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/mnt/users/rstiskalek/csiborgtools/csiborgtools/flow/flow_model.py:112: 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-03-16 17:02:00 +00:00
"fpath_data = \"/mnt/extraspace/rstiskalek/catalogs/PV_compilation_Supranta2019.hdf5\"\n",
"# fpath_data = \"/mnt/extraspace/rstiskalek/catalogs/A2.h5\"\n",
"\n",
2024-03-26 14:11:04 +00:00
"simname = \"Carrick2015\"\n",
"catalogue = \"SFI_groups\"\n",
2024-03-21 15:50:37 +00:00
"loader = csiborgtools.flow.DataLoader(simname, 0, catalogue, fpath_data, paths, ksmooth=0)\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-03-26 14:11:04 +00:00
"execution_count": 44,
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-03-26 14:11:04 +00:00
"Selected 587/587 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-03-26 14:11:04 +00:00
"model_kwargs = {\"sample_alpha\": False, \"sample_beta\": True}"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-03-26 14:11:04 +00:00
"execution_count": 45,
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-03-26 14:11:04 +00:00
"execution_count": 46,
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-03-26 14:11:04 +00:00
"sample: 100%|██████████| 750/750 [01:11<00:00, 10.45it/s, 7 steps of size 6.90e-01. acc. prob=0.87] \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-03-26 14:11:04 +00:00
"execution_count": 47,
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-03-26 14:11:04 +00:00
" mean std median 5.0% 95.0% n_eff r_hat\n",
" Vext_x -108.60 18.78 -109.17 -139.36 -78.67 591.09 1.00\n",
" Vext_y -47.68 30.46 -47.88 -102.24 0.37 471.22 1.00\n",
" Vext_z -108.83 31.09 -108.27 -156.70 -57.68 491.18 1.00\n",
" beta 0.39 0.03 0.39 0.34 0.44 479.47 1.00\n",
" h 0.98 0.01 0.98 0.96 0.99 702.15 1.00\n",
" sigma_v 139.35 15.08 138.02 118.31 165.93 582.94 1.00\n",
2024-03-22 17:10:40 +00:00
"\n",
2024-03-26 09:42:53 +00:00
"Number of divergences: 0\n",
2024-03-26 14:11:04 +00:00
"{'BIC': 8967.5947265625, 'AIC': 8941.3447265625, 'logZ': -4454.95263671875}\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-03-26 09:42:53 +00:00
"print(csiborgtools.numpyro_gof(model, mcmc, model_kwargs))"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "code",
2024-03-26 14:11:04 +00:00
"execution_count": 48,
2024-03-26 09:42:53 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2024-03-26 14:11:04 +00:00
"{'BIC': 8972.8076171875, 'AIC': 8950.9326171875, 'logZ': -4456.90234375}"
2024-03-26 09:42:53 +00:00
]
},
2024-03-26 14:11:04 +00:00
"execution_count": 48,
2024-03-26 09:42:53 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2024-03-26 14:11:04 +00:00
"{'BIC': 8972.8076171875, 'AIC': 8950.9326171875, 'logZ': -4456.90234375}"
2024-03-26 09:42:53 +00:00
]
},
{
"cell_type": "code",
2024-03-26 14:11:04 +00:00
"execution_count": 49,
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-03-26 14:11:04 +00:00
"|V| = 165.80032348632812 +- 25.755414962768555\n",
"l = 311.4824201173159 +- 11.923668185663816\n",
"b = 19.871077149704966 +- 8.699190278394884\n",
"beta = 0.3904797434806824 +- 0.029465198516845703\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-03-26 14:11:04 +00:00
"execution_count": 50,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-22 17:10:40 +00:00
"outputs": [
{
"data": {
2024-03-26 14:11:04 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA58AAAO6CAYAAAAYcOP5AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bG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K7+3NQEAL/++iu0Wq3JU2579OgBAFluCJTT629LW2sLABKJBCkpKXjy5IkhfK5btw5+fn4WGYUmIiIiIjIQqEjYtWuXAEC4ceNGvt53586dQvv27QVXV1fB2tpaKF26tNC+fXth3759GdpWqlRJAJDp4+HDh7lue+LECQGAEBAQkOFeiYmJwuTJkwU3NzfB1tZWaNy4sXDkyBGTahIEQWjSpIlQrlw5QavV5uXTlcGoUaMyrd/Y19N8+umnQsmSJQUAQufOnQW9Xi8IgiCoVCqhRo0awqtXr4ShQ4cKX3/9dbrrWrduLcjlckEulwvt27cXrl27ZsrbISIiIiLKkkQQsjnTgYhENXr0aLi5uWW5rjOn19+m0+kQFBSE69ev47PPPjNcX79+fYwePRrDhg1DtWrVMHPmTMM1Fy5cQK1atWBlZYUVK1bghx9+wK1bt+Do6GiOt0dEREREZMANh4jMrEWLFpBIJJk+3g5+5mZlZYV3330Xx44dw6FDh3DlyhVcvHgRn3zySZbXvPPOO3BwcICdnR2mTp0KR0dHnDt3TrQaiYiIiKj44ppPIjM7deqURe+v1Wpx79493LlzB7dv30aFChU
2024-03-22 17:10:40 +00:00
"text/plain": [
2024-03-26 14:11:04 +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-03-26 09:42:53 +00:00
"data = np.vstack(data).T\n",
2024-03-21 15:50:37 +00:00
"fig = corner.corner(data, labels=labels, show_titles=True, title_fmt=\".3f\", title_kwargs={\"fontsize\": 12}, smooth=1)"
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-21 15:50:37 +00:00
"cell_type": "markdown",
2024-03-08 10:44:19 +00:00
"metadata": {},
"source": [
2024-03-21 15:50:37 +00:00
"#### Functions to read in the results"
2024-03-16 17:02:00 +00:00
]
},
{
"cell_type": "code",
2024-03-26 14:11:04 +00:00
"execution_count": 55,
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-03-26 14:11:04 +00:00
"Reading SFI_groups fitted to Carrick2015 with ksmooth = 0.\n"
2024-03-22 17:10:40 +00:00
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
2024-03-26 14:11:04 +00:00
"BIC = 8896.874023 +- 0.000000\n",
"AIC = 8866.249023 +- 0.000000\n",
"logZ = -4417.928711 +- 0.000000\n",
2024-03-22 17:10:40 +00:00
"chi2 = 0.000000 +- 0.000000\n"
]
},
{
"data": {
2024-03-26 14:11:04 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAABUQAAAVeCAYAAAC5MTGqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdeXhTZd7/8U+6pU26QVOgQEvZhIogVBgQFMVdkcUNtw4qKq4jijqiiKKi4orzOC7jMqICI4iI4A4qKogLiApYWWQJUKBNgS5JaWma3x/8zrEtXZJSWtq8X9eVa8o59znnTtI+1/V8/N731+Lz+XwCAAAAAAAAgCAQ0tgTAAAAAAAAAICG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75p44//vhqz73xxhsBPwsAAAAAAKA5IhANYvfff78effRRXX311br22mv1r3/9S6NHj9arr76q7du369Zbb6322gMHDvjdtKdly5YKCQlsu1qfz6fdu3erR48eAV13pBw4cEBz5szRwIEDlZqaGtC10dHRGjFihB588EE9//zz+uKLL/Tbb79pxIgR1V5TWlqq0tJSeb1elZaWav/+/QoPD9fYsWN12WWXmePGjRunjh07asKECYqIiKj2HAAAAAAAAA4iEA1S3377rR599FHdc889mjp1qiSpTZs2uvjiizVhwgTddNNNiouLq/b6ZcuWaciQIX49a/PmzQGHiDNnztSOHTv08MMPB3TdkfLZZ58pNzf3kOXy/nrxxRd11VVXKSEhQe3bt9fs2bPVsmVL8/y5556rk08+Wffdd58kacqUKRUaIz366KN64403dPXVV8tms5nHo6KiFB0dbe4ZWtM5AAAAAAAASBafz+dr7Emg4V188cX68ssv5XQ6zb0sV65cqb59+yoyMlJbtmxR69atq71+7969WrlypV/POumkkxQZGen33P744w/1799fPXr00LfffqvQ0FC/rzX2BjXCw8MdZ7jiiis0d+5c7dy5UwkJCX7PBwAAAAAAAEcXKkSDkNfr1eeff65hw4ZV2djnmmuuqTEMlaQWLVoc0oW9PuzatUtDhw5VXFyc5s6dG1AYeqQUFhbqgw8+0Nlnn00YCgAAAAAA0MQRiAahTZs2qaCgQOnp6RWO5+TkSJJuueWWWu9RUlKiPXv2+PW8xMREv4LNvLw8nXvuudq3b5++/fZbtW3b1q/7H2nz58+vsrs8AAAAAAAAmp7AOt2gWTCCT4fDUeH4448/XuXxqnz33XdKSkry67Vt27Za77d//34NGzZM69ev14cffqhjjz22Du/syJg5c6aio6M1fPjwOt8jJydHQ4cOld1uV7du3fTFF1/UOP6ll15Senq6wsPDNXny5CrHLF++XCEhIZoyZUqdnwMAAAAAABBsqBANQkazpDVr1pjHZs2apW+++UbSwXCyNscff7wWLVrk1/PatGlT43mv16tLL71Uy5cv1wcffKATTzyx2rEej0dOp1MOh8Ov4PZw5eTkaPHixbr88ssrNCwK1C233KI2bdqY9xs1apQ2bNhQobFSeUlJSZo8ebJmzZpV5fmysjLdcccd6tev32E9BwAAAAAAINgQiAahtLQ0dezYUf/3f/8nm82mkJAQTZ06VaNGjdKcOXM0efJkjR8/Xj179qz2HvW5h+idd96pBQsWaNiwYdqzZ49mzJhR4XxGRob5848//qghQ4bowQcfrFA5+e9//1v79u1TVlaWJGnhwoXavn27JOkf//iHGQL7O84we/ZslZaWHtZy+cLCQs2fP1+bNm2SzWbT8OHD1bNnT33wwQe65pprqrxm5MiRkqSPP/64yvOvvPKK+vfvr7y8vMN6DgAAAAAAQLAhEA1CISEhmjdvnm666SY98cQTstlsuvPOO/XII48oOjpab731lk499dQaA9H69Msvv0g6GE4uXLjwkPPlA9HqPP3009q6dav573nz5mnevHnm9UbQ6e84w8yZM9WqVavDCn83bNig6OhotW/f3jzWs2dPrV27tk73y83N1XPPPafvv/9et99++xF7DgAAAAAAQHNEIBqkevfureXLlx9y/PXXX9frr7/eoHNZsmSJ32NPPfVU+Xy+Q45v2bLFr+v9HWeo6jMKVGFhoWJjYysci42NVW5ubp3uN3HiRN1+++2Kj48/os8BAAAAAABojmiqBBymk046SRaLpcrX/fffr+joaOXn51e4Jj8/X9HR0QE/a9WqVfrpp590/fXXH3KuPp8DAAAAAADQXFEhChympUuX1ni+sLBQhYWF2rFjh9q1ayfpYEOr0aNHB/ysr7/+WuvWrTPvk5eXp7CwMP355596/vnn6+05AAAAAAAAzRUVosARFh0drREjRujBBx9UUVGRPvzwQ/32228aMWJEtdeUlpZq//798nq9FX4eO3asNm7cqF9++UW//PKLhg8frltuuUXTpk2r03MAAAAAAACCDYEo0ABefPFFZWVlKSEhQePHj9fs2bPVsmVL8/y5556rxx57zPz3lClTFBUVpddee02PPvqooqKi9Pbbb8tms6lNmzbmKyoqStHR0eZ+orU9BwAAAAAAINhZfFV1qAEAAAAAAACAZogKUQAAAAAAAABBg0AUAAAAAAAAQNCgy/wRVFZWpqysLMXExMhisTT2dICjis/nU0FBgdq2bauQEP7bDAAAAAAAaBgEokdQVlaWkpOTG3sawFFt27Ztat++fWNPAwAAAAAABAkC0SMoJiZG0sHAJzY2tpFnAxxd8vPzlZycbP6dAAAAAAAANAQC0SPIWCYfGxtLIApUg+0kAAAAAABAQ2LjPgAAAAAAAABBg0AUAAAAAAAAQNAgEAUAAAAAAAAQNAhEAQAAAAAAAAQNAlEAAAAAAAAAQYNAFAAAAAAAAEDQIBAFAAAAAAAAEDQIRAEAAAAAAAAEDQJRAAAAAAAAAEGDQBQAAAAAAABA0CAQBQAAAAAAABA0CEQBAAAAAAAABA0
2024-03-22 17:10:40 +00:00
"text/plain": [
"<Figure size 1390x1390 with 36 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-26 14:11:04 +00:00
"data, names, gof = read_samples(\"SFI_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-03-21 15:50:37 +00:00
"### LOSS-only 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-03-21 15:50:37 +00:00
"### Foundation-only 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-03-21 15:50:37 +00:00
"### PantheonPlus-only comparison"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "code",
2024-03-26 09:42:53 +00:00
"execution_count": 58,
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",
"Reading Pantheon+ fitted to csiborg2_main with ksmooth = 0.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"BIC = 10056.015674 +- 27.407189\n",
"AIC = 10010.824268 +- 27.407189\n",
"logZ = -5006.756958 +- 48.432771\n",
"chi2 = 0.000000 +- 0.000000\n",
"Removed no burn in\n",
"\n",
"Reading Pantheon+ fitted to csiborg2_main with ksmooth = 1.\n",
"BIC = 10027.133105 +- 13.850270\n",
"AIC = 9981.941699 +- 13.850270\n",
"logZ = -4981.690186 +- 6.885272\n",
"chi2 = 0.000000 +- 0.000000\n",
"Removed no burn in\n"
]
}
],
2024-03-08 10:44:19 +00:00
"source": [
2024-03-26 09:42:53 +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-03-16 17:02:00 +00:00
"\n",
2024-03-26 09:42:53 +00:00
"# PANTHEONP_CB1_0 = read_samples(\"Pantheon+\", \"csiborg1\", 0, return_MCsamples=True)\n",
"# PANTHEONP_CB1_1 = read_samples(\"Pantheon+\", \"csiborg1\", 1, return_MCsamples=True)\n",
2024-03-16 17:02:00 +00:00
"\n",
2024-03-21 15:50:37 +00:00
"# STILL RUNNING\n",
2024-03-26 09:42:53 +00:00
"PANTHEONP_CB2_0 = read_samples(\"Pantheon+\", \"csiborg2_main\", 0, return_MCsamples=True)\n",
2024-03-21 15:50:37 +00:00
"PANTHEONP_CB2_1 = read_samples(\"Pantheon+\", \"csiborg2_main\", 1, return_MCsamples=True)\n"
2024-03-08 10:44:19 +00:00
]
},
{
"cell_type": "code",
2024-03-26 09:42:53 +00:00
"execution_count": 59,
2024-03-16 17:02:00 +00:00
"metadata": {},
2024-03-26 09:42:53 +00:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABKYAAASlCAYAAACSitFIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd5hdVb3/8c/ep00vmZqp6ZVUEgiEFhAiVQRBEK6AVAMiPxsCiihSRMQCKChgVKRcRKmKgPROGoT0PpNkkplMMn1O3fv3xzhzE0iZM3P2KTPv1/PMc8Ocvdf6npOduXc+d63v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Eq1bt65X15aWlur000/XVVdd1fOL/bZt2/SPf/xDUtfWuTlz5ug73/mO2tvbVVNTo1tuucWR0+JuuummfZ7GZhiG7r77bt1+++26++671djYKKkr0Ln44ou1adOmvd63ceNG/fOf/9SkSZMkSVdddZXefvttvfTSS8rPz4+qhk/b32dTWVmp2bNn6/rrr1dnZ6fWrFmj3//+93sdZ8WKFfrzn/+sO++8s1eh0H333bfH6Xif/jryyCN7VX80/vd//1ctLS2ybVsLFizQ7bffrjPPPFOSdNFFF+mWW27Rtm3btG3bNt1666265JJLeu490OuXXXaZ7r77bm3ZskWdnZ36yU9+ouOOO05ZWVmfqaOwsFCjRo3SvffeK7/fL7/fr3vvvVcVFRX77MmVSARTCRbeUa8d139ToY3rtfO
"text/plain": [
"<Figure size 1200x1200 with 21 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2024-03-16 17:02:00 +00:00
"source": [
2024-03-21 15:50:37 +00:00
"X = [\n",
2024-03-26 09:42:53 +00:00
" # PANTHEONP_Carrick_0,\n",
2024-03-21 15:50:37 +00:00
" # PANTHEONP_Carrick_1,\n",
" # PANTHEONP_CB1_0,\n",
2024-03-26 09:42:53 +00:00
" # PANTHEONP_CB1_1,\n",
" PANTHEONP_CB2_0,\n",
2024-03-21 15:50:37 +00:00
" 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",
2024-03-26 09:42:53 +00:00
"# g.export(f\"../plots/PANTHEONP_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-16 17:02:00 +00:00
"metadata": {},
"source": [
2024-03-21 15:50:37 +00:00
"### 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-03-21 15:50:37 +00:00
"### SFI galaxies"
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-21 15:50:37 +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": [
"### SFI groups"
]
},
{
"cell_type": "code",
"execution_count": 60,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Reading SFI_groups fitted to Carrick2015 with ksmooth = 0.\n",
"BIC = 8896.874023 +- 0.000000\n",
"AIC = 8866.249023 +- 0.000000\n",
"logZ = -4417.928711 +- 0.000000\n",
"chi2 = 0.000000 +- 0.000000\n",
"Removed no burn in\n",
"\n",
"Reading SFI_groups fitted to Carrick2015 with ksmooth = 1.\n",
"BIC = 8957.607422 +- 0.000000\n",
"AIC = 8926.982422 +- 0.000000\n",
"logZ = -4447.800293 +- 0.000000\n",
"chi2 = 0.000000 +- 0.000000\n",
"Removed no burn in\n",
"\n",
"Reading SFI_groups fitted to csiborg2_main with ksmooth = 0.\n",
"BIC = 8782.843457 +- 17.080250\n",
"AIC = 8752.218457 +- 17.080250\n",
"logZ = -4362.511084 +- 8.475959\n",
"chi2 = 0.000000 +- 0.000000\n",
"Removed no burn in\n",
"\n",
"Reading SFI_groups fitted to csiborg2_main with ksmooth = 1.\n",
"BIC = 8726.997656 +- 21.534941\n",
"AIC = 8696.372656 +- 21.534941\n",
"logZ = -4333.264429 +- 10.550374\n",
"chi2 = 0.000000 +- 0.000000\n",
"Removed no burn in\n"
]
}
],
"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",
"execution_count": 63,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABKYAAASlCAYAAACSitFIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIW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DRo9OjROvfcc/d4rmVZOu200zRlyhRt3rxZc+fO1X333acnnniia0+qGwimAAAAAABJZ+vWrfryyy912WWXKSMjQx6PR2PHjtXZZ58d03kqKyt17LHHKicnR1OnTtWtt96qwYMHS2rZbjZ79mxNnz5dGRkZWrFihSRp06ZNOuecc9SnTx+VlZXpuuuuUzQalSQZhqHFixe3jX/PPfe0C4AGDx6sW265RVOmTFFOTo6OP/54VVdXtx2/++67VVZWpuzsbA0ePFgPPfRQh56H4zj6wQ9+oKuvvlpXXXWVioqKJEmjRo3SnDlz9hmE7MmZZ56pM844o20cN+3r9ZT2/R7tauTIkTrhhBOUlZWlc889V3379tXf/vY3+f1+159HRyxYsECvvfaarr766k4f78x78vHHH2vFihWaNWvWHo+vXLlSK1eu1I033iifz6eRI0fqoosu0h//+MdOPZ9YIJgCAAAAACSdwsJCjRw5UhdeeKGeeeYZrV+/3pV5vvnNb2rQoEHatGmTnnzyST388MPtjs+ZM0ePPfaYGhoaNHLkyLbH+Hw+rV27VvPmzdMLL7zQqW1QDz30kJ544glt3LhR/fr108yZMyVJX3zxha6//nq9/vrrqq+v10cffaSDDjqoQ2OuWrVKa9eu1XnnndfhOrrrz3/+swoKCjR27Fj9+te/lm3bXRpnf6/n/t6jne0cwN15552aNWvWXoOcK6+8Unl5eXu9vfvuu116PnsTjUZ1ySWX6P77799jULa/453x8MMP68QTT9SAAXvu59b6XjmO0+6+pUuXdmveriCYAgAAAAAkHcMw9Pbbb2vixIm6+eabNWTIEI0ZM0ZvvPFG2znXXHNNuyChsbGxU3NUVFRo3rx5uu2225Senq4RI0bo8ssvb3fOFVdcoZEjR8rj8cjv96uqqkpz587V3XffraysLA0aNEjXXXed5syZ0+F5r7jiCo0aNUoZGRm644479NZbb6myslIej0eO42j58uVqbm5WcXHxPnsE7WzLli2SpIEDB3a4ju74wQ9+oJUrV2rLli16+OGH9dvf/la//e1vOz3O/l7PjrxHu/rd736nSZMm6bXXXtPtt9+uSCSyx/N+//vfq6amZq+3ww47bK9znHLKKTIMY6+3devW7faYO++8U5MnT9YRRxyxxzH3d7yjGhsb9dRTT+niiy/e6zkjR47U4MGDdcMNNygUCmn58uV65JFHVFdX1625u4JgCgAAAACQlPr166df//rXWr58ubZs2aITTzxRX/va17R9+3ZJ0uzZs9sFCZmZmZ0av7q6Wmlpae1W1JSVlbU7Z9efKysrlZaWpuLi4rb7hgwZosrKyg7Pu/OqnuLiYgUCAVVVVWno0KF67LHHdN9996m4uFjHHXdcu22B+9L6HKqqqvZ6zs4rhE455RS9++67XV4hNGXKFPXp00cej0fTp0/Xz3/+cz399NMdfnyr/b2eHXmPdnX00Ufr1FNP1dy5c/XUU0/J5/N1uq79eeKJJ7Rly5a93natcfXq1XrggQd055137nG8/R3vjL/97W/KyMjQySefvNdzfD6f/vGPf2jRokUaOHCgzj//fF144YUqLCzs9vydRTAFAAAAAEh6BQUFuummm9TY2Ki1a9fGZMwBAwYoGAxq69atbfeVl5e3O8c0239tLikpUTAY1KZNm9ruW7dunUpKSiRJmZmZampqaju2a9NxSe22JW7evFmhUKhtpdM555yjt956S5s2bdLEiRP1rW99q0PPZcSIERo8eLCeeuqpvZ6z8wqhl19+WYcddliHVwjtz66vU0ft7/XsyHu0sy+++EKPPPKIbr755v3Offnll+92Jbudb/PmzdvrY3NyclRUVLTX266vx7vvvqtNmzZpxIgRKioq0umnn666ujoVFRXpo48+2u/xznjooYd0wQUXyOv17vO8sWPH6vXXX9fWrVu1ePFihUIhHXnkkZ2aKxYIpiCpZV/pGysjumtus+Z+EWm3z7SrrJodanjxWdX/7a8Kr1whp4v7jQEAAAD0Pjt27ND111+vzz//XJZlqampSXfffbcKCgo0atSomMxRWlqqGTNm6Nprr1Vzc7NWrVq13+bPAwcO1NFHH62f/OQnamxsVHl5uW655Za2q75NmTJFjz/+uKLRqBYvXqzHH398tzEefPBBrVy5Us3Nzbr66qt1xBFHqKSkRCtXrtQbb7yh5uZm+f1+ZWVltQsXbrrppr1eSc8wDN1777267bbbdO+992rbtm2SWoKaiy66qNM9uqLRqILBoKLRqGzbVjAYVDgcbjv+zDPPqK6uTo7jaP78+brtttt01llndajWne3v9ezMe/TZZ5/pz3/+s+66664OBWUPPPDAbley2/l2+OGH73eMjjrnnHO0evVqLV68WIsXL9ZDDz2k7OxsLV68WJMnT97vcWn/74nU0tT8/fff10UXXbTfmpYuXarGxkaFw2E9//zzeuSRR3T99dfH7Dl3FMEUFLEcfesvjXrw/aCyA4YeeD+ks+c0KBztWjjl2LZqHr5fmy47X9HNG+WEQ6p56D5tvPgbCq9ZFePqAQAAAHSXJy9f8gfcn8gfaJmrI6f+t5/TSSedpNzcXJWVlem9997TP//5z05v2duXJ554QmvWrFFxcbHOPfdczZw5U4HAvl+LJ554Qs3NzRo0aJBmzJihk08+WT/72c8kSffee68++OAD5eXl6eqrr24LWHb2ne98R+edd56Ki4tVVVWlv/71r5KkcDisX/ziFyouLlZhYaHmzp3brndVeXm5ZsyYsde6TjnlFP3zn//
"text/plain": [
"<Figure size 1200x1200 with 21 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"X = [\n",
" SFIGROUP_Carrick_0,\n",
" # SFIGROUP_Carrick_1,\n",
" # SFIGROUP_CB2_0,\n",
" SFIGROUP_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/SFI_gals_comparison.png\", dpi=500,)"
]
},
2024-03-08 10:44:19 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
2024-03-21 15:50:37 +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-03-26 14:11:04 +00:00
"execution_count": 67,
2024-03-16 17:02:00 +00:00
"metadata": {},
"outputs": [
{
2024-03-21 15:50:37 +00:00
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
2024-03-26 14:11:04 +00:00
"Reading SFI_gals fitted to Carrick2015 with ksmooth = 1.\n",
2024-03-26 09:42:53 +00:00
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n",
2024-03-26 14:11:04 +00:00
"BIC = 28930.990234 +- 0.000000\n",
"AIC = 28881.580078 +- 0.000000\n",
"logZ = -14433.558594 +- 0.000000\n",
2024-03-26 09:42:53 +00:00
"chi2 = 0.000000 +- 0.000000\n",
2024-03-21 15:50:37 +00:00
"Removed no burn in\n",
"\n",
2024-03-26 14:11:04 +00:00
"Reading SFI_groups fitted to Carrick2015 with ksmooth = 1.\n",
2024-03-26 09:42:53 +00:00
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n",
2024-03-26 14:11:04 +00:00
"BIC = 8957.607422 +- 0.000000\n",
"AIC = 8926.982422 +- 0.000000\n",
"logZ = -4447.800293 +- 0.000000\n",
2024-03-26 09:42:53 +00:00
"chi2 = 0.000000 +- 0.000000\n",
2024-03-21 15:50:37 +00:00
"Removed no burn in\n",
"\n",
2024-03-26 14:11:04 +00:00
"Reading SFI_gals fitted to csiborg2_main with ksmooth = 1.\n",
2024-03-26 09:42:53 +00:00
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n",
2024-03-26 14:11:04 +00:00
"BIC = 28646.324902 +- 24.227278\n",
"AIC = 28596.914746 +- 24.227278\n",
"logZ = -14288.365332 +- 12.050230\n",
2024-03-26 09:42:53 +00:00
"chi2 = 0.000000 +- 0.000000\n",
2024-03-21 15:50:37 +00:00
"Removed no burn in\n",
"\n",
2024-03-26 14:11:04 +00:00
"Reading SFI_groups fitted to csiborg2_main with ksmooth = 1.\n",
2024-03-26 09:42:53 +00:00
"Subtracting LG velocity with kernel 0.0 Mpc / h.\n",
2024-03-26 14:11:04 +00:00
"BIC = 8726.997656 +- 21.534941\n",
"AIC = 8696.372656 +- 21.534941\n",
"logZ = -4333.264429 +- 10.550374\n",
2024-03-26 09:42:53 +00:00
"chi2 = 0.000000 +- 0.000000\n",
2024-03-21 15:50:37 +00:00
"Removed no burn in\n"
]
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-03-26 14:11:04 +00:00
"execution_count": 68,
2024-03-16 17:02:00 +00:00
"metadata": {},
"outputs": [
2024-03-21 15:50:37 +00:00
{
"name": "stdout",
"output_type": "stream",
"text": [
"Removed no burn in\n"
]
},
2024-03-26 14:11:04 +00:00
{
"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"
]
},
2024-03-16 17:02:00 +00:00
{
"data": {
2024-03-26 14:11:04 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAJOCAYAAACqbjP2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3xb1fk/8M+92tN7rwzHzp5kkO2QQUJCIEDKJpRZoPwopU0ZbaFfVoHSwSi0tCTMAAUCZJBBBtnbGXZix87wjLckW1u69/eHsGInkizJV5ZkP+/XS6/Wuvee88gS0eNzzn0Ow/M8D0IIIYQQ4hMb7gAIIYQQQqIBJU2EEEIIIX6gpIkQQgghxA+UNBFCCCGE+IGSJkIIIYQQP1DSRAghhBDiB0qaCCGEEEL8QEkTIYQQQogfxOEOoKdwHIeamhpoNBowDBPucAjxC8/zaG1tRXp6OliW/sYhhJBw6jNJU01NDbKyssIdB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1bt2LhwoUBtQu41q9YLBb3w2q1gmEY/P3vf8cLL7yAf/zjH6ivrwfgmrIsKiry2bev3+mlMjIyUFBQgCeeeAJGoxEVFRV44YUXcNddd/n8DFzq5MmT+OCDD/Daa6/5lbC88847ne7uvPQxbdo0v+IPRPvv2eFwgOM4WCwW2Gw2LF26FGVlZSgsLERhYSHee+89aDQaFBYWYsyYMQB8v/+JiYnIzc3FW2+95X4P33rrLWRmZrqTOF/HL+V
2024-03-16 17:02:00 +00:00
"text/plain": [
2024-03-21 15:50:37 +00:00
"<Figure size 600x600 with 6 Axes>"
2024-03-16 17:02:00 +00:00
]
},
"metadata": {},
"output_type": "display_data"
}
],
"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
}