mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-23 03:28:03 +00:00
104 lines
50 KiB
Text
104 lines
50 KiB
Text
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"import numpy\n",
|
||
|
"import scienceplots\n",
|
||
|
"from h5py import File\n",
|
||
|
"\n",
|
||
|
"import plt_utils\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"%load_ext autoreload\n",
|
||
|
"%autoreload 2"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 12,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"with File(\"/mnt/extraspace/rstiskalek/csiborg_postprocessing/ACL/BORG2_0.25.hdf5\", 'r') as f:\n",
|
||
|
" voxel_acl = f['voxel_acl'][...].flatten()\n",
|
||
|
" voxel_dist = f['voxel_dist'][...].flatten()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 28,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnUAAAHWCAYAAAARl3+JAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAACNbUlEQVR4nOzdeVxU9foH8M+wzDCALILAgKgIqKEmpYGgRd4ovGJCdr1olksuZZgQLomJplmkZuJOWindNNBSKC26hqZ2RUwQf+4buDMsyiIIA8L5/UFMjswAg8Pq5/16zQvne55zzjNnLB/O+S4iQRAEEBEREVGbptfSCRARERHRo2NRR0RERNQOsKgjIiIiagdY1BERERG1Ayzq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vsM7z//vuYO3cuVq9erTxWhw4dUFlZCV9f30bl6+zsjJkzZ2LmzJm4ePEi3N3dsWLFCnz77beNOh5Ra8Y7dUSPidLSUuzcuRPDhw/Hv/71r1qv6dOn4+7du/jxxx8BVPc9k8lkmDlzJi5cuFDreDk5OViyZMkj5zVs2DAcPXpU+bgSAEpKSrBx40Z069YNbm5uj3wObfzzn/8EAGVhUaOuJckeFhQUhFu3buHLL7/EiRMn6n30ClRfhyNHjuDo0aPKttzcXLXTzTg7O+PgwYMqbRs3bqx1p05fX7/WHcgdO3bg5s2bDf4sD3viiSfQt29fxMXFIS4uDjKZDM8995zKOV966SUkJCSoTB2SnZ2Nbdu2YfDgwTA
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"bins = numpy.linspace(0, 100, 10)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"\n",
|
||
|
"mask = voxel_dist < 20\n",
|
||
|
"plt.hist(voxel_acl[mask], bins=\"auto\", histtype='step', density=1, label=r\"$0 < R / (\\mathrm{Mpc} / h) < 20$\")\n",
|
||
|
"\n",
|
||
|
"mask = (voxel_dist > 20) & (voxel_dist < 40)\n",
|
||
|
"plt.hist(voxel_acl[mask], bins=\"auto\", histtype='step', density=1, label=r\"$20 < R / (\\mathrm{Mpc} / h) < 40$\")\n",
|
||
|
"\n",
|
||
|
"mask = (voxel_dist > 40) & (voxel_dist < 60)\n",
|
||
|
"plt.hist(voxel_acl[mask], bins=\"auto\", histtype='step', density=1, label=r\"$40 < R / (\\mathrm{Mpc} / h) < 60$\")\n",
|
||
|
"\n",
|
||
|
"# plt.scatter(voxel_dist.flatten(), voxel_acl.flatten(), s=0.1)\n",
|
||
|
"plt.legend()\n",
|
||
|
"plt.title(\"ACL of individual voxels\")\n",
|
||
|
"plt.xlabel(r\"$\\mathrm{ACL}$\")\n",
|
||
|
"plt.ylabel(r\"Normalized bin counts\")\n",
|
||
|
"\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.savefig(\"../plots/BORG_Stephen_ACL.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.4"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|