Lugovtsov/cosmic-rays/plots.ipynb

414 lines
203 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "cc0657aa-fe90-463e-95d4-ff62649064f8",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# %load /home/glebi/git/experiment-automation/processing_tools.py\n",
"import numpy as np\n",
"from scipy.optimize import curve_fit\n",
"import pandas as pd\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib\n",
"import scienceplots\n",
"\n",
"plt.style.use(['science', 'russian-font'])\n",
"\n",
"matplotlib.rcParams.update({\n",
" 'figure.figsize': [6, 4],\n",
" 'savefig.facecolor': 'white',\n",
" 'figure.dpi': 150.0,\n",
" 'font.size': 12.0,\n",
"})\n",
"\n",
"import os"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "461ecc72-8495-4e8a-9f5f-5f4c2d42ee3a",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"exposure_time = {\n",
" \"17.4\" : 15557,\n",
" \"35\" : 4393,\n",
" \"20\" : 3258,\n",
" \"45\" : 5386,\n",
" \"25\" : 2408,\n",
" \"40\" : 2191,\n",
"}\n",
"\n",
"colors = {\n",
" \"17.4\" : \"#f21821\",\n",
" \"20\" : \"#f8631f\",\n",
" \"25\" : \"#fa931a\",\n",
" \"35\" : \"#ffc309\",\n",
" \"40\" : \"#fff600\",\n",
" \"45\" : \"#cdde25\",\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "7b5e53a7-79b4-4e5c-acd7-3d7a43af8b7e",
"metadata": {},
"source": [
" Red\n",
"#f21821\n",
"Orange Red\n",
"#f8631f\n",
"Orange\n",
"#fa931a\n",
"Orange Yellow\n",
"#ffc309\n",
"Yellow\n",
"#fff600\n",
"Yellow Green\n",
"#cdde25\n",
"Green\n",
"#8bc83b\n",
"Blue Green\n",
"#04b99e\n",
"Blue\n",
"#01aef3\n",
"Blue Purple\n",
"#5954a8\n",
"Purple\n",
"#8f59a7\n",
"Purple Red\n",
"#bf168d "
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "cbcdff6c-9df7-40b9-a106-55ee10de5109",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"matplotlib.rcParams.update({\n",
" 'figure.figsize': [8, 4],\n",
"})"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "1d8dddf8-ea76-40e2-b937-ee283716aca8",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"def get_df_from_filename(filename, time_lims = [1.5, 15]):\n",
" with open(filename, \"r\") as file:\n",
" raw_lines = file.read()\n",
" raw_samples = raw_lines.split(\"#\")\n",
"\n",
" text_info = [\" \".join(i.split()) for i in raw_samples[1:6]]\n",
" resolution = float((text_info[4].split()[-1]).replace(\",\", \".\"))\n",
"\n",
" hist = np.array(raw_samples[6].split()[1:], dtype=int)\n",
" n = len(hist)\n",
" time = resolution * np.arange(1, n + 1)\n",
" \n",
" df = pd.DataFrame(data={\"time\" : time, \"counts\" : hist})\n",
" df = df[lambda x : (x[\"time\"] < time_lims[1]) * (x[\"time\"] > time_lims[0])]\n",
" \n",
" return df"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "18751df3-1eb2-480d-92e0-36622f294f46",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA+8AAAIYCAYAAAAcmt0wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAABcSAAAXEgFnn9JSAACetklEQVR4nOz9fXhjd33n/78kWc4oziSypzSFtDQjb1oY6O9LZKehzVJSxkouws0siTXOsCwkv2ak0F7pbG+wSGfnmpnL/WaQW8qabLdICRtYdiG2RUoK7PcH0jTt7oZv2bFVtjeB3Vw+Q9kCCWE8ykwcJdZY+v0x1ZHO0Z1lSZZsPx/XlQs+Oh+dz/vcSOO3zufGUSgUCgIAAAAAAD3L2e0AA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KbqGPWNiEaj5pPrajZr2bXieP09e/ZsSnvdQPIOAAAAAJusuFxbowndirO+G4ZRNeEuPvWutp/ia8vLy5bXvV6vDMNQMBg0n+onEom68RRft28fHx/X5OSkgsFgxRP4cDhs/viwEcX91Xuyb6/b6Ml7JBLR4ODgun+8qHXc3UDyDgAAAACbxDAMDQ8Pm93lR0ZGaj6dDofDGhwcNMuBQECBQECJREKGYWhkZMScIT0YDGpkZESGYSiRSGhkZETxeNxsw949/5FHHlEikTAT7GAwqEAgoMHBQXM/xXhHRkbMJPzw4cMKBAKWZLa4xFokEjHXWS/+//UuOVcUj8cVCAQ0PDxsGW9ePIZaSXQgEJDX6133TPn1ZDIZM4biedi7d68CgUDNHgabwVEoFApda71H5XI59ff3a3V1dcd
"text/plain": [
"<Figure size 1200x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"filenames = [i[2] for i in os.walk(\".\") if i[0] == \"./data\"][0]\n",
"filenames.sort(key = lambda x : float(x.split(\"_\")[0]))\n",
"\n",
"counts_data = {}\n",
"\n",
"for name in filenames:\n",
" filename = \"data/\" + name\n",
" angle = name.split(\"_\")[0]\n",
" df = get_df_from_filename(filename)\n",
" \n",
" time = df[\"time\"]\n",
" counts = df[\"counts\"] * 3600 / exposure_time[angle]\n",
" \n",
" plt.step(time, counts, where=\"mid\", lw=.4, label=f\"Angle {angle}\")\n",
" # plt.plot(df[\"time\"], df[\"counts\"], lw=.3, label=f\"Angle {angle}\")\n",
" \n",
" counts_data[angle] = counts\n",
"\n",
"# plt.xscale(\"log\")\n",
" \n",
"plt.xlabel(\"Transit time, ns\")\n",
"plt.ylabel(\"Counts\")\n",
"plt.legend()\n",
"\n",
"plt.savefig(\"all.png\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "326b4750-443b-4c84-8763-a2c5c9637853",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA7EAAAApCA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ucJyLVT584Sft89Ep8cqYXmWh5RdXxydegwudcOcdZeiUyN4l0Dmcmxnk7O3pukvYlY8NaZpXnmqUnbvBnsm0fX0kdlh6fsS796WOv5U9VR8ydPm37xNLHDy6Z8FuntGIxLqxclPZJf/vItO46qurIzwMfpD+tOdknr5ReD//K+Ms4Wvi07bLFskfKHFSO9xJbS+9B4JOLPrwW/+WGf8MvsQAAAAAAAAAAUgMWsQAAAAAAAAAAUgMWsQAAAAAAAAAAUgMWsQAAAAAAAAAAUoPzYqfbnn3OqUReaDQxpS+j2HmDHyR+4ldvsvIrzz+i6qzfx/UOf6gvvXHJ5J7QL+xdP8cPUCdTTSVTOMcvZWhVu7qJiIjy4oKjxnF98Yy8DErWISIqbPC2ZB8nX9d1imu6LcnIM7Os/NnL3S8VISKaeI9flLP8gL4U6dgrPN7nn+KXdFRm9cU08vKn1fv1/1OOvcYv95j7Eb/Q6pePv6XqnHmavzg7X9MH1lceGmJleRkUke7T1slBJeNib0j3qbjBL6dafJTH2ortwAV+MZa030K2s3lCjx0Zg+qbs0qm/r3jXK9Hnu2N8HhL+32IPz6vns388WFWnv79GSVT+x2XqX6hL4iRORGubLjtGec+n3tcX4xy5Nl3WDl7iF9oJXVYbS/97ISSGX+Xy/Rir0+dPXFxR/b195WM7JPMDyKdI1JPeI9xOYnAir+s5zMmffK1+Nk8K0s/ELlz5uqT+oKrqRcv37Te1ii/CEPaZmHllfSfjFtniV+sZslYeg/CPisXpYwVf2mfDz5tS1/4+Ermoo9eidUfVx0fviq
"text/plain": [
"<Figure size 1200x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.imshow(counts_data.values())\n",
"plt.axis('off')\n",
"\n",
"plt.savefig(\"heatmap.png\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "df0f9844-01b2-4173-9e9b-a663033cd7b1",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgA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3Txte++eq9B39zSUVUVXq9333D4J+VyOQAQDosPBALI5/PtCI+IiIiIiIiobfomeU8kEpiennbcxkrwqX26PZyEuoev/dHF1/7o4mt/dPG1P7r42h9dfO17X18Mm0+n05iYmKgu9RaNRm2HzUuSBK/Xi/X1ddvjhEIh5PN54bB6izVcwa7SoCzLcLlcrT0hIiIiIiIiOrLK5TIMw9j3mFVxvm+HzauqCk3TGl6jvRGFQqGh7TweD9xu976fubm5Q4uDiIiIiIiIjp65ubmaXNNaKk6k55eKSyQSSKVSDW172EPmRT3vRERERERERM2anZ3FlStX9j22d613Oz2dvGcyGcRisYa39/v9DfWq+/3+ho7XC2v8ERERERER0WBxuVwHno7ds93ImqZhaWnpQMPlvV4vNE1zPKa1HREREREREVG/6Nmed1VVkc/nEYlEatqsJeGstlgshsnJSUxMTCCfz0PTNNsEXVXVQ507T0RERERERNQJfVFt/klW1fgnQ8/n8wiFQlhZWalJ0jVNg8/nQyKRwMzMjOPxrWrzoip/RERERERERIepXh7as8PmmxEMBhEIBDA/P1/TtrCwAK/XW3eteCIiIiIiIqJe05fJu6qqAGA7v31xcRHpdLq6jbVdIpHAzZs3Od+diIiIiIiI+k7Pznl/kqZpiEajKBQK1aQ9FAohEAggkUhUh8kHg0GsrKwgHo8jEAhgbGwMS0tLSKVSnO9OREREREREfakv57y3mzXXwFrnXZblA5fxJyIiIiIiIqqnXC7DMIzqOu9HYs77YfN4PHC73Zibm+t2KERERERERDSA5ubm4Ha74fF4HLdjz7sN9rwTERERERFRJzTa8943c967QVGUgVoq7p31b2C9+IbjNj7PSzjt+3yHIiIiIiIiIjraXC5XQ53FHDZ/hKwX38COviZs39HX6ib3RERERERE1HnseT9ihpUzeOE5+wT91tsvdTgaIiIiIiLaK5PJIJvNIpVKdTsU6jHseSciIiIiIuoRN27cQDqd7nYYVaqqIhQKYXx8HD6fD7lcruPntpYKtzM+Po58Pt+2GDRNQygUatvxD4LJOxERERERUQ/QNK2aiGYymS5HUxEIBLCysoLJyUnHJ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k6n6w4Dt0ueRQm/NUR/eXl533D9+/fvA6j02DdC07RqT7XdcmqFQqE6/70TUqmUsPp8Pel0umb0Q6/hsHkiIiIiIqIuSaVSWFlZQTabrfmxhqLPz8/XPc5B5pWHw2EEg8GaXuZMJoOZmZmGj6WqKgDA7/dXe9/3/iQSCayurjYcV6vS6XRTQ941TXNcdq5XsOediIiIiIioS1RVFSace4fOO23XjImJCXi9XkSjUfj9fhQKBcTj8QOti743ye/0PPEnWVMB/H7/gfdVVRX5fN529IM1osBqi8Vi1dUAOo3JOxERERERURfkcjnH4fIAqkXkrF7xw+L1eh3XSW+E1cNu9cDbcZqvf5isJLuZcwWDQeE8+VAohHw+3/Q8+sPEYfNERERERERdkEgk6vbiRqNRAPWrzh+Epmm2c9SbkUgkqj3XdjpVbd6arz82NtaR83UDk3ciIiIiIqIOs5Zrq1fQzar6rqqqbcJt9XrbHcd6rFAo7Hvc6/VCVVVEo9Fqr34mk3GMx3r8yfbJyUnMzMwgGo3W9MDHYrHqzYdmWMdz6tl/ctt6Pe/xeBw+n6/hmxei590NTN4d6LoOXddRLpe7HQoREREREQ0AVVUxPj5eHS4fCoWEvdOxWAw+n6/670gkgkgkgkwmA1VVEQqFqhXSo9EoQqEQVFVFJpNBKBRCOp2unuPJ4fmvvvoqMplMNcGORqOIRCLw+XzV41jxhkKhahJ
"text/plain": [
"<Figure size 1200x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for angle, counts in counts_data.items():\n",
" t = np.array(time)[:-1:2]\n",
" c = np.array(counts)\n",
" c2 = c[1::2] + c[:-1:2]\n",
" \n",
" plt.step(t, c2, where=\"mid\", lw=.8, label=f\"Angle {angle}\", color=colors[angle])\n",
"\n",
"# plt.xscale('log')\n",
" \n",
"plt.xlabel(\"Transit time, ns\")\n",
"plt.ylabel(\"Counts\")\n",
"plt.legend()\n",
"\n",
"plt.savefig(\"all_c2.png\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "4445bbab-bc55-4d46-8bc3-22d3cb0a61d7",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"23 18.046788\n",
"24 13.367991\n",
"25 12.031192\n",
"26 16.709989\n",
"27 14.036391\n",
" ... \n",
"229 1.336799\n",
"230 0.000000\n",
"231 0.668400\n",
"232 1.336799\n",
"233 0.000000\n",
"Name: counts, Length: 211, dtype: float64"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"counts_data[\"45\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "53a08ed6-d7b0-4a67-9a87-59877568f1aa",
"metadata": {},
"outputs": [],
"source": [
"import BayesPowerlaw as bp\n",
"\n",
"data_dir = os.path.dirname(os.path.abspath(__file__)) + '/examples/data'\n",
"data = np.loadtxt(data_dir + '/tweet_count.txt')\n",
"\n",
"fit=bp.bayes(data)\n",
"\n",
"plt.figure(figsize=(6, 4))\n",
"fit.plot_fit(np.mean(fit.gamma_posterior[0]), fit_color='black', scatter_size=100,\n",
" data_color='gray', edge_color='black', line_width=2)\n",
"plt.ylim(10**-5, 10**0)\n",
"plt.xlabel('likes')\n",
"plt.ylabel('frequency')\n",
"plt.title('Likes per Tweet')\n",
"plt.tight_layout()\n",
"plt.show()\n",
"\n",
"plt.figure(figsize=(6, 4))\n",
"fit.plot_posterior(fit.gamma_posterior[0], range=[1.6, 1.9], color='blue')\n",
"plt.xlabel('exponent')\n",
"plt.ylabel('posterior')\n",
"plt.title('Posterior for Likes per Tweet')\n",
"plt.tight_layout()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "4f6b60b1-1b01-4a81-890b-22a4f6bc83b4",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Running /home/glebi/miniconda3/lib/python3.10/site-packages/BayesPowerlaw/src/../examples/scripts/tweets.py:\n",
"-------------------------------------------------------------\n",
"import BayesPowerlaw as bp\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import os\n",
"\n",
"data_dir = os.path.dirname(os.path.abspath(__file__)) + '/examples/data'\n",
"data = np.loadtxt(data_dir + '/tweet_count.txt')\n",
"\n",
"fit=bp.bayes(data)\n",
"\n",
"plt.figure(figsize=(6, 4))\n",
"fit.plot_fit(np.mean(fit.gamma_posterior[0]), fit_color='black', scatter_size=100,\n",
" data_color='gray', edge_color='black', line_width=2)\n",
"plt.ylim(10**-5, 10**0)\n",
"plt.xlabel('likes', fontsize=16)\n",
"plt.ylabel('frequency', fontsize=16)\n",
"plt.title('Likes per Tweet', fontsize=18)\n",
"plt.tight_layout()\n",
"plt.show()\n",
"\n",
"plt.figure(figsize=(6, 4))\n",
"fit.plot_posterior(fit.gamma_posterior[0], range=[1.6, 1.9], color='blue')\n",
"plt.xlabel('exponent', fontsize=16)\n",
"plt.ylabel('posterior', fontsize=16)\n",
"plt.title('Posterior for Likes per Tweet', fontsize=18)\n",
"plt.tight_layout()\n",
"plt.show()\n",
"\n",
"-------------------------------------------------------------\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk4AAAGGCAYAAACNCg6xAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAACY10lEQVR4nOzdd3wVVfr48c/c9AaphFACaaSBoDQLoKISQQKIhAAuoujuz924Ftjirlt0m7vrLgQ36K5fZQUXJYYeRIMFBEGQIgjkJiQkIZRQ0khv987vj+zM3ptGQkIaz/v1ui+4M2fOOTM35WTmnOdRVFVVEUIIIYQQ12To6g4IIYQQQvQUMnASQgghhGglGTgJIYQQQrSSDJyEEEIIIVpJBk5CCCGEEK0kAychhBBCiFaSgZMQQgghRCvJwEkIIYQQopVk4CSEEEII0UoycBLiJvD444+jKAqPP/54o3333HMPiqLw8ssvd3q/hBCip5GBkxA9yMsvv4yiKCiK0tVdER1M+1yv5/Xuu+92dfc7xMsvv8zLL79MTk5OV3dFiGbZdnUHhBA3np+fH6Ghofj5+XV1V0QzfH19m9xeVlZGeXl5i2WcnJxuWL860yuvvALU3wUdOnRo13ZGiGbIwEmIm8Crr77Kq6++2tXdEC24ePFik9tffvllfUDRXBkhROeRR3VCCCGEEK0kAychbgItTQ6/ltWrV2NnZ4eiKPzyl79stH/Xrl3Mnz8ff39/HB0d6du3L+PGjeOvf/2r/oipKSkpKcyePZtBgwZhb29Pnz59CAwMZMqUKfztb3+jsLCwTf3U5n/dc889AHz44YfcfffdeHp64uLiwujRo0lISMBkMrVYz9WrV/njH//I+PHj8fDwwMHBgcGDBzN//nz279/f5DE5OTn6fKOcnBxOnz7ND37wAwICAnBwcLghj52eeeYZFEVhzpw5jfbV1tbi6uqKoij4+PigqmqjMlFRUSiKwm9+85sm6//2229ZvHgxQUFBODs74+rqysiRI/nVr35Ffn5+i32rqqri9ddf5+6778bb2xt7e3v69+/PrFmz+OSTTxqV174+Nffee6/VHC55bCe6FVUI0WP89re/VQG1rd+6ixYtUgF10aJFjfbdfffdKqD+9re/bbTvz3/+swqoBoNB/cc//mG1r7a2Vn3qqaf0/gCqq6uramNjo78PDQ1Vc3JyGtX7yiuvWB3n7Oysurq6Wm3buXNnm85RuzZ33323+rOf/UwFVEVRVA8PD9VgMOj1RkVFqVVVVU3WsX//ftXX11cva2Njo7q5uenvFUVR//SnPzU6Ljs7Wy+zdu1a/VycnZ1VFxcXdciQIW06l6bOq+FnvmHDBhVQvby8VLPZbLXvq6++srqWx44ds9pfU1Ojuri4qID6xRdfNGrzN7/5jaooitXnY29vr7/38/NTjxw50mR/T506pYaEhFhds759+1r154c//KHVMc8++6zVdffw8FB9fX3115gxY67n0glxQ8jASYgepLMGTmazWX322WdVQHVwcFA//PDDRsc999xzKqD6+vqqb7zxhlpQUKCqav0v5Z07d6q33nqrCqi33XabajKZ9ONycnL0gcySJUvU8+fP6/uKi4vVPXv2qD/60Y/U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/ZRVVVFVFQUffv2Zfz48ezZs4fDhw8zbtw4qqqq+Prrr4HGAyftcz1x4kSLn2tlZSVg/bmmpqbqE/off/xxDIbm/y63/LoYP378dZy5EF1HBk5CCADeeustABwdHfnss88YPHhws2UvXLgA1P8C1H4JtqSiokL/v7u7Ox988AELFizg5MmT/PjHPwagb9++TJo0iblz5xIbG4udnd11ncfAgQNbtf/y5cv6Nu18gGbvJDVkeU6W+vXr16rjO8KkSZOwsbGhtLSUQ4cOcfvtt+t3k7QB4OTJk9mzZw9ffPEF48aNY9++fVRXV+Ps7Nxo0KJdh8rKSn1w1BLLa2B5Da9cudKq/jd3DYXozuRRnRACgOnTp9O3b1+qqqp44oknWvylpj32+fOf/4xaP1eyxdeuXbusjr///vvJzs5mzZo1LFq0iJCQEK5evUpycjILFy7k1ltv5fz589d1Htdz10o7Hycnp1adj6qqTT7CBLCxsbmufl+PPn36cNtttwH/e1yn/Ws5cGpq/1133YW9vb1Vfdp1ePrpp1t1DSxTo1g+Crx48WKrjr+e8BhCdDUZOAkhABg9ejSfffYZHh4efP755zz00EPNzkHSHuMcP378uttzcXFh4cKFvPvuu5w6dYpz587xl7/8BUdHR6s7UW117ty5FvdrAzLLO0Pa+VRWVpKZmXld7XYVy4FReXk533zzDe7u7vqA6vbbb8fJyYm9e/dSU1OjD5waPqaD9n2ulo/22vN1IUR3JwMnIYRuzJgxfP7553h6erJr1y6mTp3a5KM4bR7PRx991KpHda0xcOBAfvazn7F06VIAPv300+uq5+zZs5w+fbrJfaWlpfqE5DFjxujb77zzTv1O1bp1666r3a6iDYD27dvH559/Tm1tLXfffbc+x8je3p677rqLiooKPvvsMw4ePGh1nCXtc92/f7/V/KXWGD58OH369AGu/xpqn4HaRMBOIboLGTgJIazceuutfPHFF3h7e7Nnzx4efPBBSktLrcp8//vfR1EUiouL+elPf9pifbW1tVaDq+rq6hbLawlr2/PI6/e//32T2//+979TWVmJra0ts2fP1rf369ePmTNnAvDaa69x6tSpFutva1TzG2nixInY2dlRWVnJn/70J6DxBHdtkPS73/2Ouro6XF1drQaOmoULF+Lk5ITJZCIuLq7FKOtms5ni4mL9va2tLYsXLwbqo81rE82b09Q11AZelvUK0d3IwEmIHio/P7/FV3t++YwcOZKdO3fSr18/9u7dy5QpUygpKdH3jxo1iueffx6Af/7zn8TExHD06FH9ToHJZOLYsWP8/ve/JygoiKN
"text/plain": [
"<Figure size 600x400 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAGGCAYAAABmPbWyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABK50lEQVR4nO3deVhUZf8/8PdhG3ZE0RkRVDRUXFMx3AozwUxz+5qae6aPii1oqZlZaAWKPabJk2W50GKWmaZpJaZiiguuKW5pgLggbqzioHD//vA3J4YZ8MAMM4jv13XNdck59zn3Z+45DG/PnLmPJIQQICIiIqIy2Vi7ACIiIqKHAUMTERERkQIMTUREREQKMDQRERERKcDQRERERKQAQxMRERGRAgxNRERERAowNBEREREpwNBEREREpABDE1EVsGrVKkiShIYNG1q7lDLdvn0bs2fPRkBAAJycnCBJEiRJwtGjR61dmsl27twpP5+SHpbXh4gqF0MTmVVERIT8h6f4w9HRET4+Pujbty9++OEHWPvuPZmZmYiIiEBERAQyMzOtWsvDZMiQIfjggw9w+vRpSJIEtVoNtVoNe3t7a5cmS0lJkY+7VatWWbscMqMxY8YYfX9R8ujWrZu1yzeLDRs2ICIiAhs2bLB2KY8kO2sXQNWXWq2W/52VlYVLly7h0qVL2LRpE1atWoX169dDpVJZpbbMzEzMmTMHwP034ho1alilDh0PDw80bdoU9erVs2odZTl9+jR++eUXAMCaNWswZMgQK1dkXs7OzmjatKm1y6AyeHh46L2v6BQWFuL69esAAHd3dzg5ORm0qVmzZqXXZwkbN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QOjY1bRsdmxY4fc5scffxT29vYCgHB3dxeOjo4iODi41NdJZ8GCBUKtVgt3d3cBQNjY2OiN12uvvSa3zczMFN26ddN7LWrUqKH3Wrz55ptG+wkODhYAxIwZM0Tnzp0FAGFnZye/tjt27HhgrUIIkZycLPe1cuVKRdsIoT9WJZX1+hw9elTUrVtXABDPPPOMyM7O1lu/adMm4erqKu/b3t5euLi4yD87ODiI2NhYo/stz3GtRPGxWbNmjXBzcxMAhKurq3BycpLX1axZUxw6dMjoPnJyckSfPn30jn93d3e9ujp16iRu3rxpsK25XuOynlfx17ywsFD+Xfv5558Ntnvsscfk7aZMmWKwfty4cQKAGDVqlMG6ffv2CbVarff66MYTgJAkSURGRhqt9+7du/K+dQ9XV1dha2sr/9y0aVORkpIib7Nnzx6hVquFo6OjACAcHR31fg/VarXe+ylVDoYmMisloWnatGlym1OnTgkhhDh06JD8B71Lly7i2LFjQoj7b3obN26U/yg1btxY5OTk6O3vmWeeEQBEu3btxN69e0VRUZEQQgitVivOnj0rPvroIxEdHa23TfE3WV1wMUar1YoOHTrI+9+8ebPIy8sTQgiRm5srYmNjRZ06dQQAER4ebrC9LjS5uroKjUYjfvrpJ1FQUCCEECItLU3eV1l/lE0Zm+JBwNXVVTz33HPymAshxNmzZ0t97iU9KNgJIcT//d//yUHgk08+kZ/flStXxNixY+Vali5darCt7g+qq6urcHV1FStXrhS3b98WQghx/fp1cePGDUV1WjI0bd++XQ6TQ4cONQjO+/fvFw4ODgKAmDBhgjh16pS4d++eEEKI1NRUERYWJgeHxMREvW0rclw/SPGx8fDwEK1btxb79+8XQghRVFQkfv/9d1G/fn0BQNSvX98gAAohRP/+/QUA8dhjj4nVq1fLbfLz88XPP/8sGjVqJACI/v37G2xrrte4rOdV8jXv27evACBef/11veVpaWly4AMg2rRpY7Dfxo0bG91ncnKyHMYGDRokDh06JO7evSuEEOLq1ati9uzZws7OTgAQ69evN9jv66+/LgAItVotPv30U/l5FxQUiB07doi2bdvKr31hYaHetqNHj65QYCbzYGgis3pQaMrKyhLe3t7y/2Z1bwjPPvus/Eas+0Nb3OHDh+U3oQULFuit0/0POSEhQXGdSkNTTEyMACBatGhh9A+IEEIcPHhQSJIkHBwcxNWrV/XW6UKTra2tOHz4cKn9lBVITBmb4kHgiSeekP9gV8SDQtP+/fvlvj7//HOjbXShysvLS+Tn5+ut0/1BBSA2btxY4TotFZq+//57ORCFh4fLoaY4XeCePXt2qf2+9tprAoDo16+f3vKKHNcPUnxsatWqZXC8CiHEyZMn5edVMpT98ssvAoDQaDTi4sWLRvtIS0uTz6QdOXJEb525XuOynlfJ13zRokUCgGjVqpXe8tjYWAFAvPzyy6JevXpCkiRx/fp1ef2FCxfkfRY/4yOEEIMGDRIAxMiRI0utaeHChUbD2PHjx4UkScLZ2Vn89ddfRrfNzs4WPj4+RkMXQ5N18ZomsojMzEz88ccf6N69Oy5fvgwAeP3112FjY4PMzEz8/vvvAIBp06bB2dnZYPu2bdti4MCBAO5fZ1CcbrqAK1eumL3uL7/8EgAQFhYGNzc3o23at2+PFi1aoKCgADt27DDa5tlnn0Xbtm3L3b+pY1PctGnTYGtrW+4alFqzZg0AwMfHB+PGjTPa5v333wcAXL9+HXFxcUbbtGjRAs8//3zlFGkmn3zyCYYOHYq7d+9i3rx5+Pjjjw2uhTp27BgSExNhb2+PN954o9R9jRo1CgCwbds2FBYWyssr87gGgIkTJ6JOnToGywMCAjBo0CAA/76mOrrfh5EjR5Y6PYaPjw+efvppAJCP3ZIs+Rrrajlx4gSuXbsmL9f9rnbv3h1PP/00hBB6v7/bt28HcP+axwYNGsjLb968KX8T76233iq1X93reuzYMb1r3JYvXw4hBHr37o1WrVoZ3dbNzU2eTqC0MSTr4DxNVGnKuqB2xIgRmDVrFgDg8OHD8oXUPXr0KHWbkJAQ/PDDD/jrr79w9+5deULFPn3
"text/plain": [
"<Figure size 600x400 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import BayesPowerlaw as bp\n",
"bp.demo()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c1875341-f433-4ebb-aeb6-3700887d865f",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}