csiborgtools/notebooks/flow/flow_bulk.ipynb

345 lines
480 KiB
Text
Raw Normal View History

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calibrating the velocity field against observations "
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"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",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"from flow_bulk import *\n",
"\n",
"%load_ext autoreload\n",
"%autoreload 2\n",
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Enclosed overdensity"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHWCAYAAAD6oMSKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOy9eXxkZZm+f73vWWrNvqcXmqVZuxtka1kUBcZuxRkZGUQGBdEBHUVAlAEcBYWv4IyKiCB8dIYRHRHlp8OM6KCIMCq0hK1Zu6H3Jfue1F7nnPf3x6lUp5JKqlJJdZLmXHyaTuq8Z6tOqu56lvsRSimFh4eHh4eHh4fHokfO9wV4eHh4eHh4eHjMDZ6w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S42YTcSAcsCo4RfK9MEy0Zu24Nz6PIZ725Ig+Hk8MzP6+HhccAwkkiTSM1RRqUI/KZGpd/rxl9oeMJuHik6ITpV80SBXKyS+ReUYlAMuHNdmUNhp+uoYMDtJJ2AQCy6GrsZW51MpCKI3LwdzjipqJFk4/HrfoZTw9iOnXd2sIeHx4HNSCLNdx/fwkA0td/OWRsy+exZK2ck7rq6uvja177Gr3/9a9rb22lsbOS4447j6quv5qyzzmLFihXs2rULACklTU1NvPe97+Wb3/xmdrpTIpHgU5/6FM8//zybNm3i/e9/Pw8//HA5bnFR4gm7RYHKaRwtpsZOKHDyROxAlJ6Kle6Py5wJO0BVBN1O0omPswgjdkMjs7JnUdWViI4e5O4OnJUrZrSvT/MxmholZsWoMCtKvgYPD4/FSSJlMxBN4dM
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure()\n",
"cols = plt.rcParamsDefault['axes.prop_cycle'].by_key()['color']\n",
"\n",
"r, overdensity = read_enclosed_density(\"csiborg1\")\n",
"c = cols[0]\n",
"ymin = np.percentile(overdensity, 16, axis=0)\n",
"ymed = np.median(overdensity, axis=0)\n",
"ymax = np.percentile(overdensity, 84, axis=0)\n",
"plt.fill_between(r, ymin, ymax, color=c, alpha=0.5, label=\"CB1\")\n",
"\n",
"\n",
"r, overdensity = read_enclosed_density(\"csiborg2_main\")\n",
"c = cols[1]\n",
"ymin = np.percentile(overdensity, 16, axis=0)\n",
"ymed = np.median(overdensity, axis=0)\n",
"ymax = np.percentile(overdensity, 84, axis=0)\n",
"plt.fill_between(r, ymin, ymax, color=c, alpha=0.5, label=\"CB2\")\n",
"\n",
"\n",
"r, overdensity = read_enclosed_density(\"csiborg2_random\")\n",
"c = cols[2]\n",
"ymin = np.percentile(overdensity, 16, axis=0)\n",
"ymed = np.median(overdensity, axis=0)\n",
"ymax = np.percentile(overdensity, 84, axis=0)\n",
"plt.fill_between(r, ymin, ymax, color=c, alpha=0.25, label=\"Random\", zorder=-1)\n",
"\n",
"r, overdensity = read_enclosed_density(\"csiborg2X\")\n",
"c = cols[3]\n",
"ymin = np.percentile(overdensity, 16, axis=0)\n",
"ymed = np.median(overdensity, axis=0)\n",
"ymax = np.percentile(overdensity, 84, axis=0)\n",
"plt.fill_between(r / 0.7, ymin, ymax, color=c, alpha=0.5, label=\"Manticore\")\n",
"\n",
"\n",
"\n",
"plt.xlabel(r\"$R ~ [\\mathrm{Mpc} / h]$\")\n",
"plt.ylabel(r\"$\\delta_{\\rm enc} (r \\leq R)$\")\n",
"plt.legend()\n",
"\n",
"plt.xlim(0, r.max())\n",
"plt.ylim(-0.15, 0.075)\n",
"plt.axhline(0, c='k', ls='--', lw=1)\n",
"plt.tight_layout()\n",
"plt.savefig(\"../../plots/enclosed_density.png\", dpi=450)\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Enclosed bulk flow"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(101, 500, 3)\n"
]
}
],
"source": [
"r, Vmag, l, b = read_enclosed_flow(\"csiborg1\")"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(2, 100, 3)\n"
]
}
],
"source": [
"r, Vmag, l, b = read_enclosed_flow(\"csiborg2X\")"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABW0AAAHqCAYAAAB/bWzAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdeXwV9bn48c/MnDX7QlYIhCUoqwtuiNVWbdGi195yu3ordrPXaq21t7W21ra01m7XWm8tvfVn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L5ereRtM0li5dSlNTE7FYjJdffpnp06encdRCCCHGohETtF27di2NjY3dt5deegmAj33sYwB87Wtf41//+hd/+9vfWL58Ofv37+ejH/1o9+tN02TRokUkEglWrlzJww8/zEMPPdTjiuiAhFogGTuxfQghxDCxbbvP237jG99g48aNbN68mVdeeQWARYsWYZr9L8kghBBHY4XD2PK5IoQQQgyL2PbtdPzpT1iJ4WmcLIQYOiMmaFtUVERpaWn37emnn2bq1KlcdNFF+P1+HnjgAe6++24uvvhi5s2bx4MPPsjKlSt5++23AXjxxReprq7mT3/6E6effjqXX345P/zhD7nvvvtInMiH1erfwqZHj7+dEEKMAFVVVWia1t1s7FjGjRvHtGnTqKqq4uKLL+aee+5h5cqVvPbaa8MwUiHEWGeGwgReeYWWX91LdNPmdA9HCCGEGPOSzc34Hn+cyLr1JGpr0z0cIcQJGjFB20MlEgn+9Kc/8bnPfQ5
"text/plain": [
"<Figure size 1400x500 with 3 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, axs = plt.subplots(1, 3, figsize=(14, 5))\n",
"cols = plt.rcParamsDefault['axes.prop_cycle'].by_key()['color']\n",
"thin_line_kwargs = {\"lw\": 0.3, \"zorder\": 0, \"ls\": \"dotted\"}\n",
"\n",
"# CSiBORG1\n",
"r, Vmag, l, b = read_enclosed_flow(\"csiborg1\")\n",
"c = cols[0]\n",
"for i, y in enumerate([Vmag, l, b]):\n",
" ymin, ymed, ymax = np.percentile(y, [16, 50, 84], axis=0)\n",
" axs[i].fill_between(r, ymin, ymax, color=c, alpha=0.5, label=\"CB1\")\n",
"\n",
"# CSiBORG2\n",
"r, Vmag, l, b = read_enclosed_flow(\"csiborg2_main\")\n",
"c = cols[1]\n",
"for i, y in enumerate([Vmag, l, b]):\n",
" ymin, ymed, ymax = np.percentile(y, [16, 50, 84], axis=0)\n",
" axs[i].fill_between(r, ymin, ymax, color=c, alpha=0.5, label=\"CB2\")\n",
"\n",
"# Manticore\n",
"r, Vmag, l, b = read_enclosed_flow(\"csiborg2X\")\n",
"c = cols[3]\n",
"for i, y in enumerate([Vmag, l, b]):\n",
" ymin, ymed, ymax = np.percentile(y, [16, 50, 84], axis=0)\n",
" axs[i].fill_between(r, ymin, ymax, color=c, alpha=0.5, label=\"Manticore\")\n",
"\n",
"\n",
"# Random\n",
"r, Vmag, l, b = read_enclosed_flow(\"csiborg2_random\")\n",
"c = cols[2]\n",
"ymin = np.percentile(Vmag, 16, axis=0)\n",
"ymax = np.percentile(Vmag, 84, axis=0)\n",
"ymed = np.median(Vmag, axis=0)\n",
"axs[0].fill_between(r, ymin, ymax, color=c, alpha=0.35, zorder=-1,\n",
" label=\"Random\")\n",
"\n",
"\n",
"axs[0].legend()\n",
"for i in range(3):\n",
" axs[i].set_xlabel(r\"$R ~ [\\mathrm{Mpc} / h]$\")\n",
" axs[i].set_xlim(0, r.max())\n",
"\n",
"axs[0].set_ylim(0)\n",
"axs[0].set_ylabel(r\"$V_{\\rm enc} (r \\leq R) ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
"axs[1].set_ylabel(r\"$l_{\\rm enc} (r \\leq R) ~ [\\mathrm{deg}]$\")\n",
"axs[2].set_ylabel(r\"$b_{\\rm enc} (r \\leq R) ~ [\\mathrm{deg}]$\")\n",
"axs[1].set_ylim(0, 360)\n",
"\n",
"fig.tight_layout()\n",
"fig.savefig(\"../../plots/enclosed_flow.png\", dpi=450)\n",
"fig.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Enclosed overdensity $\\texttt{BORG2}$ all"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
"paths = csiborgtools.read.Paths(**csiborgtools.paths_glamdring)\n",
"nsims = paths.get_ics(\"borg2_all\")\n",
"\n",
"r, overdensity = read_enclosed_density(\"borg2_all\")\n",
"overdensity_A = overdensity[:80]\n",
"overdensity_B = overdensity[80:][::30]"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([ 7500, 7600, 7700, 7800, 7900, 8000, 8100, 8200, 8300,\n",
" 8400, 8500, 8600, 8700, 8800, 8900, 9000, 9100, 9200,\n",
" 9300, 9400, 9500, 9600, 9700, 9800, 9900, 10000, 10100,\n",
" 10200, 10300, 10400, 10500, 10600, 10700, 10800, 10900, 11000,\n",
" 11100, 11200, 11300, 11400, 11500, 11600, 11700, 11800, 11900,\n",
" 12000, 12100, 12200, 12300, 12400, 12500, 12600, 12700, 12800,\n",
" 12900, 13000, 13100, 13200, 13300, 13400, 13500, 13600, 13700,\n",
" 13800, 13900, 14000, 14100, 14200, 14300, 14400, 14500, 14600,\n",
" 14700, 14800, 14900, 15000, 15100, 15200, 15300, 15400])"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"nsims[:80]"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHWCAYAAAD6oMSKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9d7gc+XnfiX4qdnXO3SdH5AFmgAnkDIccckiapCKtsFrJWlmyZXPvXdGWTdnX0tqWvOukZ4Nsybas62d9fVcPLUuWZF1LlsQgDkmRnByAQQ4nnz59TudUOd0/GnMAEMAQlEhOYH2eB88D9Klq/Kq6+tS33vB9hTAMQyIiIiIiIiIiIt7yiG/0AiIiIiIiIiIiIr4xRMIuIiIiIiIiIuJtQiTsIiIiIiIiIiLeJkTCLiIiIiIiIiLibUIk7CIiIiIiIiIi3iZEwi4iIiIiIiIi4m1CJOwiIiIiIiIiIt4mRMIuIiIiIiIiIuJtgvxGL+DtRhAE7OzskE6nEQThjV5ORERERERExFucMAwZDodMTU0hiq8fk4uE3TeYnZ0dZmd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13vw6ub7q3+dZtdgyCMNy3K3lls8tyOXXH79fLm10EYK6QwvUCnl5p8cShCo2RTSmljkWkJFw3M9aQJZG2blPrmWQ0hYQqU0nHkASBi/UBqiyyXE4hiwKNgUW9b5GMySiSCAJfV51dJOwi7orlB7dG7NwoZRMR8WagObSp9y0OVO580/l6mS0kWG9H3++Ity/d6ylPGJcvmM6tNWuOF5BQJUwnQBAEXM+nb7gcmkjf9l7na336hssDs3kGpsvp7R7vOVi
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure()\n",
"cols = plt.rcParamsDefault['axes.prop_cycle'].by_key()['color']\n",
"\n",
"# r, overdensity = read_enclosed_density(\"csiborg1\")\n",
"c = cols[0]\n",
"for i in range(len(overdensity_A)):\n",
" plt.plot(r, overdensity_A[i], c=c, lw=0.2, zorder=0, ls=\"dotted\")\n",
"plt.plot(r, np.median(overdensity_A, axis=0), c=c, lw=2, label=r\"Chain index: $7500$ to $15000$\")\n",
"\n",
"c = cols[1]\n",
"for i in range(len(overdensity_B)):\n",
" plt.plot(r, overdensity_B[i], c=c, lw=0.2, zorder=0, ls=\"dotted\")\n",
"plt.plot(r, np.median(overdensity_B, axis=0), c=c, lw=2, label=r\"Chain index: $15000$ to $17000$\")\n",
"\n",
"\n",
"\n",
"plt.xlabel(r\"$R ~ [\\mathrm{Mpc} / h]$\")\n",
"plt.ylabel(r\"$\\delta_{\\rm enc} (r \\leq R)$\")\n",
"plt.legend()\n",
"\n",
"plt.xlim(0, r.max())\n",
"plt.ylim(-0.14, -0.005)\n",
"plt.axhline(0, c='k', ls='--', lw=1)\n",
"plt.tight_layout()\n",
"plt.savefig(\"../../plots/enclosed_density_BORG2.png\", dpi=450)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "venv_csiborg",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2024-06-26 09:46:33 +00:00
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}