csiborgtools/notebooks/flow/flow_bulk.ipynb

303 lines
766 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",
"\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+pzt27dz7bXXNjy2detW7rrrrlnXHxgYYNu2bdxxxx0zln3605/mk5/8JGvWrOH3fu/3+OAHP4jrzv52lstlyuVy9XelFKOjo3R2diKEONyhWiwWi8ViOYXRWjM5OcmKFSuQ8qWTrUtW2A0PDxNFEb29vQ2P9/b28uyzz876nP7+/lnX7+/vn3X9O+64g2w2y+/8zu80PH7NNdfwyle+ko6ODh566CGuv/56+vr6uPnmm2fdzk033cRf/MVfHOmhWSwWi8Viscxg//79rFq16iXXWbLC7kTwla98hXe+852kUqmGx+ujfueccw6JRIL3vve93HTTTSSTyRnbuf766xuek8vlWLNmDfv376elpQWASGl27XyWqGkZP/35L3hwMElxeA8vf9nZpDyHtkwCrSGdcOjNJlEanhuc4Ac7dvF83xRtTWnOXAEPPg/FODj4gTfDd56AXxwwvyddaGuClhSs64XfeuWRRwu7DjzOK39kUt4DK8/jp796zRE/13JsKUZFRouj/Nb632JZ87KF3h2LxWKxHGcmJiZYvXo12Wz2sOsuWWHX1dWF4zgMDAw0PD4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BKyTFQKGFRmsVmxMLogjKdWVvcVMsSbexx0Fjau9gbs0TAKrOBHcxTZ+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+yb19n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OSyIsGdsGBv5QJbIdHRkW1Ylgu7Mzw/KGJPHweM/FmTV34CyldxdULwKvPNstURRFURRlDqGiraIoikJnZyfXX389y5YtIxKJ0NbWxtve9jbuv/9+AJYsWYJhGDJ117JobW3l/e9/PwMDo/l7xWKR97znPWzcuBHbtnnHO94xS2dzduP7/rj4grE8//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": "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+DtRhAE7OzskE6nEQThjV5ORERERERExFucMAwZDodMTU0hiq8fk4uE3TeYnZ0dZmdn3+hlRERERERERLzN2NraYmZm5nW3iYTdN5h0Og2MT34mk3mDV/Nn5zPndvhf/uAcT4UfIyZ4OGIC9e9deaOXFRERERER8U3Hcn0s1yeXUG/7mW57tHUbWRTRFAnCEEEQSGsya60RubhKOaPdss9Kc8RSKcnl3QHZuMpkLs5GWycdkwmBTFyhb7hYnkcQwlwhecv+g8GA2dnZfY3xekTC7hvMa+nXTCbzlhZ2hYJJLJ4i7iukBB9HElHfwscTERERERFxr3TbOvMTydtebw0tGlbAfKVILqHSHtmIgkA+qXJ6q8fcRJlyOnbLPlsdgwcWJ3hlq8fBmQr5ZIxaz2SmWiQIQoqpGDs9k1hcYWS43D+Tu+u67qXEKxJ2EXdkvaWj2x6uPL5EBN9+g1cUERERERHxzcd0fDKacstrPcPBdH0Mx+d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ls5aWyeMrIwivs1Yb+kcqKQYWu5t0bogCMknVBpDm8r12a+1nkklG7tlfuxrXKz3EQWBI5MZYNx4eLE+pDm0+aGHZxEFOFvrMbI9ZgsJmiMbSRAgFMgmFPqmy+mtLn4QMl8cGx8nYzIDy6WYVPcbMxzv3rtiI2EXcUdEQaAxtPHCm1Kx3r3n+CMiIr41BME4pTSR0e5J1N3McjnFSlP/Jq0sIuLNR2NoMZ0fp1JN17/FYBhgva0jEDKZG4u6nZ5Jd+Qwm0/e9l4Dw+HMVp+HF/LAuOHhzFaPiazGYnk8fmylOSIIQk7O5jEdH1kU8IKQfFJhpTmkZzjM5BNUMhqeHzCyPWKySCWj7TdmtEc2n7u4d8/HGAm7iDsiigKHqqmvsjuJ5sVGRLzZWG/rzBb+7DVz88UE7VFUZhHx9qdvusiiiCKJ2J6P598arfaDkGxcoa2710364cxWjycOl297rzAMeWmzy6NLeTJxFT8IeWalxUNzeYaWi6ZItEYOmiKhO+NomyqJeH6IH4TUuiapmMJEVqOUinF1b8jQ9qhkNIqpGGEY0h7ZbHcN6j2LdywW7/k4I2EXcVdGlr8/eQIA996dryMiIr65eP54nuTiTSaofxYUScRw/KjeLuJtjen4DC13vw6ub7q3+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",
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}