2024-07-01 10:48:50 +00:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-18 13:20:39 +00:00
|
|
|
"execution_count": 1,
|
2024-07-01 10:48:50 +00:00
|
|
|
"metadata": {},
|
2024-09-18 13:20:39 +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-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
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"zcmb_max = 0.05\n",
|
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
"sims = [\"Carrick2015\", \"Lilow2024\", \"csiborg2_main\", \"csiborg2X\", \"CLONES\", \"CF4\",]\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"catalogues = [\"LOSS\", \"Foundation\", \"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
|
|
|
"\n",
|
|
|
|
"y_BIC = np.full((len(catalogues), 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, 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",
|
2024-09-12 15:04:25 +00:00
|
|
|
" # y_BIC[i, j] = get_gof(\"BIC\", fname)z\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" y_lnZ[i, j] = get_gof(\"neg_lnZ_harmonic\", fname)\n",
|
|
|
|
"\n",
|
|
|
|
" y_lnZ[i] -= y_lnZ[i].min()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
" figwidth = 8.3\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" fig, axs = plt.subplots(2, 3, figsize=(figwidth, 0.5 * figwidth))\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" fig.subplots_adjust(hspace=0)\n",
|
|
|
|
"\n",
|
|
|
|
" x = np.arange(len(sims))\n",
|
|
|
|
" y = y_lnZ\n",
|
|
|
|
" for n in range(len(catalogues)):\n",
|
|
|
|
" i, j = n // 3, n % 3\n",
|
|
|
|
" ax = axs[i, j]\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" ax.text(0.1, 0.875, catalogue_to_pretty(catalogues[n]),\n",
|
|
|
|
" transform=ax.transAxes, #fontsize=\"small\",\n",
|
|
|
|
" verticalalignment='center', horizontalalignment='left',\n",
|
|
|
|
" bbox=dict(facecolor='white', alpha=0.5),\n",
|
|
|
|
" )\n",
|
|
|
|
" ax.scatter(x, y[n], c=\"k\", s=7.5)\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
|
|
|
" y_min, y_max = ax.get_ylim()\n",
|
|
|
|
" y_offset = (y_max - y_min) * 0.075 # Adjust the fraction (0.05) as needed\n",
|
|
|
|
"\n",
|
|
|
|
" for k, txt in enumerate(y[n]):\n",
|
|
|
|
" ax.text(x[k], y[n, k] + y_offset, f\"({y[n, k]:.1f})\",\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" ha='center', fontsize=\"small\")\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
|
|
|
" ax.set_ylim(y_min, y_max + 2 * y_offset)\n",
|
|
|
|
"\n",
|
|
|
|
" for i in range(3):\n",
|
|
|
|
" axs[1, i].set_xticks(\n",
|
|
|
|
" np.arange(len(sims)),\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" [simname_to_pretty(sim) for sim in sims], rotation=35)\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",
|
|
|
|
" axs[i, 0].set_ylabel(r\"$-\\Delta \\ln \\mathcal{Z}$\")\n",
|
|
|
|
"\n",
|
2024-09-12 15:04:25 +00:00
|
|
|
" fig.tight_layout()\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
" fig.savefig(f\"../../plots/lnZ_comparison.pdf\", dpi=500, bbox_inches='tight')\n",
|
2024-07-01 10:48:50 +00:00
|
|
|
" fig.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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-17 20:01:15 +00:00
|
|
|
"execution_count": 2,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_2MTF_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 15:27: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: 13/09/2024 11:32:04\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_2MTF_mike_smooth_2_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:35:10\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_2MTF_mike_smooth_3_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:35:08\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_2MTF_mike_smooth_4_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:34:31\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_SFI_gals_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 15:28:34\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: 13/09/2024 11:37:11\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_SFI_gals_mike_smooth_2_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:39:21\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_SFI_gals_mike_smooth_3_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:41:15\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_SFI_gals_mike_smooth_4_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:43:31\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: 12/09/2024 10:48:49\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: 13/09/2024 11:44:13\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_i_mike_smooth_2_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:46:11\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_i_mike_smooth_3_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:46:57\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_i_mike_smooth_4_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:48:46\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_2MTF_mike_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 12:03:40\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: 13/09/2024 11:52:24\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_2MTF_mike_smooth_2_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:53:39\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_2MTF_mike_smooth_3_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:58:54\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_2MTF_mike_smooth_4_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 11:59:21\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: 30/08/2024 12:05:48\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: 13/09/2024 12:07:50\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_SFI_gals_mike_smooth_2_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 12:06:30\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_SFI_gals_mike_smooth_3_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 12:06:41\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_SFI_gals_mike_smooth_4_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 12:14:03\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: 12/09/2024 11:13:55\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: 13/09/2024 12:20:28\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_i_mike_smooth_2_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 12:27:13\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_i_mike_smooth_3_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 12:32:47\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_i_mike_smooth_4_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 13/09/2024 12:36:56\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
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-17 20:01:15 +00:00
|
|
|
"execution_count": 3,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-17 20:01:15 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"Carrick2015 2MTF 322.1943359375\n",
|
|
|
|
"Carrick2015 SFI_gals 414.5947265625\n",
|
|
|
|
"Carrick2015 CF4_TFR_i 835.421875\n",
|
|
|
|
"csiborg2_main 2MTF 760.97265625\n",
|
|
|
|
"csiborg2_main SFI_gals 800.328125\n",
|
|
|
|
"csiborg2_main CF4_TFR_i 1914.80859375\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
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 13:20:39 +00:00
|
|
|
"execution_count": 5,
|
2024-09-11 06:45:42 +00:00
|
|
|
"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o4xmW7ByY4F2KFRtf1h4e8PXFy/+MLnhG/+cVF5OZmUlqaioWi4WcnBxHeTcQFdIFw0BLNZx4HeZ9G5SeEBDtlgHmI8WEFczZATEUL//zgM/v6mF6oGRZyOxBeZgDQavVOupcGgwGVq5c6VQfU1RIFwyKpnLY9jBUfA0hMyAwBk69IwecT74awhbJYikYMBNWMP09fAfk9dl5c9EvePjgsxTVHScxeOawr2Hq9XpHozOQp+hpaWmOXfOuiArpggGx7WE4WwiSFSp2QfV+WPo0zP4m+IW72rpxiVikGCCRPqG8v+Q3VN1YwPtLfjOsYmknJyfH6dhkMvXa8ExUSBf0SeN5WSQl68UxL39YnCHE8jIQgjmGiI+PJzc3l4KCAnJzc1m3bh0qlarfCumXvn45jdEE4xxJgiN/g9fngqc/KDzkcYUHhCe61jY3QNTDFAjchboS2JEGZ/Uw6xugexI+/xFUFsliufJl8I90tZXjClEPUyBwR9rqIF8HXsFw+wcw9SZ5fPX7rrXLzXC7KbloUSGYUNQcBWurHBKU9Brce/CiWAqGjGhRIRC4E9Y2MDwDxf8PrsySa1EKhh0xJRcIxjvlRfDxo2A5AoszLxbFEIw4QjAFgvFE9UF4c7kcdJ5SJH8XjBpCMAWC8UDVfghbAJr5sGqr3FBMKf58Rxu32/QRCNyKVoscKrR1IZzRy2Px9wixdBEj/tQtFotTgQiDwYBKpUKtVrN7924SEhJQqVTo9XpMJhNqtRqTyeSo1NPbuLtizxOPj49HrVZjNptJSEhwPKu+Cglf+mzS09O7ZQ/Zsd8jOTkZlUpFZmYmaWlpxMfHU1hYSGJiIklJSf0WLr70daPRSHx8vFPRkN4oKCjAbDYP6NwJScnb8Ol35B461z0vVzoXuJaRKsCZn58vZWRkdCv
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 350x262.5 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
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 13:20:39 +00:00
|
|
|
"execution_count": 6,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 13:20:39 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:26:54\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:28:43\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 12:20:11\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 12:19:39\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:27:13\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:28:48\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 12:19:59\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 12:26:53\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:54:29\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 17:10:19\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:27:52\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 12:58:15\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:59:53\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 17:16:15\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:39:34\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:01:55\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 17:12:11\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 14:07:26\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:23:47\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:19:35\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:49:16\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:50:20\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:52:12\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:51:03\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
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 13:20:39 +00:00
|
|
|
"execution_count": 7,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 13:20:39 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAFsCAYAAADsalOEAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAACyN0lEQVR4nOy9d3gb553g/0EHSJAAwd6bumRbouTeEot0qp3Elqw4u9l2sZTs3e3d7saSlb377d1lE0vaJFvSTCnJJhvHjiW5xI6rKMlVkiWSVu8EeydBECRRCeD3xwBgA0CABEiCms/z4IEwM3jnJfTOd77zrRKv1+tFRERERCRhkM73BEREREREokMU3CIiIiIJhii4RURERBIMUXCLiIiIJBii4BYRERFJMETBLSIiIpJgiIJbREREJMEQBbeIiIhIgiEKbhEREZEEQxTcIiIiIgmGKLhFREREEgxRcIuIiIgkGPLZfLm1b4T+YUes5hKUdK2KwozkuJ5DJARDLWDvi+851BmQUhTfc9zgDPYNYR2yx/UcSSlqdBkpcT2HyBgzFtytfSOsf+qP2JzuWM5nChqljLpdX4xYeJvNZp544gnq6+sBKCsrY/fu3VRUVMzo/GazmbS0NAYGBtDr9SGPk0gkzLbQYk1NDdXV1Rw4cGDCuGVlZYHP1dXVVFZWzuo8ETHUAs+vhFFrfM8jT4LHL4nCO04M9g3xzPYXGHWOxvU8cqWcb+7ZErHwjvV1OlMivb4jYe/evezevRuATZs2Bf598OBBnn76acxmM5WVlVRXV8922jMX3P3DDmxON08+tJrCjKRZTyQYrX1W/vm1C/QPOyIS3EajkfXr17N79+6A8Kuvr58g+KJFr9dTV1c36//U6di8eTNmsxmj0ThlX0NDQ1zPHRR7nyC0K74DKcXxOcdQM9R/XzhXh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|
|
|
|
}
|
|
|
|
],
|
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-12 15:04:25 +00:00
|
|
|
"### 5. Bulk flow in the simulation rest frame "
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-18 13:20:39 +00:00
|
|
|
"execution_count": 8,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 13:20:39 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAU0AAAD1CAYAAADUHqdoAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAABmAUlEQVR4nO2dd3hb53m3bywCBBcI7iWRoPayRFEe8Y4oO3ZsxbEpKYpjN8tiRpu0qS1aTtOsJjJZt03ar2lIO4njJFYkMrKteEWE97ZEalqbIDW4SRAcIDbO98dLgKS499C5r+tcAA7OeA9w8MM7nuf3KiRJkpCRkZGRGRHK6S6AjIyMzGxCFk0ZGRmZUSCLpoyMjMwokEVTRkZGZhSop7sA42H58uVkZmYO+F5NTQ0pKSmjPqa838TtNxvKKO83u/cb67kqKiq4dOnSqPcDQJrF3H333WN6b6zHlPebueeS97sy9xvruRISEsa0nyRJ0pxtnm/dunVO7zdWprKc8mcyM/YbK7Ph+qb6MwFQSNLsjdPcuHEj+/btm+5iTAtX8rUPhvyZDIz8ufQnMTGR+vr6Me07Z2uac53p+Ied6cifycDIn0t/xtIPGkAWzVmK/EPoj/yZDIz8ufRHFk0ZGRmZKUIWTRkZGZlRIIumjIyMzCiY1aJZU1PDxo0b2bVr13QXRUZGZhawa9cuNm7cSE1NzZiPMatFMyUlhX379skd3d3YbDby8/MpLi6mtLSU4uJiKioqKC4unpDjZ2ZmYrFYBn3fbDaTmZlJRUXFhJzPZrP1eV1RUYHFYsFms2E2m/u9P6l0tEFT3eQuHW0jKorFYiEvLw+FQjHg91FaWopCoZiw7703w90DM52tW7eyb9++cQ0Ezeo0SpkeLBYLGzZsoLy8HIPBEFy/adMm1q1bNyHnKCkpwWQyDfp+Tk4OWV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|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
2024-09-12 15:04:25 +00:00
|
|
|
"sims = [\"Carrick2015\", \"Lilow2024\", \"csiborg2_main\", \"csiborg2X\", \"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 13:20:39 +00:00
|
|
|
"execution_count": 9,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 13:20:39 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:26:54\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:28:43\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 12:20:11\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Carrick2015_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 12:19:39\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:27:13\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:28:48\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 12:19:59\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_Lilow2024_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 12:26:53\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:54:29\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 17:10:19\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:27:52\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2_main_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 12:58:15\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 16:59:53\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 17:16:15\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:39:34\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_csiborg2X_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:01:55\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:49:16\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:50:20\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:52:12\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CLONES_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:51:03\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_2MTF_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 30/08/2024 17:12:11\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_SFI_gals_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 14:07:26\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_CF4_TFR_i_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:23:47\n",
|
|
|
|
"File: /mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/samples_CF4_CF4_TFR_w1_bayes_zcmb_max_0.05_sample_alpha.hdf5\n",
|
|
|
|
"Last modified: 12/09/2024 13:19:35\n"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
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 13:20:39 +00:00
|
|
|
"execution_count": 12,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
2024-09-18 13:20:39 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAw0AAAOiCAYAAAAyqzvbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9eXgc533ni35q633HvoPgKkqiJJCybMuxZQm0HcdWFpNSlJk7Z24SkjPnzsy9M09sWidPztxzcjMymcxM7syciSH5TObcTKJIhO3YiRPbhGTLtlaKIEWJorg1QBL70ht676p67x+FbgIkAQIkQIBkffCAYFdXv/VWVVfV+31/mySEENjY2NjY2NjY2NjY2MyDvNodsLGxsbGxsbGxsbFZ29iiwcbGxsbGxsbGxsZmQWzRYGNjY2NjY2NjY2OzILZosLGxsbGxsbGxsbFZEFs02NjY2NjY2NjY2NgsiC0abGxsbGxsbGxsbGwWxBYNNjY2NjY2NjY2NjYLYosGGxsbGxsbGxsbG5sFsUWDjY2NjY2NjY2Njc2C2KLBxsbGxsbGxsbGxmZBbNFgY2NjY2NjY2NjY7MgtmiwsbGxsbGxsbGxsVkQdbU7YGNzJ5HMFskVjRXdhtuhEPQ4VnQbtxvJUoasmV/R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xZx5tbO4simaJsWKckUKM0UKcC7kxorkRknqGs5m76HrXszB9Efytq90TG5tbyjPPPMMzzzxDfX39im/rrhENOcXHF//FH9P1ifbV7oq
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 830x954.5 with 24 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
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-11 06:45:42 +00:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-09-17 09:26:04 +00:00
|
|
|
"## Void testing"
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### Evidence comparison"
|
|
|
|
]
|
|
|
|
},
|
2024-07-12 14:46:45 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
2024-09-11 06:45:42 +00:00
|
|
|
"source": [
|
|
|
|
"zcmb_max = 0.05\n",
|
|
|
|
"\n",
|
|
|
|
"sims = [\"no_field\", \"IndranilVoid_exp\"]\n",
|
|
|
|
"cats = [\"LOSS\", \"Foundation\", \"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
|
|
|
"\n",
|
|
|
|
"neglnZ = {}\n",
|
2024-09-17 09:26:04 +00:00
|
|
|
"kfound = []\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"for sim in sims:\n",
|
|
|
|
" for cat in cats:\n",
|
|
|
|
" sample_alpha = sim not in [\"IndranilVoid_exp\", \"no_field\"]\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, sim, cat, inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=sample_alpha, zcmb_max=zcmb_max)\n",
|
2024-09-17 09:26:04 +00:00
|
|
|
" \n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
|
|
|
" neglnZ[f\"{sim}_{cat}\"] = get_gof(\"neg_lnZ_harmonic\", fname)\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"simA = sims[0]\n",
|
|
|
|
"simB = sims[1]\n",
|
|
|
|
"\n",
|
|
|
|
"print(f\"lnZ_({simA}) - lnZ_({simB})\\n\")\n",
|
|
|
|
"for cat in cats:\n",
|
|
|
|
" lnZ_A = - neglnZ[f\"{simA}_{cat}\"]\n",
|
|
|
|
" lnZ_B = - neglnZ[f\"{simB}_{cat}\"]\n",
|
|
|
|
" print(f\"{cat:15s} {lnZ_A - lnZ_B:.1f}\")\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"print(f\"\\n(Positive -> preference for {simA})\")"
|
|
|
|
]
|
|
|
|
},
|
2024-09-17 09:26:04 +00:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"### 1. Goodness-of-fit comparison"
|
|
|
|
]
|
|
|
|
},
|
2024-09-11 06:45:42 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-17 20:01:15 +00:00
|
|
|
"execution_count": 11,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-09-17 09:26:04 +00:00
|
|
|
"zcmb_max = 0.05\n",
|
2024-09-17 20:01:15 +00:00
|
|
|
"no_Vext = True\n",
|
2024-09-17 09:26:04 +00:00
|
|
|
"\n",
|
|
|
|
"sims = [\"IndranilVoid_exp\", \"IndranilVoid_gauss\", \"IndranilVoid_mb\"]\n",
|
|
|
|
"cats = [\"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
|
|
|
"\n",
|
|
|
|
"neglnZ = {}\n",
|
|
|
|
"kfound = {}\n",
|
|
|
|
"for sim in sims:\n",
|
|
|
|
" for cat in cats:\n",
|
|
|
|
" kfound[f\"{sim}_{cat}\"] = []\n",
|
|
|
|
" for ksim in range(500):\n",
|
|
|
|
" sample_alpha = False\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, sim, cat, inference_method=\"mike\", nsim=ksim,\n",
|
|
|
|
" sample_alpha=sample_alpha, zcmb_max=zcmb_max,\n",
|
2024-09-17 20:01:15 +00:00
|
|
|
" sample_beta=True,\n",
|
2024-09-17 09:26:04 +00:00
|
|
|
" no_Vext=no_Vext, verbose_print=False)\n",
|
|
|
|
"\n",
|
|
|
|
" if not exists(fname):\n",
|
|
|
|
" continue\n",
|
|
|
|
"\n",
|
|
|
|
" kfound[f\"{sim}_{cat}\"].append(ksim)\n",
|
|
|
|
" neglnZ[f\"{sim}_{cat}_{ksim}\"] = get_gof(\"neg_lnZ_harmonic\", fname)\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"neglnZ_no_field = {}\n",
|
|
|
|
"neglnZ_dipole = {}\n",
|
|
|
|
"sim = \"no_field\"\n",
|
|
|
|
"for cat in cats:\n",
|
|
|
|
" sample_alpha = False\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, sim, cat, inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=sample_alpha, zcmb_max=zcmb_max,\n",
|
|
|
|
" no_Vext=True, verbose_print=False)\n",
|
|
|
|
"\n",
|
|
|
|
" if not exists(fname):\n",
|
|
|
|
" continue\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-17 09:26:04 +00:00
|
|
|
" neglnZ_no_field[f\"{cat}\"] = get_gof(\"neg_lnZ_harmonic\", fname)\n",
|
|
|
|
"\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, sim, cat, inference_method=\"mike\",\n",
|
|
|
|
" sample_alpha=sample_alpha, zcmb_max=zcmb_max,\n",
|
|
|
|
" no_Vext=None, verbose_print=False)\n",
|
|
|
|
"\n",
|
|
|
|
" if not exists(fname):\n",
|
|
|
|
" continue\n",
|
|
|
|
"\n",
|
|
|
|
" neglnZ_dipole[f\"{cat}\"] = get_gof(\"neg_lnZ_harmonic\", fname)\n"
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-17 20:01:15 +00:00
|
|
|
"execution_count": 12,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"Saving to `../../plots/void_goodness_of_fit_observer_no_Vext.png`.\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0AAAAIUCAYAAAAzC0wXAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd1yT1/7A8U8Swh5hizjBvQW0Vu1SsLVVuqTWerurdN/b21a0t+t3O/G2t7f7gh23kyp0aHfB2lZb2ypxTyS4ANlhr5Dz++MxUQQUJZAA591XXkieJ+f5JqR58n3OOd+jEkIIJEmSJEmSJEmSegG1vQOQJEmSJEmSJEnqKjIBkiRJkiRJkiSp15AJkCRJkiRJkiRJvYZMgCRJkiRJkiRJ6jVkAiRJkiRJkiRJUq8hEyBJkiRJkiRJknoNmQBJkiRJkiRJktRryARIkiRJkiRJkqReQyZAkiRJkiRJkiT1Gk72DsCe+vXrR0RExBn3y83NJTQ0tEv3s8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zgYO9HqUfKzc0lNjbWYUcZSJIkdQcnjzCwFZkAncGwEG/W//OyTmv7XK1YsQJfX98W44UtoqKiWLlyJcuWLQOUpASwJkqWhMTPz4/S0lKAZkkOnOh9am3fM9Hr9WzevLnV8bgOoeL4GNZO6AHqCmZhZqNxD6M8BuCn9Wp1nxAXP8Z6DmJd6TbGeg5Gq+4Z/7s3mszc9NoG3J2d+CphRrurvS2OHsaWnFIeen8z5w8LJDy49ddNkmylPaMMJEmSpNPrjBEGPeMbUSdyd3E6Yy+NPVgKDix
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 830x539.5 with 4 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
2024-09-17 09:26:04 +00:00
|
|
|
"source": [
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
"\n",
|
|
|
|
" figwidth = 8.3 \n",
|
|
|
|
" fig, axs = plt.subplots(2, 2, figsize=(figwidth, 0.65 * figwidth))\n",
|
|
|
|
"\n",
|
|
|
|
" for n, cat in enumerate(cats):\n",
|
|
|
|
" i, j = n // 2, n % 2\n",
|
|
|
|
" ax = axs[i, j]\n",
|
|
|
|
"\n",
|
|
|
|
" for sim in sims:\n",
|
|
|
|
" x = kfound[f\"{sim}_{cat}\"]\n",
|
|
|
|
" y = [neglnZ[f\"{sim}_{cat}_{ksim}\"] / np.log(10) for ksim in x]\n",
|
|
|
|
" x = np.array(x) * 0.674\n",
|
|
|
|
" ax.plot(x, y, label=simname_to_pretty(sim))\n",
|
|
|
|
" \n",
|
|
|
|
" # if no_Vext is None:\n",
|
|
|
|
" # y_no_field = neglnZ_no_field[cat] / np.log(10)\n",
|
|
|
|
" # if cat != \"CF4_TFR_w1\":\n",
|
|
|
|
" # ax.axhline(y_no_field, color=\"black\", ls=\"--\", label=\"No peculiar velocity\")\n",
|
|
|
|
" y_no_field = neglnZ_no_field[cat] / np.log(10)\n",
|
|
|
|
" ax.axhline(y_no_field, color=\"black\", ls=\"--\", label=\"No peculiar velocity\")\n",
|
|
|
|
"\n",
|
|
|
|
" y_dipole = neglnZ_dipole[cat] / np.log(10)\n",
|
|
|
|
" ax.axhline(y_dipole, color=\"black\", ls=\":\", label=\"Constant dipole\")\n",
|
|
|
|
"\n",
|
|
|
|
" ax.text(0.5, 0.9, catalogue_to_pretty(cat),\n",
|
|
|
|
" transform=ax.transAxes, #fontsize=\"small\",\n",
|
|
|
|
" verticalalignment='center', horizontalalignment='center',\n",
|
|
|
|
" bbox=dict(facecolor='white', alpha=0.5),\n",
|
|
|
|
" )\n",
|
|
|
|
"\n",
|
|
|
|
" if n == 0:\n",
|
|
|
|
" ax.legend(fontsize=\"small\", loc=\"upper left\")\n",
|
|
|
|
"\n",
|
|
|
|
" ax.set_ylabel(r\"$-\\Delta \\log \\mathcal{Z}$\")\n",
|
|
|
|
" ax.set_xlabel(r\"$R_{\\rm offset} ~ [\\mathrm{Mpc} / h]$\")\n",
|
|
|
|
" ax.set_xlim(0)\n",
|
|
|
|
"\n",
|
|
|
|
" fig.tight_layout()\n",
|
|
|
|
" fname = f\"../../plots/void_goodness_of_fit_observer.png\"\n",
|
|
|
|
" if no_Vext:\n",
|
|
|
|
" fname = fname.replace(\".png\", \"_no_Vext.png\")\n",
|
|
|
|
" print(f\"Saving to `{fname}`.\")\n",
|
|
|
|
" fig.savefig(fname, dpi=450)\n",
|
|
|
|
" fig.show()\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
2024-09-17 09:53:42 +00:00
|
|
|
"### 2. Single parameter radial dependence"
|
2024-09-17 09:26:04 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-17 20:01:15 +00:00
|
|
|
"execution_count": 5,
|
2024-09-11 06:45:42 +00:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2024-09-17 09:26:04 +00:00
|
|
|
"zcmb_max = 0.05\n",
|
2024-09-17 20:01:15 +00:00
|
|
|
"key = \"beta\"\n",
|
|
|
|
"# key_label = r\"$\\sigma_v ~ [\\mathrm{km} / \\mathrm{s}]$\"\n",
|
2024-09-17 09:53:42 +00:00
|
|
|
"# key_label = r\"$|\\mathbf{V}_{\\rm ext}| ~ [\\mathrm{km} / \\mathrm{s}]$\"\n",
|
2024-09-17 20:01:15 +00:00
|
|
|
"key_label = r\"$\\beta$\"\n",
|
2024-09-17 09:53:42 +00:00
|
|
|
"no_Vext = True\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-17 09:26:04 +00:00
|
|
|
"sims = [\"IndranilVoid_exp\", \"IndranilVoid_gauss\", \"IndranilVoid_mb\"]\n",
|
|
|
|
"cats = [\"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]\n",
|
2024-09-11 06:45:42 +00:00
|
|
|
"\n",
|
2024-09-17 09:26:04 +00:00
|
|
|
"data_mean = {}\n",
|
|
|
|
"data_std = {}\n",
|
|
|
|
"kfound = {}\n",
|
|
|
|
"for sim in sims:\n",
|
|
|
|
" for cat in cats:\n",
|
|
|
|
" kfound[f\"{sim}_{cat}\"] = []\n",
|
|
|
|
" for ksim in range(500):\n",
|
|
|
|
" sample_alpha = False\n",
|
|
|
|
" fname = paths.flow_validation(\n",
|
|
|
|
" fdir, sim, cat, inference_method=\"mike\", nsim=ksim,\n",
|
|
|
|
" sample_alpha=sample_alpha, zcmb_max=zcmb_max,\n",
|
2024-09-17 20:01:15 +00:00
|
|
|
" sample_beta=True,\n",
|
2024-09-17 09:26:04 +00:00
|
|
|
" no_Vext=no_Vext, verbose_print=False)\n",
|
|
|
|
"\n",
|
|
|
|
" if not exists(fname):\n",
|
|
|
|
" continue\n",
|
|
|
|
"\n",
|
|
|
|
" kfound[f\"{sim}_{cat}\"].append(ksim)\n",
|
|
|
|
" with File(fname, 'r') as f:\n",
|
|
|
|
" x = f[f\"samples/{key}\"][...]\n",
|
|
|
|
" if key == \"Vext\":\n",
|
|
|
|
" x = np.linalg.norm(x, axis=-1)\n",
|
|
|
|
"\n",
|
|
|
|
" data_mean[f\"{sim}_{cat}_{ksim}\"] = x.mean()\n",
|
|
|
|
" data_std[f\"{sim}_{cat}_{ksim}\"] = x.std()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2024-09-17 12:11:53 +00:00
|
|
|
"execution_count": null,
|
2024-09-17 09:53:42 +00:00
|
|
|
"metadata": {},
|
2024-09-17 12:11:53 +00:00
|
|
|
"outputs": [],
|
2024-09-17 20:01:15 +00:00
|
|
|
"source": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 8,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"Saving to `../../plots/void_beta_per_observer_no_Vext.png`.\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0AAAAIUCAYAAAAzC0wXAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9aXAUabrnif7cPTz2TaEdCQQSkECSmyAza8vaUlSfrfL0qQOVp6an73T3WCVzZ86dD2NjRdeXa3fmSxtYm821mR4bg7rTPX2m+2TnSar6VJ2l6hSqLWvJBVAmkOwotO9S7LuHu98PHhFSIAkESEgRen9pYRHu/rrHG0DGG39/nuf/SKZpmggEAoFAIBAIBALBNkDe7AkIBA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663KHXJhC7wNKFtgQ80LoP7+fs6cOVOpMy0L+idJtRYI6gkhgAT1xRaJAJ0/f57z58/z+uuv09DQQENDw4q9ed566y26u7uFO88TcurUKS5cuMCFCxe4fPkyP/vZzx54d/9xKFuRC2qb48ePP/SGQ39/f9W/n97eXt55550Nnplg0ynX/0DNu8AdPXqUhYUF9uzZQ0NDA6dOndqQ70WBoFYRKXCC+mKLCKDjx4+v2pvm/h4vS7e7u7sZHBxcdk5vb++q11tp/HYiFotx7ty5qh5JwWBw3Rf61Xr2COqPgYGBKtfGUCgkIorbgfwSAVTjEaBgMMjp06c5ffr0iscftG5s9zVFsD0QAkhQPxhF0AvV+zYxBW47kdFz3EqPbci1D3h24lacqx6/dOnSqjntsViMb3/
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 830x539.5 with 4 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
2024-09-17 09:26:04 +00:00
|
|
|
"source": [
|
|
|
|
"with plt.style.context('science'):\n",
|
|
|
|
" plt.rcParams.update({'font.size': 9})\n",
|
|
|
|
"\n",
|
|
|
|
" figwidth = 8.3\n",
|
|
|
|
" fig, axs = plt.subplots(2, 2, figsize=(figwidth, 0.65 * figwidth))\n",
|
|
|
|
"\n",
|
|
|
|
" for n, cat in enumerate(cats):\n",
|
|
|
|
" i, j = n // 2, n % 2\n",
|
|
|
|
" ax = axs[i, j]\n",
|
|
|
|
"\n",
|
|
|
|
" for sim in sims:\n",
|
|
|
|
" x = kfound[f\"{sim}_{cat}\"]\n",
|
|
|
|
" y = [data_mean[f\"{sim}_{cat}_{ksim}\"] for ksim in x]\n",
|
|
|
|
" yerr = [data_std[f\"{sim}_{cat}_{ksim}\"] for ksim in x]\n",
|
|
|
|
" x = np.array(x) * 0.674\n",
|
|
|
|
"\n",
|
|
|
|
" ax.plot(x, y, label=simname_to_pretty(sim))\n",
|
2024-09-17 20:01:15 +00:00
|
|
|
" ax.fill_between(x, np.array(y) - np.array(yerr), np.array(y) + np.array(yerr), alpha=0.5)\n",
|
2024-09-17 09:26:04 +00:00
|
|
|
"\n",
|
|
|
|
" ax.text(0.5, 0.9, catalogue_to_pretty(cat),\n",
|
|
|
|
" transform=ax.transAxes, #fontsize=\"small\",\n",
|
|
|
|
" verticalalignment='center', horizontalalignment='center',\n",
|
|
|
|
" bbox=dict(facecolor='white', alpha=0.5),\n",
|
|
|
|
" )\n",
|
|
|
|
"\n",
|
|
|
|
" if n == 0:\n",
|
|
|
|
" ax.legend(fontsize=\"small\", loc='upper right')\n",
|
|
|
|
"\n",
|
|
|
|
" ax.set_ylabel(key_label)\n",
|
|
|
|
" ax.set_xlabel(r\"$R_{\\rm offset} ~ [\\mathrm{Mpc} / h]$\")\n",
|
|
|
|
" ax.set_xlim(0),\n",
|
|
|
|
"\n",
|
|
|
|
" fig.tight_layout()\n",
|
|
|
|
" fname = f\"../../plots/void_{key}_per_observer.png\"\n",
|
|
|
|
" if no_Vext:\n",
|
|
|
|
" fname = fname.replace(\".png\", \"_no_Vext.png\")\n",
|
|
|
|
" print(f\"Saving to `{fname}`.\")\n",
|
|
|
|
" fig.savefig(fname, dpi=450)\n",
|
|
|
|
" fig.show()"
|
2024-09-11 06:45:42 +00:00
|
|
|
]
|
2024-07-12 14:46:45 +00:00
|
|
|
},
|
2024-07-01 10:48:50 +00:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
2024-07-03 08:51:00 +00:00
|
|
|
"source": []
|
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
|
|
|
|
}
|