mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 22:18:01 +00:00
476 lines
1.1 MiB
Text
476 lines
1.1 MiB
Text
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"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",
|
||
|
"from h5py import File\n",
|
||
|
"from astropy.cosmology import FlatLambdaCDM\n",
|
||
|
"\n",
|
||
|
"import csiborgtools\n",
|
||
|
"\n",
|
||
|
"SPEED_OF_LIGHT = 299792.458 # km / s\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"%load_ext autoreload\n",
|
||
|
"%autoreload 2\n",
|
||
|
"%matplotlib inline\n",
|
||
|
"\n",
|
||
|
"paths = csiborgtools.read.Paths(**csiborgtools.paths_glamdring)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Read in upGLADE\n",
|
||
|
"\n",
|
||
|
"- Mask out galaxies with bad redshifts\n",
|
||
|
"- Convert heliocentric redshifts to the CMB frame."
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Initially, we have 3313157 objects.\n",
|
||
|
"Masking 1174652 objects that have `e_zhelio` < 0 or `zhelio` < 0.\n",
|
||
|
"Masking 1714681 objects that have `e_zhelio` / `zhelio` > 0.1.\n",
|
||
|
"Finally, we have 423824 objects.\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"name": "stderr",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"/tmp/ipykernel_2891959/606063485.py:16: RuntimeWarning: divide by zero encountered in divide\n",
|
||
|
" mask = (data[\"e_zhelio\"] / data[\"zhelio\"] > 0.1) | (data[\"e_zhelio\"] > 0.1) #& ~np.isnan(data[\"zhelio\"])\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"fname = \"/mnt/users/rstiskalek/csiborgtools/data/upglade_z_0p05_all.h5\"\n",
|
||
|
"data = {}\n",
|
||
|
"with File(fname, \"r\") as f:\n",
|
||
|
" for i, key in enumerate([\"RA\", \"dec\", \"zhelio\", \"e_zhelio\"]):\n",
|
||
|
" data[key] = f[\"data\"][\"block0_values\"][:, i]\n",
|
||
|
"data[\"DEC\"] = data.pop(\"dec\")\n",
|
||
|
"\n",
|
||
|
"print(f\"Initially, we have {data['zhelio'].size} objects.\")\n",
|
||
|
"\n",
|
||
|
"# Ask about this\n",
|
||
|
"mask = (data[\"e_zhelio\"] < 0) | (data[\"zhelio\"] < 0)\n",
|
||
|
"print(f\"Masking {mask.sum()} objects that have `e_zhelio` < 0 or `zhelio` < 0.\")\n",
|
||
|
"for key in data.keys():\n",
|
||
|
" data[key][mask] = np.nan\n",
|
||
|
"\n",
|
||
|
"mask = (data[\"e_zhelio\"] / data[\"zhelio\"] > 0.1) | (data[\"e_zhelio\"] > 0.1) #& ~np.isnan(data[\"zhelio\"])\n",
|
||
|
"print(f\"Masking {mask.sum()} objects that have `e_zhelio` / `zhelio` > 0.1.\")\n",
|
||
|
"for key in data.keys():\n",
|
||
|
" data[key][mask] = np.nan\n",
|
||
|
"\n",
|
||
|
"print(f\"Finally, we have {np.sum(np.isfinite(data['zhelio']))} objects.\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHWCAYAAAD6oMSKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAADRkElEQVR4nOz9eXxcd33o/7/OMvto31fLe7zbcRwnIYEEHMLShECgKVAIlAtcyKWFXLiFcgttv2Vp4f5I27gtTVt2CATqkBCakARCEnBix4vi3fIma5dGI81+5sxZfn+MNJZs2ZYdyZLl9/PxMESj0TmfsTVz3ufz+bzfb8V1XRchhBBCCHHZU2d6AEIIIYQQYmpIYCeEEEIIMUdIYCeEEEIIMUdIYCeEEEIIMUdIYCeEEEIIMUdIYCeEEEIIMUdIYCeEEEIIMUdIYCeEEEIIMUfoMz2Ay4XjOHR3d1NUVISiKDM9HCGEEEJcIVzXJZFIUF9fj6qee05OArtJ6u7upqmpaaaHIYQQQogrVEdHB42Njed8jgR257F582Y2b96MZVlA/i+1uLh4hkclhBBCiCtFPB6nqamJoqKi8z5XkV6xkxOPxykpKSEWi0lgJ4QQQohL5kJiEEmeEEIIIYSYIySwE0IIIYSYIySwE0IIIYSYIySwE0IIIYSYIySwO4/NmzezfPlyNmzYMNNDEUIIIYQ4J8mKnSTJihVCCCHETJCsWCGEEEKIK5AEdkIIIYQQc4QEdkIIIYQQc4QEdkIIIYQQc4QEduchWbFCCCGEuFxIVuwkSVasEEIIIWaCZMUKIYQQQlyBJLATQgghhJgjJLATQgghhJgjJLATQgghhJgjJLATQgghhJgjJLATQgghhJgjJLA7D6ljJ4QQQojLhdSxmySpYyeEEEKImSB17IQQQgghrkAS2AkhhBBCzBES2AkhhBBCzBES2AkhhBBCzBES2AkhhBBCzBES2AkhhBBCzBES2AkhhBBCzBES2AkhhBBCzBES2AkhhBBCzBES2J2HtBQTQgghxOVCWopNkrQUE0IIIcRMkJZiQgghhBBXIAnshBBCCCHmCAnshBBCCCHmCAnshBBCCCHmCAnshBBCCCHmCAnshBBCCCHmCAnshBBCCCHmCAnshBBCCCHmCAnshBBCCCHmCAnshBBCCCHmCAnshBBCCCHmCAnshBBCCCHmiCsmsOvo6ODmm29m+fLlrF69mocffnimhySEEEIIMaX0mR7ApaLrOvfffz9r166lt7eX9evX85a3vIVQKDTTQxNCCCGEmBJXTGBXV1dHXV0dALW1tVRWVhKNRiWwE0IIIcScMWuWYp977jluv/126uvrURSFRx555IznbN68mZaWFvx+Pxs3bmTbtm0Xda4dO3Zg2zZNTU2vctRCCCGEELPHrAnsUqkUa9asYfPmzRN+/8c//jH33XcfX/ziF9m5cydr1qzhtttuo7+/v/CctWvXsnLlyjP+dHd3F54TjUZ5//vfz7/9279N+2sSQgghhLiUFNd13ZkexOkURWHLli3ceeedhcc2btzIhg0beOCBBwBwHIempiY+8YlP8NnPfnZSx81ms9x66618+MMf5n3ve995n5vNZgtfx+NxmpqaiMViFBcXX/iLEkIIIYS4CPF4nJKSkknFILNmxu5cTNNkx44dbNq0qfCYqqps2rSJrVu3TuoYruvygQ98gNe//vXnDeoAvvKVr1BSUlL4I8u2QgghhJjtLovALhKJYNs2NTU14x6vqamht7d3Usf43e9+x49//GMeeeQR1q5dy9q1a9mzZ89Zn/+5z32OWCxW+NPR0fGqXoMQQgghxHS7YrJib7zxRhzHmfTzfT4fPp9vGkckhBBCCDG1LosZu8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|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure()\n",
|
||
|
"plt.scatter(data[\"zhelio\"], data[\"e_zhelio\"], s=0.1)\n",
|
||
|
"\n",
|
||
|
"plt.yscale(\"log\")\n",
|
||
|
"plt.xscale(\"log\")\n",
|
||
|
"plt.xlabel(r\"$z_{\\rm helio}$\")\n",
|
||
|
"plt.ylabel(r\"$\\sigma_{z_{\\rm helio}}$\")\n",
|
||
|
"\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 4,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Masking 10510 objects that have `zcmb` > 0.06.\n",
|
||
|
"Finally, we have 413314 objects.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"zcmb, e_zcmb = csiborgtools.heliocentric_to_cmb(data[\"zhelio\"], data[\"RA\"], data[\"DEC\"], data[\"e_zhelio\"])\n",
|
||
|
"data[\"zcmb\"] = zcmb\n",
|
||
|
"data[\"e_zcmb\"] = e_zcmb\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"mask = (data[\"zcmb\"] > 0.06) #& ~np.isnan(data[\"zhelio\"])\n",
|
||
|
"print(f\"Masking {mask.sum()} objects that have `zcmb` > 0.06.\")\n",
|
||
|
"for key in data.keys():\n",
|
||
|
" data[key][mask] = np.nan\n",
|
||
|
"\n",
|
||
|
"print(f\"Finally, we have {np.sum(np.isfinite(data['zhelio']))} objects.\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 56,
|
||
|
"metadata": {},
|
||
|
"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AjB6uoqP/MzP8PP/uzPAjCZTFhaWuJ3fud3+KEf+iGgWrH74Ac/yAc/+MG/1utMkoQkSY6/nk6nrK+vM5lMaDQa/6tvX5IkSZKkW9h0OqXZbL7heeFNsWKXpilf/vKXefe73318n6qqvPvd7+app5563cc89dRTr7ke4LHHHju+/tq1a+zt7b3mmmazySOPPPKXfuav/Mqv0O12efDBB/m1X/s18jz/K1/rxz72MZrN5vFtfX39m36/kiRJkiTd+oQQBEnOzVxD02/aM30D/X6foihYWlp6zf1LS0u8/PLLr/uYvb29171+b2/v+PtH9/1V1wD85E/+JG95y1vodDp8/vOf58Mf/jC7u7v8+q//+us+74c//GGeeOKJ46+PVuwkSZIkSfruI4QgTAscQyVMCwA8S0dRFMK0wDW14/tvhjdFsPt2enVIu++++zBNkx//8R/nYx/7GJZl/aXrLct63fslSZIkSbp1HQU419QAjv8dJNUuX3+W4Fr6a74nhMCPMxRFuWmrdm+Krdher4emaezv77/m/v39fZaXl1/3McvLy9/w+qP/fjM/E6qzfnmec/369W/2bUiSJEmSdIt69eqbH2cEcYYfZ8fbrbbx9Uh1dJ1n6URZiWfpN23V7k0R7EzT5KGHHuKzn/3s8X1lWfLZz36WRx999HUf8+ijj77meoDPfOYzx9efOXOG5eXl11wznU55+umn/8qfCfDcc8+hqiqLi4t/k7ckSZIkSdIt5CisuaZGlBZYusLmMEQIgWfpqKpKzTao2QaKouAYKoezhK5nvGal7432ptmKfeKJJ/jRH/1R3vrWt/K2t72N3/iN3yAIAt73vvcB8N73vpe1tTU+9rG
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure()\n",
|
||
|
"\n",
|
||
|
"plt.scatter(data[\"zcmb\"], data[\"e_zcmb\"], s=0.001)\n",
|
||
|
"plt.xlabel(r\"$z_{\\rm CMB}$\")\n",
|
||
|
"plt.ylabel(r\"$\\sigma_{z_{\\rm CMB}}$\")\n",
|
||
|
"\n",
|
||
|
"plt.xlim(0, 0.05)\n",
|
||
|
"plt.ylim(0, 0.006)\n",
|
||
|
"\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.savefig(\"../../plots/UPGLADE_zcmb_vs_ezcmb.png\")\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"- Write only masked galaxies to this file, but also save the mask."
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 6,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Writing 413314 objects to `/mnt/users/rstiskalek/csiborgtools/data/upglade_z_0p05_all_PROCESSED.h5`.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"fname = \"/mnt/users/rstiskalek/csiborgtools/data/upglade_z_0p05_all_PROCESSED.h5\"\n",
|
||
|
"mask = np.isfinite(data[\"RA\"])\n",
|
||
|
"print(f\"Writing {mask.sum()} objects to `{fname}`.\")\n",
|
||
|
"\n",
|
||
|
"with File(fname, \"w\") as f:\n",
|
||
|
" for key in data.keys():\n",
|
||
|
" f[key] = data[key][mask]\n",
|
||
|
"\n",
|
||
|
" f[\"mask\"] = mask"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"- Having generated this file, next step is to run `field_los.py` to evaluate the density and velocity field along the LOS of each object that is not masked.\n",
|
||
|
"- Then, the next step is to run `post_upglade.py` to calculate the cosmological redshift of each object in UPGLADE.\n",
|
||
|
" - Based on Carrick2015 samples calibrated against Pantheon+"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"### Results verification"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 57,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHVCAYAAAB8NLYkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9eYxk130fjn7uvlVVdy3dPdPTPTNchqQkiqItyZT0nDjB0wMNGC8hXhDIDmI5guAlQGTLtCNYji05iRMZtuU4ig0IDuA4CWBIUIIIgeMI8ZPzHt7PJqjIImVSEjnDbbp7ZnqppWu5+/b+OPecPnXnVnd1T89C8nyAxgy7b9177rnVrM98vt/P5yvleZ5DQEBAQEBAQEDgTQ/5bi9AQEBAQEBAQEDgdCCInYCAgICAgIDAWwSC2AkICAgICAgIvEUgiJ2AgICAgICAwFsEgtgJCAgICAgICLxFIIidgICAgICAgMBbBILYCQgICAgICAi8RSCInYCAgICAgIDAWwSC2AkICAgICAgIvEUgiJ2AgICAgICAwFsE9xSx+/3f/31cvHgRpmniiSeewDe+8Y1Dj//KV76CRx55BKZp4t3vfjf+9E//dOrneZ7jM5/5DM6ePQvLsvDhD38YV65cuek8/+N//A888cQTsCwLzWYTTz311GneloCAgICAgIDAHcE9Q+y+/OUv4+mnn8ZnP/tZfOtb38J73vMePPnkk9jd3a08/i//8i/xYz/2Y/j4xz+O5557Dk899RSeeuopvPjii+yY3/zN38QXvvAFfPGLX8Szzz4Lx3Hw5JNPIggCdsx//a//FT/+4z+Oj33sY/j2t7+Nv/iLv8A/+Af/4Lbfr4CAgICAgIDAaUPK8zy/24sAgCeeeALvf//78Xu/93sAgCzLsL6+jk984hP4pV/6pZuO/8hHPgLXdfEnf/In7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F63ecgIT9LKez1rigRvXjjsWP5eZv29qn/vOM97Vl/fcd8798p7TRA7AQEBAYG3LO71vrd5CNQ85I8StSzLKsOE+XOUyRGdA3uritKs3Luq/T/OsXSPaLl0llP3sHMARxOvw8hw1evnUT7vBtkTxE5AQEBA4C2LN8NEgdP48Ke9YlVxJPTnlATNIkq3ivJe82Xf8jWqnstRz+owEkyvMyuAGAArt1KDxVHnP4roHaWSlo8RrlgBAQEBAYFbxN2Y83pconZarsp5I0go5iFKJylp8uSSJ5NHXftWnhXdo8PUR+qepQYL/j5pXEqaptgdBciy7EiiN08p+KSRKrcCQewEBAQEBAROEcctyZ2Wq5KPIDntsupJiN6dVEvnuZYkScxgQY0SVE3sTiLYuoLNgc8ctlWv54nePKXgcrTKnYAgdgICAgICAqeIo0pyZdxrrkrgoGePllOPqzqVZ7Pe7jLkvHtUNkoA5NlQFW9t0cRG30Pb0U60jsMIpnDFCggICAgInAAniQc5zWtVkYzjqFfHWdvtas4v57sdV33jg4OPSwhP+36qTA/0e7TXECCOXj/OcKHtIEgOv/6sdd4NEl6GIHYCAgICAm8pnCQe5HZeCzheP9tx1nY7+7d4MndcwkJfywcGzwJ//7fjfqpMD3zvX57nTKXzuTiY45xz1v3cDQhiJyAgICDwlsK88SCn0f9VLlmeBPO4Kw+7/u3qY7sV9Ym+VpblI89RVgRP+374c1Y5db0oxXrTIv11dWOuez5snXc7YkcQOwEBAYG3Ke62snC7MA8hqTrmpE7Q446kKuMkQbv32uD5W7nerSiD84A/Z5VTl7ppOzXjpuuepOR6tyN2BLETEBAQeJvibisL9xLyPMfeOGTN/sfBrX6QS5LE8tWyLANw9LOhZKM7DucOAL6dmPd68/Yknib4a1Y9q8PI+Un28W732Ql
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"fname = \"/mnt/extraspace/rstiskalek/csiborg_postprocessing/peculiar_velocity/UPGLADE/zcosmo_UPGLADE.hdf5\"\n",
|
||
|
"\n",
|
||
|
"with File(fname, \"r\") as f:\n",
|
||
|
" indxs = f[\"indxs\"][:]\n",
|
||
|
" mean_zcosmo = f[\"mean_zcosmo\"][:]\n",
|
||
|
" std_zcosmo = f[\"std_zcosmo\"][:]\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"plt.scatter(mean_zcosmo, std_zcosmo, s=0.001)\n",
|
||
|
"\n",
|
||
|
"plt.xlabel(r\"$z_{\\rm cosmo}$\")\n",
|
||
|
"plt.ylabel(r\"$\\sigma_{z_{\\rm cosmo}}$\")\n",
|
||
|
"\n",
|
||
|
"plt.xlim(0, 0.05)\n",
|
||
|
"plt.ylim(0, 0.006)\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.savefig(\"../../plots/UPGLADE_zcosmo_vs_ezcosmo.png\")\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"#### Combine datasets\n",
|
||
|
"i.e. match to the original UPGLADE file"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 58,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"data[\"zcosmo\"] = np.zeros_like(data[\"RA\"])\n",
|
||
|
"data[\"zcosmo\"][mask] = mean_zcosmo\n",
|
||
|
"\n",
|
||
|
"data[\"e_zcosmo\"] = np.zeros_like(data[\"RA\"])\n",
|
||
|
"data[\"e_zcosmo\"][mask] = std_zcosmo"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 59,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGg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r/+DXmAQ7IYQQQlw3NE1j/4UwT56bYSiSZjicZzC+eG1MVODOVU4mcwrvXBPkjtVBVFVlz8rGRfseryUJdkIIIcR14vXauqRG0zS++svzPDMQJpzOEc5UiC5SplOANU02Vjc6OB/J89m3r6WkM29b0+vB9XW1QgghxOvY3NYlr5au6wxFslxPO4s+cW6Gh56f4NhoirORxQt1BqDba6HH56CvxcuP/+9dlFGui6HXi0nFTgghhLhOLGbrkuuhv10tfFYrFX72/BQPPT9JJFUguwgLI2pUwG6E23p8vGVDK3esaUJRlOtm6PViEuyEEEKI68RCrUuudnh2ufe303WdJ8+HGZpJ8YOjowzN5Mloi/PZKqABnS6FqmLkc+9YS1+LlxUBx3U/xC3BTgghhLiOXW3lbTn3t6tWq3z9ySFW+Cz89Llxzk7nKS/SZ7uM4LaqbGxroNFj503rmrhjddN1H+hqJNgJIYQQ17HlXnm7Urqu87UnBlndaOX/eeB5IlmdxRp5tauwrtXJLT2NtDbYuKUnQE+j84YJdSDBTgghhLiuLefK25WoVqt8/+gE1WqZbL7AH3z3PJnFKtMBDiM0eUzs7Auya2UjubJGb9C1eN9gmZBgJ4QQQlyHFppbd7nHlpPa9T3VH+Knz00SSuYJxUtkFnGxrtsIW7s8fHBHN71BF9Pp0nW54vVySLsTIYQQ4jq0UOuTSx1rdJg40B9Zlq1NhqM5/DYD33p6hOdGkwzEFi/Uec3gtcC+jc381u4+HDYLvUEXe1Y2Xnf96S6XVOyEEEKI69BCc+sudexAf4Qt7Z76AoulquJpmsb
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure()\n",
|
||
|
"plt.scatter(data[\"zcmb\"], data[\"zcosmo\"], s=0.01)\n",
|
||
|
"\n",
|
||
|
"plt.xlabel(r\"$z_{\\rm CMB}$\")\n",
|
||
|
"plt.ylabel(r\"$z_{\\rm cosmo}$\")\n",
|
||
|
"plt.xlim(0)\n",
|
||
|
"plt.ylim(0)\n",
|
||
|
"\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.savefig(\"../../plots/UPGLADE_zcmb_vs_zcosmo.png\")\n",
|
||
|
"\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 60,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHWCAYAAAD6oMSKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9aaxlWXYWin6rb3bfnC7OORHZREZmtU432LeQsbkXy4XxQwIhJGMbG2xsIZkfCINECbAAIxnML5AsENIVBswPdH/Yz/jpAWUw5QeuKpfLzqyqrMyIyMiIOE2cZvfN6rv3Y84x99wr9jkRkU1VRtQeUigiztl7NXPNtea3vvGNbyhFURRYxzrWsY51rGMd61jHUx/qN/sA1rGOdaxjHetYxzrW8f7EGtitYx3rWMc61rGOdTwjsQZ261jHOtaxjnWsYx3PSKyB3TrWsY51rGMd61jHMxJrYLeOdaxjHetYxzrW8YzEGtitYx3rWMc61rGOdTwjsQZ261jHOtaxjnWsYx3PSKyB3TrWsY51rGMd61jHMxJrYLeOdaxjHetYxzrW8YzEGtitYx3rWMc61rGOdTwj8dQCu9/93d/Fn/2zfxZXrlyBoij4jd/4jaXfF0WBX/iFX8DOzg4cx8EP/MAP4Pbt20ufGQ6H+LEf+zHU63U0m0389E//NObz+dJnvvKVr+BP/Ik/Adu2sb+/j1/+5V/+oE9tHetYxzrWsY51rONdxVML7DzPw7d927fhV37lV1b+/pd/+ZfxL//lv8S//tf/Gl/84hdRqVTw6U9/GmE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oJ9hr2jgah2i7htDThUkG21DhmjqGfoK
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure()\n",
|
||
|
"plt.scatter(data[\"zcmb\"], (data[\"zcosmo\"] - data[\"zcmb\"]) * SPEED_OF_LIGHT, s=0.001)\n",
|
||
|
"\n",
|
||
|
"plt.xlabel(r\"$z_{\\rm CMB}$\")\n",
|
||
|
"plt.ylabel(r\"$c (z_{\\rm cosmo} - z_{\\rm CMB}) ~ [\\mathrm{km} / \\mathrm{s}]$\")\n",
|
||
|
"plt.xlim(0)\n",
|
||
|
"plt.ylim(-1000, 1000)\n",
|
||
|
"\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.savefig(\"../../plots/UPGLADE_zcmb_vs_dzcosmo.png\")\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"#### Save the data\n",
|
||
|
"- In a format matching what Gergely shared."
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 61,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"{'RA': array([0.78773861, 0.62294948, 0.02316041, ..., nan, nan,\n",
|
||
|
" nan]),\n",
|
||
|
" 'zhelio': array([0.02934783, 0.03313865, 0.03167664, ..., nan, nan,\n",
|
||
|
" nan]),\n",
|
||
|
" 'e_zhelio': array([9.929941e-06, 6.920645e-06, 7.919160e-06, ..., nan,\n",
|
||
|
" nan, nan]),\n",
|
||
|
" 'DEC': array([-0.75227238, -0.75948143, -1.21628749, ..., nan,\n",
|
||
|
" nan, nan]),\n",
|
||
|
" 'zcmb': array([0.02812447, 0.03191 , 0.0304483 , ..., nan, nan,\n",
|
||
|
" nan]),\n",
|
||
|
" 'e_zcmb': array([9.91813946e-06, 6.91241472e-06, 7.90973125e-06, ...,\n",
|
||
|
" nan, nan, nan]),\n",
|
||
|
" 'zcosmo': array([0.02811476, 0.03163086, 0.03017893, ..., 0. , 0. ,\n",
|
||
|
" 0. ]),\n",
|
||
|
" 'e_zcosmo': array([0.00078133, 0.0006812 , 0.00069302, ..., 0. , 0. ,\n",
|
||
|
" 0. ])}"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 61,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"data"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 62,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Writing to `/mnt/users/rstiskalek/csiborgtools/data/upglade_z_0p05_all_WZCOSMO.h5`.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"fname = \"/mnt/users/rstiskalek/csiborgtools/data/upglade_z_0p05_all_WZCOSMO.h5\"\n",
|
||
|
"print(f\"Writing to `{fname}`.\")\n",
|
||
|
"\n",
|
||
|
"with File(fname, \"w\") as f:\n",
|
||
|
" for key in data.keys():\n",
|
||
|
" f[key] = data[key]"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 63,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"40M\t/mnt/users/rstiskalek/csiborgtools/data/upglade_z_0p05_all_WZCOSMO.h5\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"name": "stderr",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"/usr/local/shared/python/3.11.7/lib/python3.11/pty.py:89: RuntimeWarning: os.fork() was called. os.fork() is incompatible with multithreaded code, and JAX is multithreaded, so this will likely lead to a deadlock.\n",
|
||
|
" pid, fd = os.forkpty()\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"!du -h /mnt/users/rstiskalek/csiborgtools/data/upglade_z_0p05_all_WZCOSMO.h5"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"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.4"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|