mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-23 01:08:02 +00:00
219 lines
598 KiB
Text
219 lines
598 KiB
Text
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Calibrating the velocity field against observations "
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 95,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The autoreload extension is already loaded. To reload it, use:\n",
|
||
|
" %reload_ext autoreload\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"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",
|
||
|
"import csiborgtools\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": 136,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHWCAYAAAD6oMSKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOy9eZwlZX3v/36eqjpb9+l9mX1lGZQBFMMETaJGkiGikRsvUWMCGiLeJIiK4SpegwZvxEQlqBCJ+cWI9yXRmIWbMF4ioijCyCKgoCzD7Evvy+k+fZZanuf3x1Nn626Y6Z6lu2eet6+W6VN16lSdPqfqU9/l8xVaa43FYrFYLBaLZckjF3oHLBaLxWKxWCzHBivsLBaLxWKxWE4SrLCzWCwWi8ViOUmwws5isVgsFovlJMEKO4vFYrFYLJaTBCvsLBaLxWKxWE4SrLCzWCwWi8ViOUmwws5isVgsFovlJMEKO4vFYrFYLJaTBCvsLBaLxWKxWE4Slrywu+2221i3bh2pVIotW7bwyCOPvOT63/rWt9i0aROpVIrNmzfz7W9/u2G5EGLWn8985jPVddatWzdj+ac//enjcnwWi8VisVgsR8qSFnbf/OY3ufbaa/n4xz/O448/zrnnnsvWrVsZHBycdf2HHnqId7zjHVx55ZU88cQTXHrppVx66aU8/fTT1XX6+voafr7yla8ghOCtb31rw7ZuvPHGhvXe9773HddjtVgsFovFYjkcQmutF3on5suWLVv4pV/6JW699VYAlFKsXr2a973vfXzkIx+Zsf7b3vY2pqamuPvuu6uP/fIv/zLnnXcet99++6yvcemllzI5Ocl9991XfWzdunV84AMf4AMf+MCxPSCLxWKxWCyWo8Bd6B2YL77v85Of/ITrr7+++piUkosuuojt27fP+pzt27dz7bXXNjy2detW7rrrrlnXHxg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/UqhKyqNkcKojhKpxQIHSGEid5FdRYmUkAQQSpR9yLTxJ+aQ8QOIYkcszGpI4QK53aAx5FIzd2+5WRBCokUkkNThxZ6VywWyyKjUlOXyVjf0aVA5e90tLWQVtgtEoQA1zVRO09KPE/iCQkIMp4k7bk0pxyaEy5CCKQQRNo0ULii1hhRwZFQChqjckKY6ROeC4l5xGqjei+7sDT/gz3GFHwYyC30XiwcWS/L3om9+NZf0GKxzIJNvy4NjtXfyQq7RYIQAikFAoHnCJLS/C6lIOGY5oiU6+A4JgVLXIsnHW2sTURj1EpKmCxBuj5iJ8zjrmM6aOfqZaec2sbcYPEIu3zpyJt7T0Zaki1MlCcYKAwcfmWLxWKxnNRYYbeIiCKFRhMpZQyJtRFtijgaJ0wHbBiPo4gUCGXWEdSmTkBsd6IgUz/mVoNW4Psza/KOaP/cemFXnNcxHg/yRRgrmPfrVMSTHpGOGJiyws5isVhOdaywW0SIKDQ9Cco3s2OjMuUGzxKBKyTFQKGFRmsVmxMLogjKdWVvcVMsSbexx0Fjau9gbs0TAKrOBHcxTZ+IIkg6xt7lVKXJbWL3xG4idYoWG1oslpOS/v5+3ve+97FhwwaSySSrV6/mzW9+c3U86Lp16xBCIITAcRxWrFjBlVdeydjYWHUbpVKJd73rXWzevBnXdbn00ksX6GhODFbYLSKEMMrEJGSNCPNkpVvWFNIJacyJpRAEkfldEM9/rRN2WoOMU65OLOw0cQo2/mWuwi6qF3aLKBWrNDSloLy4XFhOKC3JFsZL44yURhZ6VywWi+WYsGfPHs4//3y+973v8ZnPfIannnqKe+65h9e//vX86Z/+aXW9G2+8kb6+Pvbt28fXv/51fvjDH3LNNddUl0dRRDqd5pprruG
|
||
|
"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)):\n",
|
||
|
" plt.plot(r, overdensity[i], c=c, lw=0.25, zorder=0, ls=\"dotted\")\n",
|
||
|
"plt.plot(r, np.median(overdensity, axis=0), c=c, lw=2, label=\"CB1\")\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"r, overdensity = read_enclosed_density(\"csiborg2_main\")\n",
|
||
|
"c = cols[1]\n",
|
||
|
"for i in range(len(overdensity)):\n",
|
||
|
" plt.plot(r, overdensity[i], c=c, lw=0.25, ls=\"dotted\")\n",
|
||
|
"plt.plot(r, np.median(overdensity, axis=0), c=c, lw=2, 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.35, label=\"Random\", zorder=-1)\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": 141,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABW0AAAHqCAYAAAB/bWzAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9d5hkV3muD987VK7OuWd6ck6SEAoDtkBCQoDAYGSOA5ZEMNgYBDYYy+LoYBA/kMHnkIyQv+ODhbAJBoMxIiiihDKKo8k5dU6Vw07fH2/n6Z7uCVJ3z7z3ddXVXbXT2ru6q9Z+1rOe1wiCIEBRFEVRFEVRFEVRFEVRFEWZE5iz3QBFURRFURRFURRFURRFURRlFBVtFUVRFEVRFEVRFEVRFEVR5hAq2iqKoiiKoiiKoiiKoiiKoswhVLRVFEVRFEVRFEVRFEVRFEWZQ6hoqyiKoiiKoiiKoiiKoiiKModQ0VZRFEVRFEVRFEVRFEVRFGUOoaKtoiiKoiiKoiiKoiiKoijKHEJFW0VRFEVRFEVRFEVRFEVRlDmEPdsNmEv4vk97ezsVFRUYhjHbzVEURVFeYYIgIJPJ0NraimnquOZM0O9ORVGUsxv97jxx9LtTURTl7Gam350q2o6hvb2dtra22W6GoiiKMsscPnyYhQsXznYz5gX63akoiqKAfneeCPrdqSiKosD0350q2o6hoqICkItWWVk5y61RFEVRXmnS6TRtbW0j3wfK9Oh3p6KMpz9X5kBvllctrgUgU3TY0ZHhgqW1M9r+yb19nLe4hrCtjkVlfqDfnSeOfncqiqKc3cz0u1NF2zEMT02prKzUL09FUZSzGJ2qOHP0u1NRxtOeT7OstZHKyvjI85ULR59PR095gEg8QUU0NO26vh/w9IF+LlpWd0ptVpTTgX53zhz97lQURVFg+u9OHcJXFEVRFEVRlFNgR2d65HfTMCh7/sjzIA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8//zzALS0tACwefNmtmzZQnd398g69957L5WVlSMRCxOJRCJUVlaOeyjK2YphgGUadKaLVMfD7O/L0Z0pUZeUIn6u7+P5AQd68+zpybK8QQTYIAhIF8qELBPHCzAxSA4VJzMNAz+Ap/b30VYTo6kyQrrokIhYREPHFk9Un+08p38/xGohooXlFEVRFEUZj4q2iqIoZzkHDhzg/PPP59e//jX/+I//yJYtW7jrrru49NJL+fCHPzyy3s0330xHRweHDh3iu9/9Lg8//DAf/ehHR5Z7nkcsFuOjH/0ol19++WycylnHjTfeyMMPP8yBAwfYsmULN954Iw8++CDvfve72bt3L5/73Od45plnOHDgAD/72c+49tprueSSS9i0aRMAb3zjG1m3bh3XXHMNL7zwAnfffTc33XQTH/7wh4lEItMcXVGUQtkjGQ1xsE8K/HVnipiGOZKd7fkBrhfgBz5+EGCZBqZhEAC7u7MsrIliEBAJmyMOWtf3KTk+/TmHSNgaKm5WYGHN5MUuHc9/Rc5VeRkYPAx2FCpbZrsliqIoiqLMQTTTVlEU5SznL//yLzEMg6eeeopEYjQrcf369bzvfe8beV5RUTEyZX7BggVcd911fP/73x9ZnkgkuO222wB49NFHGRwcfGVO4Cymu7uba6+9lo6ODqqqqti0aRN33303V1xxBYcPH+a+++7jq1/9Krlcjra2Nq6++mpuuummke0ty+LnP/85H/rQh9i8eTOJRILrrruOm2++eRbPSlHmD325MjXxMNGwSRAEdKWKNFZEuGdrJ74fUHZ9AmBbR4b6pAyE5Mou+3tzGEBbTZx4OEQpP+qONwx4/sgAl65uoj9X5kh/gdetbhhZXnS9cW3wAvXazlu8MlQtHPO
|
||
|
"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 in range(len(Vmag)):\n",
|
||
|
" axs[0].plot(r, Vmag[i], c=c, **thin_line_kwargs)\n",
|
||
|
" axs[1].plot(r, l[i], c=c, **thin_line_kwargs)\n",
|
||
|
" axs[2].plot(r, b[i], c=c, **thin_line_kwargs)\n",
|
||
|
"\n",
|
||
|
"axs[0].plot(r, np.median(Vmag, axis=0), c=c, lw=2, label=\"CB1\")\n",
|
||
|
"axs[1].plot(r, np.median(l, axis=0), c=c, lw=2)\n",
|
||
|
"axs[2].plot(r, np.median(b, axis=0), c=c, lw=2)\n",
|
||
|
"\n",
|
||
|
"# CSiBORG2\n",
|
||
|
"r, Vmag, l, b = read_enclosed_flow(\"csiborg2_main\")\n",
|
||
|
"c = cols[1]\n",
|
||
|
"for i in range(len(Vmag)):\n",
|
||
|
" axs[0].plot(r, Vmag[i], c=c, **thin_line_kwargs)\n",
|
||
|
" axs[1].plot(r, l[i], c=c, **thin_line_kwargs)\n",
|
||
|
" axs[2].plot(r, b[i], c=c, **thin_line_kwargs)\n",
|
||
|
"\n",
|
||
|
"axs[0].plot(r, np.median(Vmag, axis=0), c=c, lw=2, label=\"CB2\")\n",
|
||
|
"axs[1].plot(r, np.median(l, axis=0), c=c, lw=2)\n",
|
||
|
"axs[2].plot(r, np.median(b, axis=0), c=c, lw=2)\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": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "venv_csiborg",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"file_extension": ".py",
|
||
|
"mimetype": "text/x-python",
|
||
|
"name": "python",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"version": "3.11.7"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|