2024-07-01 10:48:50 +00:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-10-02 17:07:30 +00:00
|
|
|
"execution_count": 1,
|
2024-07-01 10:48:50 +00:00
|
|
|
"metadata": {},
|
2024-10-02 17:07:30 +00:00
|
|
|
"outputs": [],
|
2024-07-01 10:48:50 +00:00
|
|
|
"source": [
|
|
|
|
"# 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-09-17 09:26:04 +00:00
|
|
|
"from os.path import exists\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"import numpy as np\n",
|
|
|
|
"import matplotlib.pyplot as plt\n",
|
|
|
|
"from corner import corner\n",
|
|
|
|
"from getdist import plots\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
"from astropy.coordinates import angular_separation\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"import scienceplots\n",
|
|
|
|
"from os.path import exists\n",
|
|
|
|
"import seaborn as sns\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
"import matplotlib as mpl\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"from reconstruction_comparison import *\n",
|
|
|
|
"\n",
|
|
|
|
"%load_ext autoreload\n",
|
|
|
|
"%autoreload 2\n",
|
|
|
|
"%matplotlib inline\n",
|
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"paths = csiborgtools.read.Paths(**csiborgtools.paths_glamdring)\n",
|
|
|
|
"fdir = \"/mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity\""
|
2024-07-01 10:48:50 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-09-11 06:45:42 +00:00
|
|
|
"## Quick checks"
|
2024-07-01 10:48:50 +00:00
|
|
|
]
|
|
|
|
},
|
2024-09-21 16:12:15 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-25 13:30:06 +00:00
|
|
|
"execution_count": null,
|
2024-09-21 16:12:15 +00:00
|
|
|
"metadata": {},
|
2024-09-25 13:30:06 +00:00
|
|
|
"outputs": [],
|
2024-09-21 16:12:15 +00:00
|
|
|
"source": [
|
|
|
|
"fname = paths.flow_validation(\n",
|
|
|
|
" fdir, \"Carrick2015\", \"2MTF\", inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=True, sample_beta=None,\n",
|
|
|
|
" zcmb_max=0.05)\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"get_gof(\"neg_lnZ_harmonic\", fname)"
|
|
|
|
]
|
|
|
|
},
|
2024-07-01 10:48:50 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-09-11 06:45:42 +00:00
|
|
|
"catalogue = \"CF4_TFR_i\"\n",
|
|
|
|
"simname = \"Carrick2015\"\n",
|
|
|
|
"zcmb_max=0.05\n",
|
|
|
|
"sample_beta = None\n",
|
|
|
|
"sample_alpha = True\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"fname_bayes = paths.flow_validation(\n",
|
|
|
|
" fdir, simname, catalogue, inference_method=\"bayes\",\n",
|
|
|
|
" sample_alpha=sample_alpha, sample_beta=sample_beta,\n",
|
|
|
|
" zcmb_max=zcmb_max)\n",
|
|
|
|
"\n",
|
|
|
|
"fname_mike = paths.flow_validation(\n",
|
|
|
|
" fdir, simname, catalogue, inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=sample_alpha, sample_beta=sample_beta,\n",
|
|
|
|
" zcmb_max=zcmb_max)\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"X = []\n",
|
|
|
|
"labels = [\"Full posterior\", \"Delta posterior\"]\n",
|
|
|
|
"for i, fname in enumerate([fname_bayes, fname_mike]):\n",
|
|
|
|
" samples = get_samples(fname)\n",
|
|
|
|
" if i == 1:\n",
|
|
|
|
" print(samples.keys())\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" X.append(samples_to_getdist(samples, labels[i]))\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"params = [f\"a_{catalogue}\", f\"b_{catalogue}\", f\"c_{catalogue}\", f\"e_mu_{catalogue}\",\n",
|
|
|
|
" \"Vmag\", \"l\", \"b\", \"sigma_v\", \"beta\", f\"alpha_{catalogue}\"]\n",
|
|
|
|
"# params = [\"beta\", f\"a_{catalogue}\", f\"b_{catalogue}\", f\"e_mu_{catalogue}\"]\n",
|
|
|
|
"# params = [\"Vmag\", \"l\", \"b\", \"sigma_v\", \"beta\", f\"mag_cal_{catalogue}\", f\"alpha_cal_{catalogue}\", f\"beta_cal_{catalogue}\", f\"e_mu_{catalogue}\"]\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"g = plots.get_subplot_plotter()\n",
|
|
|
|
"g.settings.figure_legend_frame = False\n",
|
|
|
|
"g.settings.alpha_filled_add = 0.75\n",
|
|
|
|
"\n",
|
|
|
|
"g.triangle_plot(X, params=params, filled=True, legend_loc='upper right')\n",
|
|
|
|
"plt.gcf().suptitle(catalogue_to_pretty(catalogue), y=1.025)\n",
|
|
|
|
"plt.gcf().tight_layout()\n",
|
|
|
|
"# plt.gcf().savefig(f\"../../plots/method_comparison_{simname}_{catalogue}.png\", dpi=500, bbox_inches='tight')"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# catalogue = [\"LOSS\", \"Foundation\"]\n",
|
|
|
|
"catalogue = \"CF4_TFR_i\"\n",
|
|
|
|
"simname = \"IndranilVoid_exp\"\n",
|
|
|
|
"zcmb_max = 0.05\n",
|
|
|
|
"sample_alpha = False\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"fname = paths.flow_validation(\n",
|
|
|
|
" fdir, simname, catalogue, inference_method=\"mike\",\n",
|
|
|
|
" sample_mag_dipole=True,\n",
|
|
|
|
" sample_beta=False,\n",
|
|
|
|
" sample_alpha=sample_alpha, zcmb_max=zcmb_max)\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"samples = get_samples(fname, convert_Vext_to_galactic=True)\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"samples, labels, keys = samples_for_corner(samples)\n",
|
|
|
|
"fig = corner(samples, labels=labels, show_titles=True,\n",
|
|
|
|
" title_kwargs={\"fontsize\": 12}, smooth=1)\n",
|
|
|
|
"# fig.savefig(\"../../plots/test.png\", dpi=250)\n",
|
|
|
|
"fig.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## Paper plots"
|
|
|
|
]
|
|
|
|
},
|
2024-09-12 15:04:25 +00:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### 0. LOS velocity example"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"fpath = \"/mnt/extraspace/rstiskalek/catalogs/PV/CF4/CF4_TF-distances.hdf5\"\n",
|
|
|
|
"\n",
|
|
|
|
"loader_carrick = csiborgtools.flow.DataLoader(\"Carrick2015\", [0], \"CF4_TFR_i\", fpath, paths, ksmooth=0, )\n",
|
|
|
|
"loader_lilow = csiborgtools.flow.DataLoader(\"Lilow2024\", [0], \"CF4_TFR_i\", fpath, paths, ksmooth=0, )\n",
|
|
|
|
"loader_cb2 = csiborgtools.flow.DataLoader(\"csiborg2_main\", [i for i in range(20)], \"CF4_TFR_i\", fpath, paths, ksmooth=0, )\n",
|
|
|
|
"loader_cb2X = csiborgtools.flow.DataLoader(\"csiborg2X\", [i for i in range(20)], \"CF4_TFR_i\", fpath, paths, ksmooth=0, )\n",
|
|
|
|
"loader_CF4 = csiborgtools.flow.DataLoader(\"CF4\", [i for i in range(20)], \"CF4_TFR_i\", fpath, paths, ksmooth=0, )\n",
|
|
|
|
"loader_CLONES = csiborgtools.flow.DataLoader(\"CLONES\", [0], \"CF4_TFR_i\", fpath, paths, ksmooth=0, )\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"angdist = angular_separation(\n",
|
|
|
|
" np.deg2rad(loader_carrick.cat[\"RA\"]), np.deg2rad(loader_carrick.cat[\"DEC\"]),\n",
|
|
|
|
" np.deg2rad(csiborgtools.clusters[\"Virgo\"].spherical_pos[1]),\n",
|
|
|
|
" np.deg2rad(csiborgtools.clusters[\"Virgo\"].spherical_pos[2]))\n",
|
|
|
|
"k = np.argmin(angdist)\n",
|
|
|
|
"print([loader_carrick.cat[\"RA\"][k], loader_carrick.cat[\"DEC\"][k]])\n",
|
|
|
|
"print(csiborgtools.clusters[\"Virgo\"].spherical_pos[1:])\n",
|
|
|
|
"print(csiborgtools.clusters[\"Virgo\"].spherical_pos[0])"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"loaders = [loader_carrick, loader_lilow, loader_CF4, loader_cb2, loader_cb2X, loader_CLONES]\n",
|
|
|
|
"simnames = [\"Carrick2015\", \"Lilow2024\", \"CF4\", \"csiborg2_main\", \"csiborg2X\", \"CLONES\"]\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"with plt.style.context(\"science\"):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
" plt.figure()\n",
|
|
|
|
" cols = plt.rcParams['axes.prop_cycle'].by_key()['color']\n",
|
|
|
|
"\n",
|
|
|
|
" for i, (simname, loader) in enumerate(zip(simnames, loaders)):\n",
|
|
|
|
" r = loader.rdist\n",
|
|
|
|
" vrad = loader.los_radial_velocity[:, k, :]\n",
|
|
|
|
"\n",
|
|
|
|
" if simname == \"Carrick2015\":\n",
|
|
|
|
" vrad *= 0.43\n",
|
|
|
|
"\n",
|
|
|
|
" if len(vrad) > 1:\n",
|
|
|
|
" ylow, yhigh = np.percentile(vrad, [16, 84], axis=0)\n",
|
|
|
|
" plt.fill_between(r, ylow, yhigh, alpha=0.66, color=cols[i],\n",
|
|
|
|
" label=simname_to_pretty(simname))\n",
|
|
|
|
" else:\n",
|
|
|
|
" plt.plot(r, vrad[0], label=simname_to_pretty(simname), c=cols[i])\n",
|
|
|
|
"\n",
|
|
|
|
" plt.xlabel(r\"$r ~ [\\mathrm{Mpc} / h]$\")\n",
|
|
|
|
" plt.ylabel(r\"$V_{\\rm rad} ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
"\n",
|
|
|
|
" plt.xlim(0, 90)\n",
|
|
|
|
" plt.ylim(-1000, 1000)\n",
|
|
|
|
" plt.legend(ncols=2, fontsize=\"small\")\n",
|
|
|
|
" plt.axvline(12.045, zorder=0, c=\"k\", ls=\"--\", alpha=0.75)\n",
|
|
|
|
"\n",
|
|
|
|
" plt.tight_layout()\n",
|
|
|
|
" plt.savefig(\"../../plots/LOS_example.pdf\", dpi=450, bbox_inches='tight')\n",
|
|
|
|
" plt.show()"
|
|
|
|
]
|
|
|
|
},
|
2024-09-11 06:45:42 +00:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### 1. Evidence comparison"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-10-07 20:16:35 +00:00
|
|
|
"execution_count": 49,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-10-07 20:16:35 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_LOSS_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:02:52\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_LOSS_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:17:56\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_LOSS_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:24:10\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_LOSS_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:41:00\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_LOSS_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:14:53\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_LOSS_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:52:52\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_LOSS_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:33:52\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_LOSS_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:03:00\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_LOSS_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:18:10\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_LOSS_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:25:22\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_LOSS_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:43:31\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_LOSS_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:17:10\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_LOSS_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:55:20\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_LOSS_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:36:10\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_Foundation_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 02/10/2024 17:47:56\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_Foundation_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:18:31\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_Foundation_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:25:04\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_Foundation_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:46:23\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_Foundation_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:20:13\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_Foundation_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:58:23\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_Foundation_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:38:10\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_Foundation_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:04:09\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_Foundation_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:18:53\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_Foundation_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:25:46\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_Foundation_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:56:16\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_Foundation_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:23:54\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_Foundation_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:01:40\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_Foundation_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:40:28\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_2MTF_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:04:48\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_2MTF_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:18:55\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_2MTF_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:33:12\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_2MTF_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:58:05\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_2MTF_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:37:40\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_2MTF_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:12:23\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_2MTF_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:42:56\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_2MTF_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:05:03\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_2MTF_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:20:08\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_2MTF_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:34:48\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_2MTF_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:05:34\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_2MTF_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:40:34\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_2MTF_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:22:45\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_2MTF_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:45:29\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_SFI_gals_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:05:44\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_SFI_gals_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:20:10\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_SFI_gals_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:35:56\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_SFI_gals_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:07:34\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_SFI_gals_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:44:34\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_SFI_gals_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:27:38\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_SFI_gals_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:48:03\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_SFI_gals_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:06:41\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_SFI_gals_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:21:13\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_SFI_gals_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:38:16\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_SFI_gals_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:11:53\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_SFI_gals_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:50:18\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_SFI_gals_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:31:36\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_SFI_gals_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:50:51\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_i_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:07:54\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_CF4_TFR_i_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:22:46\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_i_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:50:31\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_CF4_TFR_i_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:26:06\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_CF4_TFR_i_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:20:55\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_CF4_TFR_i_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:59:34\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_CF4_TFR_i_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:52:35\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_i_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:09:23\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_CF4_TFR_i_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:23:08\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_i_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:09:25\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_CF4_TFR_i_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:41:38\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_CF4_TFR_i_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:20:52\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_CF4_TFR_i_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:58:36\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_CF4_TFR_i_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:55:16\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_w1_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:07:53\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_CF4_TFR_w1_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:22:52\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_w1_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:54:34\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_CF4_TFR_w1_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:27:36\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_CF4_TFR_w1_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:12:48\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_CF4_TFR_w1_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:48:05\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_CF4_TFR_w1_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:53:55\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_w1_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:08:41\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_CF4_TFR_w1_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:23:09\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_w1_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 11:58:58\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_CF4_TFR_w1_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 12:30:30\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_manticore_2MPP_N128_DES_V1_CF4_TFR_w1_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:17:33\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_CF4_TFR_w1_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:50:41\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_CF4_TFR_w1_mike_smooth_1_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 26/09/2024 13:55:53\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
|
|
|
"zcmb_max = 0.05\n",
|
|
|
|
"\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
"sims = [\"Carrick2015\", \"Lilow2024\", \"csiborg2_main\", \"csiborg2X\", \"manticore_2MPP_N128_DES_V1\", \"CF4\", \"CLONES\"]\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"catalogues = [\"LOSS\", \"Foundation\", \"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
|
|
|
"\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
"y_BIC = np.full((len(catalogues), 2, len(sims)), np.nan)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"y_lnZ = np.full_like(y_BIC, np.nan)\n",
|
|
|
|
"\n",
|
|
|
|
"for i, catalogue in enumerate(catalogues):\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
" for j in [0, 1]:\n",
|
|
|
|
" for k, simname in enumerate(sims):\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, simname, catalogue, inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=simname != \"IndranilVoid_exp\",\n",
|
|
|
|
" zcmb_max=zcmb_max, smooth=j)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
" # y_BIC[i, j] = get_gof(\"BIC\", fname)z\n",
|
|
|
|
" y_lnZ[i, j, k] = - get_gof(\"neg_lnZ_harmonic\", fname) / np.log(10)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
" y_lnZ[i, j] -= y_lnZ[i, j].min()"
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-10-07 20:16:35 +00:00
|
|
|
"execution_count": 50,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-10-07 20:16:35 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAzcAAAHfCAYAAABtWSYcAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC//ElEQVR4nOzdeVxUVf8H8M+wb8IwuKS4MbibpgPY4pLK4FqWykCYZouAW9svBWl5nsoUhxazXBqw3SJkNLPFjNFKsyxgNMsljcElcmUYQRYRuL8/eJgktkFmgeHzfr18Pc6dM3O+jzcO93vPud8jEgRBABERERERURvnYOsAiIiIiIiIzIHJDRERERER2QUmN0REREREZBeY3BARERERkV1gckNERERERHaByQ0REREREdkFJjdERERERGQXmNwQEREREZFdYHJDRERERER2gckNERERERHZBSY3RERERERkF5jcEBERERGRXXCydQBE9k4QBOTn5+PKlSvw8vKCn58fRCKRrcOi6/ActS08X20DzxMR2QJnbogsxGAwYM2aNRg4oC86deqEgIAAdOrUCQMH9MWaNWtgMBhsHWK7V3OOBgwYUOscDRgwoNWcI4VCYesQWg3j+erfr/b56t/PpueL56i2mvPUv3/tsa9/f459RGR5IkEQBFsHQWRvdu7ciYiImSgpKcHMMGDmBAG+3kBBIbDlGxG2ZAAeHh7YvHkLJk6caPF4DAYDEhMToVQqLd5XW1F9jiJQUlKCMWPGYMyYMfDy8sKVK1ewZ88e7Nmz53/naLNVzlFDFAoF0tPTbdZ/a7Fz505EKMJRUlKC8QPFGD/AB97ujigsrcTuY5ex+6ih+nylq61+vniO/rFz504oFOEoLilB4FBPSId4wNXDAVdLqqD7rQQ5h4rh6eGBdBucJyJqH5jcEJnZzp07cdddUzFxpICNy6twU6e6bc5dBOY954Cd+0T44osvzfJLXqPRQKVSGS+ykpOTkZOTA4PBgMDAQKSlpSE2NhYxMTE39P0ikQj2MlxUn6O7EBISgiVLlsDPz69Om/z8fLzyyivIzMzEF198YZZzlJycbEwww8PDoVQqjedNIpFALBZDqVRCp9NBoVBALpdDo9EgOzu72X3Z3/maitukHfDc3T3Q0cu5TptLV65h+ednsF9XZJafKbVajcTERBgMBsjlcqhUqlrnKj4+vsXnCLDP89S9nzvGRvjB07vuyvfiwgp8tzkffx0vbfF5CgoKgsFggFQqBQDo9XokJCQgPDz8hr+zKQaDAb6+vigoKIBYLG5xOyIyPz5zQ2RGBoMBEREzMXGkgG1rq+DUwE/YTZ2AbWurcO9iB0REzMSpU3+16BegQqGAwWCATqczHsvJyQEAxMfHQyKRID8//4YTG3tSfY4iEBISguXLl8OpgZPk5+eH5cuX47nnnkNERAROnTrVonOk0+mQkZFhTDiDgoIQGBgIqVSKkJAQxMXFISwsDACMSapUKjUea68MBgMiFOG4TdoBr0YGwMmh/mc2Ono549XIADyVlosIRThOnT5zw+fLYDAgLS3NmLAEBgZCrVYbv0+lUiE+Pp7n6DoGgwEKRTi693PH5Ic6w8Gx/vPk6e2EyQ91xo53L0ChCMfpFpwnAFAqlcZkpubnSiqVQiaT3fB3NkYsFiM7O7vJmE1tR0Tmx2duiMzo/fffR0lJCTYubzixqeHkBKS8WIWSkhJ88MEHLeo3PT29zpIzpVKJyMhIY+JD1WrO0ZIlSxpMbGo4OTlhyZIlZjlHBoMBCQkJAKovfGJjY5GRkWF8TfWrOV/P3d2jwcSmhpODCM/e1aPF50ssFtdaZlYzMwCAiUwD3n//fRSXlGBshF+DiU0NB0cRxkb4odgMP1fXE4vFxpk0SzI1cbJUgkVEjWNyQ2QmgiBgw/o3MTMM9S5Fq0/XzsAMObB+3RtmX5qSlJQElUoFqVSK3r17Q6vVIj4+vtHPBAYGIj4+HoGBgfD19YVWq623nUKhQGBgIAIDA2tdSGg0GuPxmiUjQPUSn5rjarXabP8fm0sQBKxfvx6jR4+udylaffz8/DB69GisW7euRedIJpPVudiRSCT1to2NjUVsbCySk5Mb/c52cb7WrcX4AeJ6l6LVp1MHZ4wb4IN1a980y8+UWq1GVlYW5HJ5reOmniOgfZyndeveROBQz3qXotXH09sJ0iGeWLvWfGOfRqPB5s2bjTM5Df37+Pr6IikpyTh7qtFooFAo4OvrW2uMbOh8XF/x7d/fdf3suantkpOTERQUhKCgICgUilrnmIhugEBEZnHx4kUBgLB5NQThqOl/0l6DAEC4dOlSi/rPzs4WpFJpi74DgJCRkSEIgiAolcpa33f9cFHTJjs7WxCLxYIgCEJOTo4gFouFgoIC4+vr46o5LpfLWxRjS9Sco+eff1747rvvTP7z3//+1yznqEZBQYEglUqN/0Y3qr2cr1XhAUL2f2Um/0kMDzDL+ZLL5YJYLBaUSmWLvqe9nKeJD3QRFr0WaPKfCQ90adF5kslkglgsNv6vXC43/ns09u8DQEhPTxcEQRDCw8ON/9YFBQVNno+azzf0Xdf/t2JKu4KCAuN3Z2dn2/Q8EtkLztwQmcmVK1cAAL7ezftcTfuioiIzR3Rjau5Qx8XFQafT1XsHsaaNTCaDwWCAwWCAWq1GRESEcYlVzVKetLQ0ANV3QcPCwqDT6Sy+bKQhNefIy8urWZ/r0KEDAPOdo5rqWtcvd7pR7eF8ebs7Nutz3m7V7Vt6vjIyMlBQUICMjAyTZmga0x7Ok6tH8y4p3Nyr27fkPKWkpCA7Oxvp6enQ6XTGf6em/n1q/q1DQkKMfxeLxRCLxcZzU9/5qM/131XzrGNz2l0/g6vX6039v05EDWBBASIzqblgLihs3udq2tdcQLc29T0PkpSUhMzMTJM+7+fnZ6wMZms156jmYsxUNRdf5jhHCoUCSqXSog88/1tbP1+FpZXN+lxhWXV7c/1MhYWFQaVSmbUghz2ep6slVc36XFlpdXtznCe5XA6pVIqkpCTExcU1+e9z/b9/Q8tDTT0fpj4zV1+7moQqKCgIQHWyRkQtw5kbIjPx8/ND/36B2PJN83bg3vKNCP37BTb4C9baap4HSEpKqvcCXK1WIyMjA+np6bV+EYeHh2Pz5s3Gu5s1d6fDw8OhVqvrHLcFPz8/9OvXD3v27GnW5/bs2YN+/fq1+BwpFAokJCSYNbGx+/PVtw92H7vcrM/tPmpAv759bvh8qdXqWs9oZGRk1Hnmprns/Tz17RsI3W8lzfqc7lAJ+vY139inUqmM5btb+u/T0Pkwt5pS1tnZ2cjOzmYRAiIzYHJDZCYikQgLFj6KLRnV+9iY4uwFYKsGWLjosVoPnzZXbGwsFAoFdDodgoKCWvRwsUqlQlBQENLS0urdmFAulxv7iY6ONi6TkUqlSElJMT4wGxsbC71eD6lUCqVSidDQUAQFBSE2NvaGY2spkUiEhQsXYs+ePcjPzzfpM/n5+di7dy8WLVrUonNUc8EcGhoKX19f+Pr6mmVne7s/X4sWY/dRAy5duWbSZy4WXcO3xy5j0eJHb/h8hYeHIzMzs1a57pbOkNj7eVq06FHkHCpGcWGFSZ8pLqyA7rdiLF7csrHvelKpFBEREYiPj2/xv09D58PcxGIx1Go1RCIRfH19ERQU1GDBCSIyDTfxJDIjg8GAXr26Y/Tw0kb3uQGAigrg3sUO2HvAvcX73JiLPW0o2JDqc9QLgwcPbnSfGwCoqKjAc889h8OHD7d4nxtLaDfnq2cPDO3q1Og+NwBQUSXgqbRcHDpb0aJ9bsytvZynnj17wK8HGt3nBgCqKgV8/e4FXDqDFu9z09bFx8fDz88PcXFxAKorvsXGxjb67A4RNY4zN0RmJBaLsXnzFuzcJ8K9ix1w9kL97c5eqE5sdu4TIT19a7v+5W5t1edoMzIzM/Hcc881OIOTn5+P5557DpmZmUhPT+c5shGxWIzN6Wrs1xXhqbRcXCyqfwbnYtE1PJWWi/26IqSrt/B8WVn13kBq/HW8FDvevdDgDE5xYQV2vHs
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 830x456.5 with 6 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
2024-10-07 20:16:35 +00:00
|
|
|
"import matplotlib.lines as mlines\n",
|
|
|
|
"\n",
|
|
|
|
"plot_smoothed = True\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
"\n",
|
2024-10-02 17:07:30 +00:00
|
|
|
"\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
"def make_colours(y, n, k):\n",
|
|
|
|
" sorted_indices = np.argsort(y[n, k])[::-1] # Sort in descending order\n",
|
|
|
|
" # Initialize colors to gray\n",
|
|
|
|
" colors = ['olivedrab'] * len(y[n, k])\n",
|
|
|
|
"\n",
|
|
|
|
" # Assign specific colors to top 3 values\n",
|
|
|
|
" if len(sorted_indices) >= 1:\n",
|
|
|
|
" colors[sorted_indices[0]] = '#FFD700' # Highest value gets gold\n",
|
|
|
|
" if len(sorted_indices) >= 2:\n",
|
|
|
|
" colors[sorted_indices[1]] = '#C0C0C0' # Second highest gets silver\n",
|
|
|
|
" if len(sorted_indices) >= 3:\n",
|
|
|
|
" colors[sorted_indices[2]] = \"#CD7F32\" # Third highest gets bronze\n",
|
|
|
|
" return colors\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
" figwidth = 8.3\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
" fig, axs = plt.subplots(2, 3, figsize=(figwidth, 0.55 * figwidth))\n",
|
|
|
|
" fig.subplots_adjust(hspace=0, wspace=0)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
|
|
|
" x = np.arange(len(sims))\n",
|
|
|
|
" y = y_lnZ\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" for n in range(len(catalogues)):\n",
|
|
|
|
" i, j = n // 3, n % 3\n",
|
|
|
|
" ax = axs[i, j]\n",
|
|
|
|
"\n",
|
2024-10-07 20:16:35 +00:00
|
|
|
" ax.text(0.025, 1.075, catalogue_to_pretty(catalogues[n]),\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
" transform=ax.transAxes,\n",
|
|
|
|
" verticalalignment='center', horizontalalignment='left',\n",
|
2024-10-07 20:16:35 +00:00
|
|
|
" bbox=dict(facecolor='white', alpha=0.85, edgecolor='none', pad=3),\n",
|
|
|
|
" zorder=5)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-10-07 20:16:35 +00:00
|
|
|
" k = 0 if not plot_smoothed else 1\n",
|
|
|
|
" colors = make_colours(y, n, k)\n",
|
|
|
|
" ax.scatter(x, y[n, k], c=colors, s=75, zorder=-1, marker=\"o\", edgecolors=\"k\")\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
|
|
|
" for i in range(3):\n",
|
|
|
|
" axs[1, i].set_xticks(\n",
|
|
|
|
" np.arange(len(sims)),\n",
|
2024-09-26 15:03:47 +00:00
|
|
|
" [simname_to_pretty(sim) for sim in sims], rotation=66,)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" axs[0, i].set_xticks([], [])\n",
|
|
|
|
"\n",
|
|
|
|
" for i in range(2):\n",
|
|
|
|
" for j in range(3):\n",
|
|
|
|
" axs[i, j].set_xlim(-0.75, len(sims) - 0.25)\n",
|
|
|
|
"\n",
|
|
|
|
" axs[i, j].tick_params(axis='x', which='major', top=False)\n",
|
|
|
|
" axs[i, j].tick_params(axis='x', which='minor', top=False, length=0)\n",
|
|
|
|
" axs[i, j].tick_params(axis='y', which='minor', length=0)\n",
|
|
|
|
"\n",
|
2024-10-07 20:16:35 +00:00
|
|
|
" if plot_smoothed:\n",
|
|
|
|
" axs[i, 0].set_ylabel(r\"$\\Delta \\log_{10} \\mathcal{Z}_{\\rm smoothed}$\")\n",
|
|
|
|
" else:\n",
|
|
|
|
" axs[i, 0].set_ylabel(r\"$\\log_{10} \\mathcal{Z}$\")\n",
|
|
|
|
"\n",
|
|
|
|
" kwargs = {\"marker\": \"o\", \"linestyle\": \"None\", \"markersize\": 10, \"markeredgecolor\": \"k\"}\n",
|
|
|
|
" gold_circle = mlines.Line2D([], [], color='#FFD700', **kwargs, label=r'1\\textsuperscript{st} place')\n",
|
|
|
|
" silver_circle = mlines.Line2D([], [], color='#C0C0C0', **kwargs, label=r'2\\textsuperscript{nd} place')\n",
|
|
|
|
" bronze_circle = mlines.Line2D([], [], color='#CD7F32', **kwargs, label=r'3\\textsuperscript{rd} place')\n",
|
|
|
|
" olive_circle = mlines.Line2D([], [], color='olivedrab', **kwargs, label=r'Remaining')\n",
|
|
|
|
"\n",
|
|
|
|
" fig.legend(handles=[gold_circle, silver_circle, bronze_circle, olive_circle], \n",
|
|
|
|
" loc='upper center', bbox_to_anchor=(0.5, 1.05), ncol=4, frameon=False)\n",
|
|
|
|
"\n",
|
|
|
|
" fig.tight_layout()\n",
|
|
|
|
" fname = \"../../plots/lnZ_comparison.pdf\"\n",
|
|
|
|
" if plot_smoothed:\n",
|
|
|
|
" fname = fname.replace(\".pdf\", \"_smoothed.pdf\")\n",
|
|
|
|
" fig.savefig(fname, dpi=500, bbox_inches='tight')\n",
|
|
|
|
" fig.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Evidence plot for Harry's talk"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"zcmb_max = 0.05\n",
|
|
|
|
"\n",
|
|
|
|
"sims = [\"Carrick2015\", \"Lilow2024\", \"manticore_2MPP_N128_DES_V1\", \"CF4\", \"CLONES\"]\n",
|
|
|
|
"catalogues = [\"CF4_TFR_w1\"]\n",
|
|
|
|
"\n",
|
|
|
|
"y_BIC = np.full((len(catalogues), 2, len(sims)), np.nan)\n",
|
|
|
|
"y_lnZ = np.full_like(y_BIC, np.nan)\n",
|
|
|
|
"\n",
|
|
|
|
"for i, catalogue in enumerate(catalogues):\n",
|
|
|
|
" for j in [0, 1]:\n",
|
|
|
|
" for k, simname in enumerate(sims):\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, simname, catalogue, inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=simname != \"IndranilVoid_exp\",\n",
|
|
|
|
" zcmb_max=zcmb_max, smooth=j)\n",
|
|
|
|
"\n",
|
|
|
|
" # y_BIC[i, j] = get_gof(\"BIC\", fname)z\n",
|
|
|
|
" y_lnZ[i, j, k] = - get_gof(\"neg_lnZ_harmonic\", fname) / np.log(10)\n",
|
|
|
|
"\n",
|
|
|
|
" y_lnZ[i, j] -= y_lnZ[i, j].min()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
" fig, ax = plt.subplots(1, 1)\n",
|
|
|
|
"\n",
|
|
|
|
" x = np.arange(len(sims))\n",
|
|
|
|
" y = y_lnZ\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
" ax.text(0.025, 1.075, catalogue_to_pretty(catalogues[0]),\n",
|
|
|
|
" transform=ax.transAxes,\n",
|
|
|
|
" verticalalignment='center', horizontalalignment='left',\n",
|
|
|
|
" bbox=dict(facecolor='white', alpha=0.85, edgecolor='none', pad=3),\n",
|
|
|
|
" zorder=5)\n",
|
|
|
|
"\n",
|
|
|
|
" k = 0\n",
|
|
|
|
" colors = make_colours(y, 0, k)\n",
|
|
|
|
" ax.scatter(x, y[0, k], c=colors, s=75, zorder=-1, marker=\"o\", edgecolors=\"k\")\n",
|
|
|
|
"\n",
|
|
|
|
" labels = [simname_to_pretty(sim) for sim in sims]\n",
|
|
|
|
" j = sims.index(\"manticore_2MPP_N128_DES_V1\")\n",
|
|
|
|
" labels[j] = r\"CSiBORG2\"\n",
|
|
|
|
" ax.set_xticks(\n",
|
|
|
|
" np.arange(len(sims)),\n",
|
|
|
|
" labels, rotation=30,)\n",
|
|
|
|
" # ax.set_xticks([], [])\n",
|
|
|
|
"\n",
|
|
|
|
" ax.set_xlim(-0.75, len(sims) - 0.25)\n",
|
|
|
|
"\n",
|
|
|
|
" ax.tick_params(axis='x', which='major', top=False)\n",
|
|
|
|
" ax.tick_params(axis='x', which='minor', top=False, length=0)\n",
|
|
|
|
" ax.tick_params(axis='y', which='minor', length=0)\n",
|
|
|
|
"\n",
|
|
|
|
" ax.set_ylabel(r\"$\\Delta \\log_{10} \\mathcal{Z}$\")\n",
|
|
|
|
"\n",
|
|
|
|
" kwargs = {\"marker\": \"o\", \"linestyle\": \"None\", \"markersize\": 10, \"markeredgecolor\": \"k\"}\n",
|
|
|
|
" gold_circle = mlines.Line2D([], [], color='#FFD700', **kwargs, label=r'1\\textsuperscript{st} place')\n",
|
|
|
|
" silver_circle = mlines.Line2D([], [], color='#C0C0C0', **kwargs, label=r'2\\textsuperscript{nd} place')\n",
|
|
|
|
" bronze_circle = mlines.Line2D([], [], color='#CD7F32', **kwargs, label=r'3\\textsuperscript{rd} place')\n",
|
|
|
|
" olive_circle = mlines.Line2D([], [], color='olivedrab', **kwargs, label=r'Remaining')\n",
|
|
|
|
"\n",
|
|
|
|
" fig.legend(handles=[gold_circle, silver_circle, bronze_circle, olive_circle], \n",
|
|
|
|
" loc='upper center', bbox_to_anchor=(0.7, 1.075), ncol=2, frameon=False)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" fig.tight_layout()\n",
|
2024-10-07 20:16:35 +00:00
|
|
|
" fname = \"../../plots/logZ_harry.pdf\"\n",
|
|
|
|
" # if plot_smoothed:\n",
|
|
|
|
" # fname = fname.replace(\".pdf\", \"_smoothed.pdf\")\n",
|
|
|
|
" fig.savefig(fname, dpi=500, bbox_inches='tight')\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
" fig.show()"
|
|
|
|
]
|
|
|
|
},
|
2024-10-07 20:16:35 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
2024-07-01 10:48:50 +00:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-09-11 06:45:42 +00:00
|
|
|
"### 2. Dependence of the evidence on smoothing scale"
|
2024-07-01 10:48:50 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-18 22:42:17 +00:00
|
|
|
"execution_count": null,
|
2024-09-17 20:01:15 +00:00
|
|
|
"metadata": {},
|
2024-09-18 22:42:17 +00:00
|
|
|
"outputs": [],
|
2024-07-01 10:48:50 +00:00
|
|
|
"source": [
|
2024-09-11 06:45:42 +00:00
|
|
|
"zcmb_max = 0.05\n",
|
|
|
|
"\n",
|
|
|
|
"ksmooth = [0, 1, 2, 3, 4]\n",
|
|
|
|
"scales = [0, 2, 4, 6, 8]\n",
|
|
|
|
"sims = [\"Carrick2015\", \"csiborg2_main\"]\n",
|
|
|
|
"catalogues = [\"2MTF\", \"SFI_gals\", \"CF4_TFR_i\"]\n",
|
|
|
|
"\n",
|
|
|
|
"y = np.full((len(sims), len(catalogues), len(ksmooth)), np.nan)\n",
|
|
|
|
"for i, simname in enumerate(sims):\n",
|
|
|
|
" for j, catalogue in enumerate(catalogues):\n",
|
|
|
|
" for n, k in enumerate(ksmooth):\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, simname, catalogue, inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=True, smooth=k,\n",
|
|
|
|
" zcmb_max=zcmb_max)\n",
|
|
|
|
" if not exists(fname):\n",
|
|
|
|
" raise FileNotFoundError(fname)\n",
|
|
|
|
"\n",
|
|
|
|
" y[i, j, n] = get_gof(\"neg_lnZ_harmonic\", fname)\n",
|
|
|
|
"\n",
|
|
|
|
" y[i, j, :] -= y[i, j, :].min()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-18 22:42:17 +00:00
|
|
|
"execution_count": null,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 22:42:17 +00:00
|
|
|
"outputs": [],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
|
|
|
"for i, simname in enumerate(sims):\n",
|
|
|
|
" for j, catalogue in enumerate(catalogues):\n",
|
|
|
|
" print(simname, catalogue, y[i, j, -1])"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-18 22:42:17 +00:00
|
|
|
"execution_count": null,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 22:42:17 +00:00
|
|
|
"outputs": [],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
" cols = plt.rcParams['axes.prop_cycle'].by_key()['color']\n",
|
|
|
|
" plt.figure()\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" ls = [\"-\", \"--\", \"-.\", \":\"]\n",
|
|
|
|
" for i, simname in enumerate(sims):\n",
|
|
|
|
" for j, catalogue in enumerate(catalogues):\n",
|
|
|
|
" plt.plot(scales, y[i, j], marker='o', ms=2.5, ls=ls[i],\n",
|
|
|
|
" label=catalogue_to_pretty(catalogue) if i == 0 else None, c=cols[j],)\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" plt.xlabel(r\"$R_{\\rm smooth} ~ [\\mathrm{Mpc} / h]$\")\n",
|
|
|
|
" plt.ylabel(r\"$-\\Delta \\ln \\mathcal{Z}$\")\n",
|
2024-09-18 13:20:39 +00:00
|
|
|
" plt.xlim(0)\n",
|
|
|
|
" plt.ylim(0)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" plt.legend()\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" plt.tight_layout()\n",
|
|
|
|
" plt.savefig(\"../../plots/smoothing_comparison.pdf\", dpi=450)\n",
|
|
|
|
" plt.show()\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-09-12 15:04:25 +00:00
|
|
|
"### 3. External flow consistency"
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-18 22:42:17 +00:00
|
|
|
"execution_count": null,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 22:42:17 +00:00
|
|
|
"outputs": [],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
2024-09-12 15:04:25 +00:00
|
|
|
"sims = [\"Carrick2015\", \"Lilow2024\", \"csiborg2_main\", \"csiborg2X\", \"CF4\", \"CLONES\"]\n",
|
|
|
|
"# sims = [\"Carrick2015\", \"Lilow2024\", \"CF4\", \"csiborg2_main\", \"csiborg2X\"]\n",
|
|
|
|
"# cats = [[\"LOSS\", \"Foundation\"], \"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"cats = [\"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
"# cats = [\"2MTF\", \"SFI_gals\", \"CF4_TFR_not2MTForSFI_i\"]\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
"X = {}\n",
|
|
|
|
"\n",
|
|
|
|
"for sim in sims:\n",
|
|
|
|
" for cat in cats:\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, sim, cat, inference_method=\"bayes\",\n",
|
|
|
|
" sample_alpha=True, zcmb_max=0.05)\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" if not exists(fname):\n",
|
|
|
|
" raise FileNotFoundError(fname)\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" with File(fname, 'r') as f:\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" X[f\"{sim}_{cat}\"] = np.linalg.norm(f[f\"samples/Vext\"][...], axis=1)"
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-18 22:42:17 +00:00
|
|
|
"execution_count": null,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 22:42:17 +00:00
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"fname = paths.flow_validation(\n",
|
|
|
|
" fdir, \"CF4\", \"CF4_TFR_i\", inference_method=\"bayes\",\n",
|
|
|
|
" sample_alpha=True, zcmb_max=0.05)\n",
|
|
|
|
"\n",
|
|
|
|
"with File(fname, 'r') as f:\n",
|
|
|
|
" x = f[\"samples/Vext\"][...]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
"\n",
|
2024-09-18 13:20:39 +00:00
|
|
|
" fig, axs = plt.subplots(2, 2, figsize=(3.5, 2.65 * 1.25))\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" fig.subplots_adjust(hspace=0, wspace=0)\n",
|
|
|
|
"\n",
|
|
|
|
" for k, cat in enumerate(cats):\n",
|
|
|
|
" i, j = k // 2, k % 2\n",
|
|
|
|
" ax = axs[i, j]\n",
|
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" for sim in sims:\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" sns.kdeplot(X[f\"{sim}_{cat}\"], fill=True, bw_adjust=0.75, ax=ax,\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" label=simname_to_pretty(sim) if i == 0 else None)\n",
|
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" ax.text(0.725, 0.85, catalogue_to_pretty(cat),\n",
|
|
|
|
" transform=ax.transAxes, fontsize=\"small\",\n",
|
|
|
|
" verticalalignment='center', horizontalalignment='center',\n",
|
|
|
|
" bbox=dict(facecolor='white', alpha=0.5, edgecolor='none'))\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" ax.set_ylabel(None)\n",
|
|
|
|
" ax.set_yticklabels([])\n",
|
|
|
|
" ax.set_xlim(0)\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" handles, labels = axs[0, 0].get_legend_handles_labels()\n",
|
|
|
|
" fig.legend(handles, labels, loc='upper center', bbox_to_anchor=(0.5, 1.1),\n",
|
|
|
|
" ncol=3)\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" for i in range(2):\n",
|
|
|
|
" axs[-1, i].set_xlabel(r\"$|\\mathbf{V}_{\\rm ext}| ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
" axs[i, 0].set_ylabel(\"Normalised PDF\")\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" fig.tight_layout()\n",
|
|
|
|
" fig.savefig(f\"../../plots/Vext_comparison.pdf\", dpi=450)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" fig.show()"
|
2024-07-01 10:48:50 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-09-12 15:04:25 +00:00
|
|
|
"### 4. What $\\beta$ is preferred by the data? "
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-17 09:26:04 +00:00
|
|
|
"execution_count": null,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-17 09:26:04 +00:00
|
|
|
"outputs": [],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
2024-09-12 15:04:25 +00:00
|
|
|
"sims = [\"Lilow2024\", \"csiborg2_main\", \"csiborg2X\", \"CF4\", \"CLONES\"]\n",
|
|
|
|
"cats = [\"LOSS\", \"Foundation\", \"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
|
|
|
"# cats = [\"2MTF\", \"SFI_gals\", \"CF4_TFR_not2MTForSFI_i\"]\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
"X = {}\n",
|
|
|
|
"for sim in sims:\n",
|
|
|
|
" for cat in cats:\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, sim, cat, inference_method=\"bayes\",\n",
|
|
|
|
" sample_alpha=True, zcmb_max=0.05, sample_beta=True)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" if not exists(fname):\n",
|
|
|
|
" raise FileNotFoundError(fname)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" with File(fname, 'r') as f:\n",
|
|
|
|
" X[f\"{sim}_{cat}\"] = f[f\"samples/beta\"][...]"
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-17 09:26:04 +00:00
|
|
|
"execution_count": null,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-17 09:26:04 +00:00
|
|
|
"outputs": [],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
|
|
|
"with plt.style.context('science'):\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" fig, axs = plt.subplots(3, 2, figsize=(3.5, 2.65 * 1.8))\n",
|
|
|
|
" fig.subplots_adjust(hspace=0, wspace=0)\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" for k, cat in enumerate(cats):\n",
|
|
|
|
" i, j = k // 2, k % 2\n",
|
|
|
|
" ax = axs[i, j]\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" for sim in sims:\n",
|
|
|
|
" sns.kdeplot(X[f\"{sim}_{cat}\"], fill=True, bw_adjust=0.75, ax=ax,\n",
|
|
|
|
" label=simname_to_pretty(sim) if i == 0 else None)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" ax.text(0.1, 0.85, catalogue_to_pretty(cat),\n",
|
|
|
|
" transform=ax.transAxes, fontsize=\"small\",\n",
|
|
|
|
" verticalalignment='center', horizontalalignment='left',\n",
|
|
|
|
" bbox=dict(facecolor='white', alpha=0.5, edgecolor='k')\n",
|
|
|
|
" )\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" ax.axvline(1, c=\"k\", ls=\"--\", alpha=0.75)\n",
|
|
|
|
" ax.set_ylabel(None)\n",
|
|
|
|
" ax.set_yticklabels([])\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" handles, labels = axs[0, 0].get_legend_handles_labels()\n",
|
|
|
|
" fig.legend(handles, labels, loc='upper center', bbox_to_anchor=(0.5, 1.075),\n",
|
|
|
|
" ncol=3)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" # for i in range(3):\n",
|
|
|
|
" for j in range(2):\n",
|
|
|
|
" axs[-1, j].set_xlabel(r\"$\\beta$\")\n",
|
|
|
|
"\n",
|
|
|
|
" for i in range(3):\n",
|
|
|
|
" axs[i, 0].set_ylabel(\"Normalised PDF\")\n",
|
|
|
|
"\n",
|
|
|
|
" fig.tight_layout()\n",
|
|
|
|
" fig.savefig(f\"../../plots/beta_comparison.pdf\", dpi=450)\n",
|
|
|
|
" fig.show()"
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-09-18 22:42:17 +00:00
|
|
|
"### What $\\sigma_v$ is preferred by the data?"
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-10-07 20:16:35 +00:00
|
|
|
"execution_count": null,
|
2024-09-18 22:42:17 +00:00
|
|
|
"metadata": {},
|
2024-10-07 20:16:35 +00:00
|
|
|
"outputs": [],
|
2024-09-18 22:42:17 +00:00
|
|
|
"source": [
|
2024-10-02 17:07:30 +00:00
|
|
|
"sims = [\"Carrick2015\", \"Lilow2024\", \"csiborg2_main\", \"csiborg2X\", \"manticore_2MPP_N128_DES_V1\", \"CF4\", \"CLONES\"]\n",
|
2024-09-18 22:42:17 +00:00
|
|
|
"cats = [\"LOSS\", \"Foundation\", \"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
|
|
|
"# cats = [\"2MTF\", \"SFI_gals\", \"CF4_TFR_not2MTForSFI_i\"]\n",
|
|
|
|
"\n",
|
|
|
|
"X = {}\n",
|
|
|
|
"for sim in sims:\n",
|
|
|
|
" for cat in cats:\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
2024-10-02 17:07:30 +00:00
|
|
|
" fdir, sim, cat, inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=True, zcmb_max=0.05, smooth=1)\n",
|
2024-09-18 22:42:17 +00:00
|
|
|
"\n",
|
|
|
|
" if not exists(fname):\n",
|
|
|
|
" raise FileNotFoundError(fname)\n",
|
|
|
|
"\n",
|
|
|
|
" with File(fname, 'r') as f:\n",
|
|
|
|
" X[f\"{sim}_{cat}\"] = f[f\"samples/sigma_v\"][...]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-10-07 20:16:35 +00:00
|
|
|
"execution_count": null,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-10-07 20:16:35 +00:00
|
|
|
"outputs": [],
|
2024-09-18 22:42:17 +00:00
|
|
|
"source": [
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
" fig, axs = plt.subplots(3, 2, figsize=(3.5, 2.65 * 1.8))\n",
|
|
|
|
" fig.subplots_adjust(hspace=0, wspace=0)\n",
|
|
|
|
"\n",
|
|
|
|
" for k, cat in enumerate(cats):\n",
|
|
|
|
" i, j = k // 2, k % 2\n",
|
|
|
|
" ax = axs[i, j]\n",
|
|
|
|
"\n",
|
|
|
|
" for sim in sims:\n",
|
|
|
|
" sns.kdeplot(X[f\"{sim}_{cat}\"], fill=True, bw_adjust=0.75, ax=ax,\n",
|
|
|
|
" label=simname_to_pretty(sim) if i == 0 else None)\n",
|
|
|
|
"\n",
|
|
|
|
" ax.text(0.9, 0.85, catalogue_to_pretty(cat),\n",
|
|
|
|
" transform=ax.transAxes, fontsize=\"small\",\n",
|
|
|
|
" verticalalignment='center', horizontalalignment='right',\n",
|
|
|
|
" # bbox=dict(facecolor='white', alpha=0.5, edgecolor='k')\n",
|
|
|
|
" )\n",
|
|
|
|
"\n",
|
|
|
|
" ax.set_ylabel(None)\n",
|
|
|
|
" ax.set_yticklabels([])\n",
|
|
|
|
"\n",
|
|
|
|
" xmin = ax.get_xlim()[0]\n",
|
|
|
|
" if xmin < 0:\n",
|
|
|
|
" ax.set_xlim(0)\n",
|
|
|
|
"\n",
|
|
|
|
" handles, labels = axs[0, 0].get_legend_handles_labels()\n",
|
|
|
|
" fig.legend(handles, labels, loc='upper center', bbox_to_anchor=(0.5, 1.075),\n",
|
|
|
|
" ncol=3)\n",
|
|
|
|
"\n",
|
|
|
|
" # for i in range(3):\n",
|
|
|
|
" for j in range(2):\n",
|
|
|
|
" axs[-1, j].set_xlabel(r\"$\\sigma_v ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
"\n",
|
|
|
|
" for i in range(3):\n",
|
|
|
|
" axs[i, 0].set_ylabel(\"Normalised PDF\")\n",
|
|
|
|
"\n",
|
|
|
|
" fig.tight_layout()\n",
|
|
|
|
" fig.savefig(f\"../../plots/sigmav_comparison.pdf\", dpi=450)\n",
|
|
|
|
" fig.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### 5. Bulk flow in the simulation rest frame "
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-25 13:30:06 +00:00
|
|
|
"execution_count": null,
|
2024-09-18 22:42:17 +00:00
|
|
|
"metadata": {},
|
2024-09-25 13:30:06 +00:00
|
|
|
"outputs": [],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
2024-09-21 12:48:23 +00:00
|
|
|
"sims = [\"Carrick2015\", \"Lilow2024\", \"csiborg2_main\", \"csiborg2X\", \"manticore_2MPP_N128_DES_V1\", \"CLONES\", \"CF4\"]\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
" cols = plt.rcParams['axes.prop_cycle'].by_key()['color']\n",
|
|
|
|
"\n",
|
|
|
|
" plt.figure()\n",
|
|
|
|
" for i, sim in enumerate(sims):\n",
|
|
|
|
" r, B = get_bulkflow_simulation(sim, convert_to_galactic=True)\n",
|
|
|
|
" B = B[..., 0]\n",
|
|
|
|
"\n",
|
|
|
|
" if sim == \"Carrick2015\":\n",
|
|
|
|
" B *= 0.43\n",
|
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" if sim in [\"Carrick2015\", \"Lilow2024\", \"CLONES\"]:\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" plt.plot(r, B[0], label=simname_to_pretty(sim), color=cols[i])\n",
|
|
|
|
" else:\n",
|
|
|
|
" ylow, yhigh = np.percentile(B, [16, 84], axis=0)\n",
|
|
|
|
" plt.fill_between(r, ylow, yhigh, alpha=0.5,\n",
|
|
|
|
" label=simname_to_pretty(sim), color=cols[i])\n",
|
|
|
|
"\n",
|
|
|
|
" plt.xlabel(r\"$R ~ [\\mathrm{Mpc} / h]$\")\n",
|
2024-09-18 13:20:39 +00:00
|
|
|
" plt.ylabel(r\"$|\\mathbf{B}_{\\rm sim}| ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" plt.xlim(5, 200)\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" plt.legend(ncols=2)\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
|
|
|
" plt.tight_layout()\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" plt.savefig(\"../../plots/bulkflow_simulations_restframe.pdf\", dpi=450)\n",
|
|
|
|
" plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-09-12 15:04:25 +00:00
|
|
|
"### 6. Bulk flow in the CMB frame"
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-18 22:42:17 +00:00
|
|
|
"execution_count": null,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 22:42:17 +00:00
|
|
|
"outputs": [],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
2024-09-16 10:12:32 +00:00
|
|
|
"sims = [\"Carrick2015\", \"Lilow2024\", \"csiborg2_main\", \"csiborg2X\", \"CLONES\", \"CF4\"]\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"# cats = [[\"LOSS\", \"Foundation\"], \"2MTF\", \"SFI_gals\", \"CF4_TFR_i\"]\n",
|
|
|
|
"cats = [\"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"data = {}\n",
|
|
|
|
"for sim in sims:\n",
|
|
|
|
" for cat in cats:\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, sim, cat, inference_method=\"bayes\",\n",
|
|
|
|
" sample_alpha=True, zcmb_max=0.05)\n",
|
|
|
|
" data[f\"{sim}_{cat}\"] = get_bulkflow(fname, sim)\n",
|
|
|
|
"\n",
|
|
|
|
"def get_ax_centre(ax):\n",
|
|
|
|
" # Get the bounding box of the specific axis in relative figure coordinates\n",
|
|
|
|
" bbox = ax.get_position()\n",
|
|
|
|
"\n",
|
|
|
|
" # Extract the position and size of the axis\n",
|
|
|
|
" x0, y0, width, height = bbox.x0, bbox.y0, bbox.width, bbox.height\n",
|
|
|
|
"\n",
|
|
|
|
" # Calculate the center of the axis\n",
|
|
|
|
" center_x = x0 + width / 2\n",
|
|
|
|
" center_y = y0 + height / 2\n",
|
|
|
|
" return center_x, center_y"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-18 22:42:17 +00:00
|
|
|
"execution_count": null,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 22:42:17 +00:00
|
|
|
"outputs": [],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
" nrows = len(sims)\n",
|
|
|
|
" ncols = 3\n",
|
|
|
|
"\n",
|
|
|
|
" figwidth = 8.3\n",
|
2024-09-18 13:20:39 +00:00
|
|
|
" fig, axs = plt.subplots(nrows, ncols, figsize=(figwidth, 1.15 * figwidth), sharex=True, )\n",
|
|
|
|
" fig.subplots_adjust(hspace=0, wspace=0)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" cols = plt.rcParams['axes.prop_cycle'].by_key()['color']\n",
|
|
|
|
" # fig.suptitle(f\"Calibrated against {catalogue}\")\n",
|
|
|
|
"\n",
|
|
|
|
" for i, sim in enumerate(sims):\n",
|
|
|
|
" for j, catalogue in enumerate(cats):\n",
|
|
|
|
" r, B = data[f\"{sim}_{catalogue}\"]\n",
|
|
|
|
" c = cols[j]\n",
|
|
|
|
" for n in range(3):\n",
|
|
|
|
" ylow, ymed, yhigh = np.percentile(B[..., n], [16, 50, 84], axis=-1)\n",
|
|
|
|
" axs[i, n].fill_between(\n",
|
2024-09-16 10:12:32 +00:00
|
|
|
" r, ylow, yhigh, alpha=0.5, color=c, edgecolor=c,\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" label=catalogue_to_pretty(catalogue) if i == 1 else None)\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
" # CMB-LG velocity\n",
|
2024-09-18 13:20:39 +00:00
|
|
|
" kwargs = {\"color\": \"mediumblue\", \"alpha\": 0.5, \"zorder\": 10}\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" for n in range(len(sims)):\n",
|
|
|
|
" axs[n, 0].fill_between([r.min(), 15.], [627 - 22, 627 - 22], [627 + 22, 627 + 22], label=\"CMB-LG\" if n == 0 else None, **kwargs)\n",
|
|
|
|
" axs[n, 1].fill_between([r.min(), 15.], [276 - 3, 276 - 3], [276 + 3, 276 + 3], **kwargs)\n",
|
|
|
|
" axs[n, 2].fill_between([r.min(), 15.], [30 - 3, 30 - 3], [30 + 3, 30 + 3], **kwargs)\n",
|
|
|
|
"\n",
|
|
|
|
" # LCDM expectation\n",
|
|
|
|
" Rs,mean,std,mode,p05,p16,p84,p95 = np.load(\"/mnt/users/rstiskalek/csiborgtools/data/BulkFlowPlot.npy\")\n",
|
|
|
|
" m = Rs < 175\n",
|
2024-09-18 13:20:39 +00:00
|
|
|
" kwargs = {\"color\": \"black\", \"zorder\": 0, \"alpha\": 0.25}\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" for n in range(len(sims)):\n",
|
|
|
|
" axs[n, 0].fill_between(\n",
|
|
|
|
" Rs[m], p16[m], p84[m],\n",
|
|
|
|
" label=r\"$\\Lambda\\mathrm{CDM}$\" if n == 0 else None, **kwargs)\n",
|
|
|
|
"\n",
|
|
|
|
" for n in range(3):\n",
|
|
|
|
" axs[-1, n].set_xlabel(r\"$R ~ [\\mathrm{Mpc} / h]$\")\n",
|
|
|
|
"\n",
|
|
|
|
" for n in range(len(sims)):\n",
|
|
|
|
" axs[n, 0].set_ylabel(r\"$|\\mathbf{B}| ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
" axs[n, 1].set_ylabel(r\"$\\ell ~ [\\mathrm{deg}]$\")\n",
|
|
|
|
" axs[n, 2].set_ylabel(r\"$b ~ [\\mathrm{deg}]$\")\n",
|
|
|
|
"\n",
|
|
|
|
" for i, sim in enumerate(sims):\n",
|
2024-09-16 10:12:32 +00:00
|
|
|
" ax = axs[i, -1].twinx()\n",
|
|
|
|
" ax.set_ylabel(simname_to_pretty(sim), rotation=270, labelpad=7.5)\n",
|
|
|
|
" ax.set_yticklabels([])\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-18 13:20:39 +00:00
|
|
|
" # Watkins numbers\n",
|
|
|
|
" # for n in range(len(sims)):\n",
|
|
|
|
" # rx = 150\n",
|
|
|
|
"\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" axs[0, 0].set_xlim(r.min(), r.max())\n",
|
|
|
|
"\n",
|
|
|
|
" axs[0, 0].legend()\n",
|
|
|
|
" handles, labels = axs[1, 0].get_legend_handles_labels() # get the labels from the first axis\n",
|
2024-09-16 10:12:32 +00:00
|
|
|
" fig.legend(handles, labels, loc='upper center', bbox_to_anchor=(0.5, 0.975), ncol=len(cats) + 2)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-18 13:20:39 +00:00
|
|
|
" fig.tight_layout(rect=[0, 0, 0.95, 0.95], h_pad=0.01)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" fig.savefig(f\"../../plots/bulkflow_CMB.pdf\", dpi=450)\n",
|
|
|
|
" fig.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### 8. Full vs Delta comparison"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"catalogue = \"CF4_TFR_i\"\n",
|
|
|
|
"simname = \"csiborg2X\"\n",
|
|
|
|
"zcmb_max=0.05\n",
|
|
|
|
"sample_beta = True\n",
|
|
|
|
"sample_alpha = True\n",
|
|
|
|
"\n",
|
|
|
|
"fname_bayes = paths.flow_validation(\n",
|
|
|
|
" fdir, simname, catalogue, inference_method=\"bayes\",\n",
|
|
|
|
" sample_alpha=sample_alpha, sample_beta=sample_beta,\n",
|
|
|
|
" zcmb_max=zcmb_max)\n",
|
|
|
|
"\n",
|
|
|
|
"fname_mike = paths.flow_validation(\n",
|
|
|
|
" fdir, simname, catalogue, inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=sample_alpha, sample_beta=sample_beta,\n",
|
|
|
|
" zcmb_max=zcmb_max)\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"X = []\n",
|
|
|
|
"labels = [\"Full posterior\", \"Delta posterior\"]\n",
|
|
|
|
"for i, fname in enumerate([fname_bayes, fname_mike]):\n",
|
|
|
|
" samples = get_samples(fname)\n",
|
|
|
|
" if i == 1:\n",
|
|
|
|
" print(samples.keys())\n",
|
|
|
|
"\n",
|
|
|
|
" X.append(samples_to_getdist(samples, labels[i]))"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"params = [f\"a_{catalogue}\", f\"b_{catalogue}\", f\"c_{catalogue}\", f\"e_mu_{catalogue}\",\n",
|
|
|
|
" \"Vmag\", \"l\", \"b\", \"sigma_v\", \"beta\", f\"alpha_{catalogue}\"]\n",
|
|
|
|
"# params = [\"beta\", f\"a_{catalogue}\", f\"b_{catalogue}\", f\"e_mu_{catalogue}\"]\n",
|
|
|
|
"# params = [\"Vmag\", \"l\", \"b\", \"sigma_v\", \"beta\", f\"mag_cal_{catalogue}\", f\"alpha_cal_{catalogue}\", f\"beta_cal_{catalogue}\", f\"e_mu_{catalogue}\"]\n",
|
|
|
|
"\n",
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 11})\n",
|
|
|
|
" g = plots.get_subplot_plotter()\n",
|
|
|
|
" g.settings.figure_legend_frame = False\n",
|
|
|
|
" g.settings.alpha_filled_add = 0.75\n",
|
|
|
|
" g.settings.fontsize = 12\n",
|
|
|
|
"\n",
|
|
|
|
" g.triangle_plot(X, params=params, filled=True, legend_loc='upper right')\n",
|
|
|
|
" # plt.gcf().suptitle(catalogue_to_pretty(catalogue), y=1.025)\n",
|
|
|
|
" plt.gcf().tight_layout()\n",
|
|
|
|
" plt.gcf().savefig(f\"../../plots/method_comparison_{simname}_{catalogue}.pdf\", dpi=300, bbox_inches='tight')"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
2024-09-12 15:04:25 +00:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## Guilhem plots"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Manticore vs linear comparison"
|
|
|
|
]
|
|
|
|
},
|
2024-09-11 06:45:42 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-17 09:26:04 +00:00
|
|
|
"execution_count": null,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-17 09:26:04 +00:00
|
|
|
"outputs": [],
|
2024-09-12 15:04:25 +00:00
|
|
|
"source": [
|
|
|
|
"zcmb_max = 0.05\n",
|
|
|
|
"\n",
|
|
|
|
"sims = [\"Carrick2015\", \"csiborg2X\"]\n",
|
|
|
|
"catalogues = [\"LOSS\", \"Foundation\", \"2MTF\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
|
|
|
"\n",
|
|
|
|
"y_lnZ = np.full((len(catalogues), len(sims)), np.nan)\n",
|
|
|
|
"\n",
|
|
|
|
"for i, catalogue in enumerate(catalogues):\n",
|
|
|
|
" for j, simname in enumerate(sims):\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, simname, catalogue, inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=simname != \"IndranilVoid_exp\",\n",
|
|
|
|
" zcmb_max=zcmb_max)\n",
|
|
|
|
"\n",
|
|
|
|
" y_lnZ[i, j] = - get_gof(\"neg_lnZ_harmonic\", fname)\n",
|
|
|
|
"\n",
|
|
|
|
" # y_lnZ[i] -= y_lnZ[i].min()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-17 09:26:04 +00:00
|
|
|
"execution_count": null,
|
2024-09-12 15:04:25 +00:00
|
|
|
"metadata": {},
|
2024-09-17 09:26:04 +00:00
|
|
|
"outputs": [],
|
2024-09-12 15:04:25 +00:00
|
|
|
"source": [
|
|
|
|
"bayes_factor = y_lnZ[:, 1] - y_lnZ[:, 0]\n",
|
|
|
|
"\n",
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
"\n",
|
|
|
|
" plt.figure()\n",
|
|
|
|
"\n",
|
2024-09-16 10:12:32 +00:00
|
|
|
" sns.barplot(x=np.arange(len(catalogues)), y=bayes_factor / np.log(10), color=\"#21456D\")\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" plt.xticks(\n",
|
|
|
|
" np.arange(len(catalogues)),\n",
|
|
|
|
" [catalogue_to_pretty(cat) for cat in catalogues],\n",
|
|
|
|
" rotation=35, fontsize=\"small\", minor=False)\n",
|
2024-09-16 10:12:32 +00:00
|
|
|
" plt.ylabel(r\"$\\log \\left(\\mathcal{Z}_{\\rm Manticore} / \\mathcal{Z}_{\\rm linear}\\right)$\")\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" plt.tick_params(axis='x', which='both', bottom=False, top=False)\n",
|
|
|
|
"\n",
|
|
|
|
" plt.tight_layout()\n",
|
|
|
|
" plt.savefig(\"../../plots/manticore_vs_carrick.png\", dpi=450)\n",
|
|
|
|
" plt.show()"
|
|
|
|
]
|
2024-09-11 06:45:42 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## All possible things"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Dipole magnitude"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"cats = [\"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
|
|
|
"sim = \"IndranilVoid_gauss\"\n",
|
|
|
|
"\n",
|
|
|
|
"X = []\n",
|
|
|
|
"for cat in cats:\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, sim, cat, inference_method=\"mike\",\n",
|
|
|
|
" sample_mag_dipole=False,\n",
|
|
|
|
" sample_alpha=False, zcmb_max=0.05)\n",
|
|
|
|
" \n",
|
|
|
|
" if not exists(fname):\n",
|
|
|
|
" raise FileNotFoundError(fname)\n",
|
|
|
|
"\n",
|
|
|
|
" samples = get_samples(fname, convert_Vext_to_galactic=False)\n",
|
|
|
|
"\n",
|
|
|
|
" # keys = list(samples.keys())\n",
|
|
|
|
" # for key in keys:\n",
|
|
|
|
" # if cat in key:\n",
|
|
|
|
" # value = samples.pop(key)\n",
|
|
|
|
" # samples[key.replace(f\"_{cat}\",'')] = value\n",
|
|
|
|
" \n",
|
|
|
|
" samples = samples_to_getdist(samples, catalogue_to_pretty(cat))\n",
|
|
|
|
" X.append(samples)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# params = [\"Vmag\", \"l\", \"b\", \"a_dipole_mag\", \"a_dipole_l\", \"a_dipole_b\"]\n",
|
|
|
|
"params = [\"Vx\", \"Vy\", \"Vz\"]\n",
|
|
|
|
"# params = [\"Vmag\", \"l\", \"b\"]\n",
|
|
|
|
"\n",
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" g = plots.get_subplot_plotter()\n",
|
|
|
|
" g.settings.figure_legend_frame = False\n",
|
|
|
|
" g.settings.alpha_filled_add = 0.75\n",
|
|
|
|
"\n",
|
|
|
|
" g.triangle_plot(X, params=params, filled=True, legend_loc='upper right')\n",
|
|
|
|
" # plt.gcf().suptitle(catalogue_to_pretty(cat), y=1.025)\n",
|
|
|
|
" plt.gcf().tight_layout()\n",
|
|
|
|
" plt.gcf().savefig(f\"../../plots/vext_{sim}.png\", dpi=500, bbox_inches='tight')"
|
2024-07-01 10:48:50 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Flow | catalogue"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"catalogues = [\"LOSS\", \"Foundation\", \"Pantheon+\", \"2MTF\", \"SFI_gals\"]\n",
|
|
|
|
"sims = [\"Carrick2015\", \"csiborg2_main\", \"csiborg2X\"]\n",
|
|
|
|
"params = [\"Vmag\", \"beta\", \"sigma_v\"]\n",
|
|
|
|
"\n",
|
|
|
|
"for catalogue in catalogues:\n",
|
|
|
|
" X = [samples_to_getdist(get_samples(sim, catalogue), sim)\n",
|
|
|
|
" for sim in sims]\n",
|
|
|
|
"\n",
|
|
|
|
" g = plots.get_subplot_plotter()\n",
|
|
|
|
" g.settings.figure_legend_frame = False\n",
|
|
|
|
" g.settings.alpha_filled_add = 0.75\n",
|
|
|
|
"\n",
|
|
|
|
" g.triangle_plot(X, params=params, filled=True, legend_loc='upper right')\n",
|
|
|
|
" plt.gcf().suptitle(f'{catalogue}', y=1.025)\n",
|
|
|
|
" plt.gcf().tight_layout()\n",
|
2024-07-05 10:28:06 +00:00
|
|
|
" plt.gcf().savefig(f\"../../plots/calibration_{catalogue}.png\", dpi=500, bbox_inches='tight')\n"
|
2024-07-01 10:48:50 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Flow | simulation"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"catalogues = [\"Pantheon+\", \"2MTF\", \"SFI_gals\"]\n",
|
|
|
|
"sims = [\"Carrick2015\", \"csiborg2_main\", \"csiborg2X\"]\n",
|
2024-07-05 10:28:06 +00:00
|
|
|
"params = [\"Vmag\", \"l\", \"b\", \"beta\", \"sigma_v\"]\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
|
|
|
"for sim in sims:\n",
|
|
|
|
" X = [samples_to_getdist(get_samples(sim, catalogue), sim, catalogue)\n",
|
|
|
|
" for catalogue in catalogues]\n",
|
|
|
|
"\n",
|
|
|
|
" g = plots.get_subplot_plotter()\n",
|
|
|
|
" g.settings.figure_legend_frame = False\n",
|
|
|
|
" g.settings.alpha_filled_add = 0.75\n",
|
|
|
|
"\n",
|
|
|
|
" g.triangle_plot(X, params=params, filled=True, legend_loc='upper right')\n",
|
|
|
|
" plt.gcf().suptitle(f'{sim}', y=1.025)\n",
|
|
|
|
" plt.gcf().tight_layout()\n",
|
|
|
|
" plt.gcf().savefig(f\"../../plots/calibration_{sim}.png\", dpi=500, bbox_inches='tight')\n",
|
|
|
|
" plt.gcf().show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Stacking vs marginalising CB boxes\n",
|
|
|
|
"\n",
|
|
|
|
"#### $V_{\\rm ext}$"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"sim = \"csiborg2X\"\n",
|
|
|
|
"catalogue = \"2MTF\"\n",
|
|
|
|
"key = \"Vext\"\n",
|
|
|
|
"\n",
|
|
|
|
"X = [get_samples(sim, catalogue, nsim=nsim, convert_Vext_to_galactic=False)[key] for nsim in range(20)]\n",
|
|
|
|
"Xmarg = get_samples(sim, catalogue, convert_Vext_to_galactic=False)[key]\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"fig, axs = plt.subplots(1, 3, figsize=(15, 5), sharey=True)\n",
|
|
|
|
"fig.suptitle(f\"{simname_to_pretty(sim)}, {catalogue}\")\n",
|
|
|
|
"fig.subplots_adjust(wspace=0.0, hspace=0)\n",
|
|
|
|
"\n",
|
|
|
|
"for i in range(3):\n",
|
|
|
|
" for n in range(20):\n",
|
|
|
|
" axs[i].hist(X[n][:, i], bins=\"auto\", alpha=0.25, histtype='step',\n",
|
|
|
|
" color='black', linewidth=0.5, density=1, zorder=0,\n",
|
|
|
|
" label=\"Individual box\" if (n == 0 and i == 0) else None)\n",
|
|
|
|
"\n",
|
|
|
|
"axs[i].hist(np.hstack([X[n][:, i] for n in range(20)]), bins=\"auto\",\n",
|
|
|
|
" histtype='step', color='blue', density=1,\n",
|
|
|
|
" label=\"Stacked individual boxes\" if i == 0 else None)\n",
|
|
|
|
"axs[i].hist(Xmarg[:, i], bins=\"auto\", histtype='step', color='red',\n",
|
|
|
|
" density=1, label=\"Marginalised boxes\" if i == 0 else None)\n",
|
|
|
|
" \n",
|
|
|
|
"axs[0].legend(fontsize=\"small\", loc='upper left', frameon=False)\n",
|
|
|
|
"\n",
|
|
|
|
"axs[0].set_xlabel(r\"$V_{\\mathrm{ext}, x} ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
"axs[1].set_xlabel(r\"$V_{\\mathrm{ext}, y} ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
"axs[2].set_xlabel(r\"$V_{\\mathrm{ext}, z} ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
"axs[0].set_ylabel(\"Normalized PDF\")\n",
|
|
|
|
"fig.tight_layout()\n",
|
|
|
|
"fig.savefig(f\"../../plots/consistency_{sim}_{catalogue}_{key}.png\", dpi=450)\n",
|
|
|
|
"fig.show()\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"#### $\\beta$ and others"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-07-03 08:50:21 +00:00
|
|
|
"execution_count": null,
|
2024-07-01 10:48:50 +00:00
|
|
|
"metadata": {},
|
2024-07-03 08:50:21 +00:00
|
|
|
"outputs": [],
|
2024-07-01 10:48:50 +00:00
|
|
|
"source": [
|
|
|
|
"sim = \"csiborg2_main\"\n",
|
|
|
|
"catalogue = \"Pantheon+\"\n",
|
2024-07-05 10:28:06 +00:00
|
|
|
"key = \"alpha\"\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
|
|
|
"X = [get_samples(sim, catalogue, nsim=nsim, convert_Vext_to_galactic=False)[key] for nsim in range(20)]\n",
|
|
|
|
"Xmarg = get_samples(sim, catalogue, convert_Vext_to_galactic=False)[key]\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"plt.figure()\n",
|
|
|
|
"plt.title(f\"{simname_to_pretty(sim)}, {catalogue}\")\n",
|
|
|
|
"for n in range(20):\n",
|
|
|
|
" plt.hist(X[n], bins=\"auto\", alpha=0.25, histtype='step',\n",
|
|
|
|
" color='black', linewidth=0.5, density=1, zorder=0,\n",
|
|
|
|
" label=\"Individual box\" if n == 0 else None)\n",
|
|
|
|
"\n",
|
|
|
|
"plt.hist(np.hstack([X[n] for n in range(20)]), bins=\"auto\",\n",
|
|
|
|
" histtype='step', color='blue', density=1,\n",
|
|
|
|
" label=\"Stacked individual boxes\")\n",
|
|
|
|
"plt.hist(Xmarg, bins=\"auto\", histtype='step', color='red',\n",
|
|
|
|
" density=1, label=\"Marginalised boxes\")\n",
|
|
|
|
"\n",
|
|
|
|
"plt.legend(fontsize=\"small\", frameon=False, loc='upper left', ncols=3)\n",
|
|
|
|
"plt.xlabel(names_to_latex([key], True)[0])\n",
|
|
|
|
"plt.ylabel(\"Normalized PDF\")\n",
|
|
|
|
"\n",
|
|
|
|
"plt.tight_layout()\n",
|
|
|
|
"plt.savefig(f\"../../plots/consistency_{sim}_{catalogue}_{key}.png\", dpi=450)\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### SN/TFR Calibration consistency"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# catalogues = [\"LOSS\", \"Foundation\", \"Pantheon+\", \"2MTF\", \"SFI_gals\"]\n",
|
|
|
|
"catalogues = [\"Pantheon+\"]\n",
|
|
|
|
"sims = [\"Carrick2015\", \"csiborg2_main\", \"csiborg2X\"]\n",
|
|
|
|
"\n",
|
|
|
|
"for catalogue in catalogues:\n",
|
|
|
|
" X = [samples_to_getdist(get_samples(sim, catalogue), sim)\n",
|
|
|
|
" for sim in sims]\n",
|
|
|
|
"\n",
|
|
|
|
" if \"Pantheon+\" in catalogue or catalogue in [\"Foundation\", \"LOSS\"]:\n",
|
|
|
|
" params = [\"alpha_cal\", \"beta_cal\", \"mag_cal\", \"e_mu\"]\n",
|
|
|
|
" else:\n",
|
|
|
|
" params = [\"aTF\", \"bTF\", \"e_mu\"]\n",
|
|
|
|
"\n",
|
|
|
|
" g = plots.get_subplot_plotter()\n",
|
|
|
|
" g.settings.figure_legend_frame = False\n",
|
|
|
|
" g.settings.alpha_filled_add = 0.75\n",
|
|
|
|
"\n",
|
|
|
|
" g.triangle_plot(X, params=params, filled=True, legend_loc='upper right')\n",
|
|
|
|
" plt.gcf().suptitle(f'{catalogue}', y=1.025)\n",
|
|
|
|
" plt.gcf().tight_layout()\n",
|
|
|
|
" # plt.gcf().savefig(f\"../../plots/calibration_{catalogue}.png\", dpi=500, bbox_inches='tight')"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-07-03 08:50:21 +00:00
|
|
|
"### $V_{\\rm ext}$ comparison"
|
2024-07-01 10:48:50 +00:00
|
|
|
]
|
|
|
|
},
|
2024-07-03 08:50:21 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-07-05 10:28:06 +00:00
|
|
|
"execution_count": null,
|
2024-07-03 08:50:21 +00:00
|
|
|
"metadata": {},
|
2024-07-05 10:28:06 +00:00
|
|
|
"outputs": [],
|
2024-07-03 08:50:21 +00:00
|
|
|
"source": [
|
|
|
|
"catalogues = [\"LOSS\"]\n",
|
|
|
|
"# sims = [\"Carrick2015\", \"csiborg2_main\", \"csiborg2X\"]\n",
|
|
|
|
"sims = [\"Carrick2015\"]\n",
|
|
|
|
"params = [\"Vmag\", \"l\", \"b\"]\n",
|
|
|
|
"\n",
|
|
|
|
"for sim in sims:\n",
|
|
|
|
" X = [samples_to_getdist(get_samples(sim, catalogue), sim, catalogue)\n",
|
|
|
|
" for catalogue in catalogues]\n",
|
|
|
|
"\n",
|
|
|
|
" g = plots.get_subplot_plotter()\n",
|
|
|
|
" g.settings.figure_legend_frame = False\n",
|
|
|
|
" g.settings.alpha_filled_add = 0.75\n",
|
|
|
|
"\n",
|
|
|
|
" g.triangle_plot(X, params=params, filled=True, legend_loc='upper right')\n",
|
|
|
|
" plt.gcf().suptitle(f'{simname_to_pretty(sim)}', y=1.025)\n",
|
|
|
|
" plt.gcf().tight_layout()\n",
|
|
|
|
" # plt.gcf().savefig(f\"../../plots/calibration_{sim}.png\", dpi=500, bbox_inches='tight')\n",
|
|
|
|
" plt.gcf().show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Bulk flow in the simulation rest frame"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-07-05 10:28:06 +00:00
|
|
|
"execution_count": null,
|
2024-07-03 08:50:21 +00:00
|
|
|
"metadata": {},
|
2024-07-05 10:28:06 +00:00
|
|
|
"outputs": [],
|
2024-07-03 08:50:21 +00:00
|
|
|
"source": [
|
|
|
|
"sims = [\"Carrick2015\", \"csiborg1\", \"csiborg2_main\", \"csiborg2X\"]\n",
|
|
|
|
"convert_to_galactic = False\n",
|
|
|
|
"\n",
|
|
|
|
"fig, axs = plt.subplots(1, 3, figsize=(15, 5))\n",
|
|
|
|
"cols = plt.rcParams['axes.prop_cycle'].by_key()['color']\n",
|
|
|
|
"\n",
|
|
|
|
"for i, sim in enumerate(sims):\n",
|
|
|
|
" r, B = get_bulkflow_simulation(sim, convert_to_galactic=convert_to_galactic)\n",
|
|
|
|
" if sim == \"Carrick2015\":\n",
|
|
|
|
" if convert_to_galactic:\n",
|
|
|
|
" B[..., 0] *= 0.43\n",
|
|
|
|
" else:\n",
|
|
|
|
" B *= 0.43\n",
|
|
|
|
"\n",
|
|
|
|
" for n in range(3):\n",
|
|
|
|
" ylow, ymed, yhigh = np.percentile(B[..., n], [16, 50, 84], axis=0)\n",
|
|
|
|
" axs[n].fill_between(r, ylow, yhigh, color=cols[i], alpha=0.5, label=simname_to_pretty(sim) if n == 0 else None)\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-07-03 08:50:21 +00:00
|
|
|
"axs[0].legend()\n",
|
|
|
|
"if convert_to_galactic:\n",
|
|
|
|
" axs[0].set_ylabel(r\"$B ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
" axs[1].set_ylabel(r\"$\\ell_B ~ [\\degree]$\")\n",
|
|
|
|
" axs[2].set_ylabel(r\"$b_B ~ [\\degree]$\")\n",
|
|
|
|
"else:\n",
|
|
|
|
" axs[0].set_ylabel(r\"$B_{x} ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
" axs[1].set_ylabel(r\"$B_{y} ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
" axs[2].set_ylabel(r\"$B_{z} ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
"\n",
|
|
|
|
"for n in range(3):\n",
|
|
|
|
" axs[n].set_xlabel(r\"$R ~ [\\mathrm{Mpc}]$\")\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"fig.tight_layout()\n",
|
2024-07-05 10:28:06 +00:00
|
|
|
"fig.savefig(\"../../plots/bulkflow_simulations_restframe.png\", dpi=450)\n",
|
2024-07-03 08:50:21 +00:00
|
|
|
"fig.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Bulk flow in the CMB rest frame"
|
2024-07-01 10:48:50 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-07-05 10:28:06 +00:00
|
|
|
"execution_count": null,
|
2024-07-01 10:48:50 +00:00
|
|
|
"metadata": {},
|
2024-07-05 10:28:06 +00:00
|
|
|
"outputs": [],
|
2024-07-01 10:48:50 +00:00
|
|
|
"source": [
|
2024-07-05 10:28:06 +00:00
|
|
|
"sim = \"csiborg2_main\"\n",
|
|
|
|
"catalogues = [\"Pantheon+\", \"2MTF\", \"SFI_gals\"]\n",
|
2024-07-03 08:50:21 +00:00
|
|
|
"\n",
|
|
|
|
"\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"fig, axs = plt.subplots(1, 3, figsize=(15, 5), sharex=True)\n",
|
|
|
|
"cols = plt.rcParams['axes.prop_cycle'].by_key()['color']\n",
|
2024-07-03 08:50:21 +00:00
|
|
|
"# fig.suptitle(f\"Calibrated against {catalogue}\")\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
2024-07-03 08:50:21 +00:00
|
|
|
"for i, catalogue in enumerate(catalogues):\n",
|
2024-07-05 10:28:06 +00:00
|
|
|
" r, B = get_bulkflow(sim, catalogue, sample_beta=True, convert_to_galactic=True,\n",
|
|
|
|
" weight_simulations=True, downsample=3)\n",
|
2024-07-03 08:50:21 +00:00
|
|
|
" c = cols[i]\n",
|
|
|
|
" for n in range(3):\n",
|
|
|
|
" ylow, ymed, yhigh = np.percentile(B[..., n], [16, 50, 84], axis=-1)\n",
|
|
|
|
" axs[n].plot(r, ymed, color=c)\n",
|
|
|
|
" axs[n].fill_between(r, ylow, yhigh, alpha=0.5, color=c, label=catalogue)\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"# CMB-LG velocity\n",
|
2024-07-03 08:50:21 +00:00
|
|
|
"axs[0].fill_between([r.min(), 10.], [627 - 22, 627 - 22], [627 + 22, 627 + 22], color='black', alpha=0.5, zorder=0.5, label=\"CMB-LG\", hatch=\"x\")\n",
|
|
|
|
"axs[1].fill_between([r.min(), 10.], [276 - 3, 276 - 3], [276 + 3, 276 + 3], color='black', alpha=0.5, zorder=0.5, hatch=\"x\")\n",
|
|
|
|
"axs[2].fill_between([r.min(), 10.], [30 - 3, 30 - 3], [30 + 3, 30 + 3], color='black', alpha=0.5, zorder=0.5, hatch=\"x\")\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
"\n",
|
|
|
|
"# LCDM expectation\n",
|
|
|
|
"Rs,mean,std,mode,p05,p16,p84,p95 = np.load(\"/mnt/users/rstiskalek/csiborgtools/data/BulkFlowPlot.npy\")\n",
|
|
|
|
"m = Rs < 175\n",
|
|
|
|
"axs[0].plot(Rs[m], mode[m], color=\"violet\", zorder=0)\n",
|
|
|
|
"axs[0].fill_between(Rs[m], p16[m], p84[m], alpha=0.25, color=\"violet\",\n",
|
|
|
|
" zorder=0, hatch='//', label=r\"$\\Lambda\\mathrm{CDM}$\")\n",
|
|
|
|
"\n",
|
|
|
|
"for n in range(3):\n",
|
|
|
|
" axs[n].set_xlabel(r\"$r ~ [\\mathrm{Mpc} / h]$\")\n",
|
|
|
|
"\n",
|
|
|
|
"axs[0].legend()\n",
|
|
|
|
"axs[0].set_ylabel(r\"$B ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
|
|
|
"axs[1].set_ylabel(r\"$\\ell_B ~ [\\mathrm{deg}]$\")\n",
|
|
|
|
"axs[2].set_ylabel(r\"$b_B ~ [\\mathrm{deg}]$\")\n",
|
|
|
|
"\n",
|
|
|
|
"axs[0].set_xlim(r.min(), r.max())\n",
|
|
|
|
"\n",
|
|
|
|
"fig.tight_layout()\n",
|
|
|
|
"fig.savefig(f\"../../plots/bulkflow_{sim}_{catalogue}.png\", dpi=450)\n",
|
|
|
|
"fig.show()"
|
|
|
|
]
|
|
|
|
},
|
2024-07-12 14:46:45 +00:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Smoothing scale dependence"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-11 06:45:42 +00:00
|
|
|
"execution_count": null,
|
2024-07-12 14:46:45 +00:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"simname = \"Carrick2015\"\n",
|
|
|
|
"catalogue = \"Pantheon+\""
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"#### Goodness-of-fit"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-11 06:45:42 +00:00
|
|
|
"execution_count": null,
|
2024-07-12 14:46:45 +00:00
|
|
|
"metadata": {},
|
2024-09-11 06:45:42 +00:00
|
|
|
"outputs": [],
|
2024-07-12 14:46:45 +00:00
|
|
|
"source": [
|
|
|
|
"scales = [0, 4, 8, 16, 32]\n",
|
|
|
|
"\n",
|
|
|
|
"y = np.asarray([get_gof(\"BIC\", simname, catalogue, ksmooth=i)\n",
|
|
|
|
" for i in range(len(scales))])\n",
|
|
|
|
"ymin = y.min()\n",
|
|
|
|
"\n",
|
|
|
|
"y -= ymin\n",
|
|
|
|
"y_CF4 = get_gof(\"BIC\", \"CF4\", catalogue) - ymin\n",
|
|
|
|
"y_CF4gp = get_gof(\"BIC\", \"CF4gp\", catalogue) - ymin\n",
|
|
|
|
"\n",
|
|
|
|
"plt.figure()\n",
|
|
|
|
"plt.axhline(y[0], color='blue', label=\"Carrick+2015, no smoothing\")\n",
|
|
|
|
"plt.plot(scales[1:], y[1:], marker=\"o\", label=\"Carrick+2015, smoothed\")\n",
|
|
|
|
"\n",
|
|
|
|
"plt.axhline(y_CF4, color='red', label=\"CF4, no smoothing\")\n",
|
|
|
|
"\n",
|
|
|
|
"plt.xlabel(r\"$R_{\\rm smooth} ~ [\\mathrm{Mpc}]$\")\n",
|
|
|
|
"plt.ylabel(r\"$\\Delta \\mathrm{BIC}$\")\n",
|
|
|
|
"plt.legend(ncols=1)\n",
|
|
|
|
"\n",
|
|
|
|
"plt.tight_layout()\n",
|
|
|
|
"plt.savefig(\"../../plots/test_smooth.png\", dpi=450)\n",
|
|
|
|
"plt.show()\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-11 06:45:42 +00:00
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
2024-07-12 14:46:45 +00:00
|
|
|
"source": [
|
|
|
|
"sim = \"Carrick2015\"\n",
|
|
|
|
"catalogue = \"Pantheon+\"\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"X = [samples_to_getdist(get_samples(sim, catalogue, ksmooth=ksmooth), ksmooth)\n",
|
|
|
|
" for ksmooth in [0, 1, 2]]\n",
|
|
|
|
"\n",
|
|
|
|
"params = [\"Vmag\", \"l\", \"b\", \"sigma_v\", \"beta\"]\n",
|
|
|
|
"# if \"Pantheon+\" in catalogue or catalogue in [\"Foundation\", \"LOSS\"]:\n",
|
|
|
|
"# params += [\"alpha_cal\", \"beta_cal\", \"mag_cal\", \"e_mu\"]\n",
|
|
|
|
"# else:\n",
|
|
|
|
"# params += [\"aTF\", \"bTF\", \"e_mu\"]\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"g = plots.get_subplot_plotter()\n",
|
|
|
|
"g.settings.figure_legend_frame = False\n",
|
|
|
|
"g.settings.alpha_filled_add = 0.75\n",
|
|
|
|
"\n",
|
|
|
|
"g.triangle_plot(X, params=params, filled=True, legend_loc='upper right')\n",
|
|
|
|
"plt.gcf().suptitle(f'{catalogue}', y=1.025)\n",
|
|
|
|
"plt.gcf().tight_layout()\n",
|
|
|
|
"plt.gcf().savefig(f\"../../plots/calibration_{catalogue}.png\", dpi=500, bbox_inches='tight')"
|
|
|
|
]
|
|
|
|
},
|
2024-09-17 09:26:04 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": []
|
2024-07-01 10:48:50 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
|
|
|
"display_name": "venv_csiborg",
|
|
|
|
"language": "python",
|
|
|
|
"name": "python3"
|
|
|
|
},
|
|
|
|
"language_info": {
|
|
|
|
"codemirror_mode": {
|
|
|
|
"name": "ipython",
|
|
|
|
"version": 3
|
|
|
|
},
|
|
|
|
"file_extension": ".py",
|
|
|
|
"mimetype": "text/x-python",
|
|
|
|
"name": "python",
|
|
|
|
"nbconvert_exporter": "python",
|
|
|
|
"pygments_lexer": "ipython3",
|
2024-07-05 10:28:06 +00:00
|
|
|
"version": "3.11.4"
|
2024-07-01 10:48:50 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|