Lugovtsov/5.4.2-beta-spectrum/plots.ipynb

288 lines
308 KiB
Plaintext
Raw Normal View History

2023-10-28 01:10:36 +03:00
{
"cells": [
{
"cell_type": "code",
2023-12-16 19:39:42 +03:00
"execution_count": 3,
2023-10-28 01:10:36 +03:00
"id": "e790f4e5-04de-47f5-9620-dcb717e467e7",
"metadata": {},
"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",
"def line(x, k, b):\n",
" return k*x + b"
]
},
{
"cell_type": "code",
2023-12-16 19:39:42 +03:00
"execution_count": 4,
2023-10-28 01:10:36 +03:00
"id": "3a850101-4426-439a-b7d8-2d621361bb90",
"metadata": {},
"outputs": [],
"source": [
"dataframes = []\n",
"for i in range(1, 4):\n",
" dataframes.append(pd.read_csv(f\"data_setup_{i}.csv\", sep=\"\\t\"))\n",
"x_name, y_name = dataframes[0].columns\n",
"\n",
"background = pd.read_csv(\"background_radiation.csv\", sep=\"\\t\")"
]
},
{
"cell_type": "code",
2023-12-16 19:39:42 +03:00
"execution_count": 5,
2023-10-28 01:10:36 +03:00
"id": "91439fc9-0550-451f-b2e3-b32ffa0da18f",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAwYAAAIYCAYAAADXbfuLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAABcSAAAXEgFnn9JSAADPcUlEQVR4nOzdeXzT9f3A8VeSp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SaE8Dt+mxi44qxS5FxrAE2PIjSlLQuQrVZrow+brZnmL0IIIYQ/KVgHr6XA8S+Vz0/kKZ8XrGv5vZHxymPNSe/FJ4TwKpvN1uS1rCsBlxjk5uaSm5vLvHnz3OpNUFZW1up9DQYD4eHhF3xkZma2+ZxCCCGET5kLYWt649KjDpvyeksjB5GdlUdJDIQIWJmZmY2uYw0Gg8v3BFRiYDabmTp1KmlpaY16GHhjGpHFYqGuru6Cj4ULF3r8PEIIIYRHFaxpuh8BKK8XrHX9/oYRg1OejUsI4TMLFy5sdB1rsbiuTubXDc4ulp6ezvjx4y9oeOYUFxfXqtGAuLi4Vp9Pr9ej1+vbFKMQQgihuqqS9m2XEQMhAp5Op0On07W843kCZsQgIyMDoMmkAJQRA1frB5zbZIGyEEKIoBeT2L7tMmIgREgKiMRg5cqVFBcXN0oKiouLG547y5o2lxwUFxe7tSZBCCGECDgpsxp3MHbS6CBlpuv3O0cMqmXEQIhQ4veJQW5uLjk5OU2OFJy/zmDOnDnAhcmCkzNZmD59uneCFEIIIfyJMRnGrGqcHGh0cMPqlpuWdbsCbv8UbvyX92IUQvgdv15j4BwlaG760PlSU1MxmUysX7++0cjAhg0bMBqNzJ4921uhCiGEEP4lZQZEdYH9b0JdJXT
"text/plain": [
"<Figure size 900x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for df, bg in zip(dataframes, background.iterrows()):\n",
" level, dev = bg[1]\n",
" I = df[x_name]\n",
" nu = df[y_name] - level\n",
" \n",
" plt.plot(I, nu, \".--\")\n",
"\n",
"plt.xlabel(\"Ток через линзу, А\")\n",
"plt.ylabel(y_name)\n",
" \n",
"plt.savefig(\"all_setups-NU_on_I.png\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-12-16 19:39:42 +03:00
"execution_count": 6,
2023-10-28 01:10:36 +03:00
"id": "7234fe24-4b9b-4553-bf81-8c1505ce3ae4",
"metadata": {},
"outputs": [],
"source": [
"c = 3e10\n",
"m_e = 9.11e-28\n",
"T_k = 0.624e6 # энергия электронов внутрненней конверсии, эВ\n",
"def p2T(p):\n",
" return (p**2 * c**2 + m_e**2 * c**4)**.5 - m_e * c**2\n",
"def T2p(T):\n",
" return ((T + m_e*c**2)**2 - m_e**2*c**4)**.5/c\n",
" \n",
"p_k = T2p(T_k)"
]
},
{
"cell_type": "code",
2023-12-16 19:39:42 +03:00
"execution_count": 7,
2023-10-28 01:10:36 +03:00
"id": "9ddd6b63-d441-4ba3-b000-a5f268cc5157",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAwYAAAIbCAYAAABR+YklAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAABcSAAAXEgFnn9JSAAEAAElEQVR4nOzde3xT9f0/8FcSUqAFetoiKHihKag4L5AWL5vbV22i7r5p2rp95zZlTXT7ut/cNKHzy8CxraTi3Hf7upEUdHdtE92+u6kkoLt5axvxigIJRQVFaHIKpC1Jk/P743BC05wkJyf39v18PPJomnPyOZ+cJO3nfT6Xt4LjOA6EEEIIIYSQaU1Z7AoQQgghhBBCio8CA0IIIYQQQggFBoQQQgghhBAKDAghhBBCCCGgwIAQQgghhBACYEaxK1CKotEoxsbGMGPGDCgUimJXhxBCCCGEkKxxHIfx8XHMmjULSmVi/wAFBiLGxsZQVVVV7GoQQgghhBCSc8FgEJWVlQmPU2AgYsYM/rQEg0Go1WrRfcLhMKqqqlLuI0e+ys1n2VTnwpRNdS5M2VTnwpRNdS7/sku+ziNB4CM1/P1/B4DKqtKvcwHLzWfZVOfClC2nXOE5Qlt3MgoMRAjDh9RqddoTLWUfOfJVbj7LpjoXpmyqc2HKpjoXpmyqc/mXXbJ1VqsBxYT7E8op2ToXodx8lk11LkzZcspNNlSeJh/LpFQqsW7dOtHxWaUqX3XO57koxzrnC53nwpWdL3Se819uPpXjec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bXVP90a2trwbIsPB5PwhVVt9ud0MiQMua5v78/lpHX5XLB5/NhYGCgZNfZF672Sglc/H4/7HZ7Qa8QS5l
"text/plain": [
"<Figure size 900x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for df, bg in zip(dataframes, background.iterrows()):\n",
" level, dev = bg[1]\n",
" I = df[x_name]\n",
" nu = df[y_name] - level\n",
" \n",
" idxmax = nu[16:].idxmax()\n",
" k = p_k / I[idxmax]\n",
" \n",
" plt.errorbar(I*k, nu, xerr=0, yerr=dev, fmt=\".--\", label=fr\"$k=$ {k:.2e} МэВ/($c\\cdot$A)\")\n",
" # plt.plot(I*k, nu, \".--\", label=fr\"$k={k:.2f}$ МэВ/А\")\n",
" # plt.plot(I[idxmax]*k, nu[idxmax], \"x\")\n",
"\n",
"plt.axvline(p_k, c=\"C3\", label=fr\"Конв. пик, $T_k=$ {T_k:.2e} эВ\")\n",
" \n",
"plt.xlabel(r\"Импульс электронов, эВ/$c$\")\n",
"plt.ylabel(y_name)\n",
"\n",
"plt.legend()\n",
"plt.savefig(\"all_setups-NU_on_p.png\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-12-16 19:39:42 +03:00
"execution_count": 91,
"id": "75e470a3-131e-443a-81d5-03eb08380853",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"def N(E, K, m_nu):\n",
" return -K*(E - .6e6) * np.sqrt(1 - (m_nu**2 * c**4)/(2*(E - .6e6)**2))"
]
},
{
"cell_type": "code",
"execution_count": 93,
2023-10-28 01:10:36 +03:00
"id": "31811c4a-9169-4109-98cb-a5de7d85656f",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAwYAAAIYCAYAAADXbfuLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAABcSAAAXEgFnn9JSAADcckl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6XseWl5eTmJhIampqjyUs7uM8je3rfN6emz9/PoWFhZSVlQWsctJAYzzzmMrKSp93Z93Hd6+yYrFYKC4uZu/evUFd0uXP/gJQ7mYvW7YMQHUd/hUrVnSNoUZpaanfG1191bovKysjJyeHnJycAc2EVFZWUl1dTVFRUa8ZGYvF0jV71JdNmzaxevVq6urqeny+oKCA0tJSiouL/Z51CCT372NjY2PX72BhYWGvr8ldxcg9a9CfpTtlZWW9fgYFBQVUVFSQlZVFU1OT19du2LCh19/V1q1bycjIYM6cObKEKFTcMwZNwH+Bp6th3AXhjEiIsFq6dCn33nsvdrsdo9Ho9ThJDHzQ6/Xo9frADBYXD++eCMxYkSIuPmhDV1VVdVUXAWXZxIoVK7r2GfhSWFhIRkaG182Lubm5FBcXB7VqibtqSqSWJbRarVRUVJCdne13hRR3s6hQLIPwZ38BKFVeNmzY4LVEpD98LckJNPeyFE9fl3vDcHFxseokx2q1kpeX17Vk7Ez9WUKUn5+P2Wz2+HeUnZ3dVWY21BobG4GeCau3i213YtSfr9tXIr9kyRI2bdrEihUrvP7O+FoSlpeXx7Jly1izZo2UWg4mx0loO6Q8bgLagYRzQSM3+cTQpdPp/FoWL4l
"text/plain": [
"<Figure size 900x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for df, bg in zip(dataframes, background.iterrows()):\n",
" level, dev = bg[1]\n",
" I = df[x_name]\n",
" nu = df[y_name] - level\n",
" \n",
" idxmax = nu[16:].idxmax()\n",
" k = p_k / I[idxmax]\n",
" p = I*k\n",
2023-12-16 19:39:42 +03:00
" T = p2T(p)\n",
" plt.errorbar(T*1e-6, nu, xerr=0, yerr=dev, fmt=\".--\")\n",
" \n",
" # idxs = (T>.73e6)\n",
" # if (sum(idxs) > 2):\n",
" # (K, m_nu), _ = curve_fit(N, T[idxs], nu[idxs], p0=(1e-3, 1e-3))\n",
" # print(f'{m_nu} {K}')\n",
" # plt.plot(T[idxs], N(T[idxs], K, m_nu), lw=.3)\n",
" # plt.plot(T[idxs], nu[idxs])\n",
2023-10-28 01:10:36 +03:00
"\n",
"plt.axvline(T_k*1e-6, c=\"C3\", label=fr\"Конв. пик, $T_k=$ {T_k:.2e} эВ\")\n",
" \n",
"plt.xlabel(r\"Энергия электронов, МэВ\")\n",
"plt.ylabel(y_name)\n",
"\n",
"plt.legend()\n",
"plt.savefig(\"all_setups-NU_on_T.png\")\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"id": "89ad0f0e-ba9e-42d7-b5a5-c60f8ec9f6e8",
"metadata": {},
"source": [
"### График Ферми"
]
},
{
"cell_type": "code",
2023-12-16 19:39:42 +03:00
"execution_count": 18,
2023-10-28 01:10:36 +03:00
"id": "16c9ae84-657a-4395-a3c3-036d0f46ba4a",
"metadata": {},
"outputs": [
2023-12-16 19:39:42 +03:00
{
"name": "stdout",
"output_type": "stream",
"text": [
"1.0\n",
"1.0\n",
"1.0\n"
]
},
2023-10-28 01:10:36 +03:00
{
"data": {
2023-12-16 19:39:42 +03:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAw0AAAIwCAYAAADEcocnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAABcSAAAXEgFnn9JSAADR0ElEQVR4nOzde3xT5f3A8U+StkDDJS13yjWlIHiDtigIKkirzgnT2YpucxOwjc79tonagBPBdYrpvOymW8rN6TaF1jnBC9qgoChq24CKIIWGa7kItClQaJsm5/dHTGzpvU170vb7fr360pNz8pxvDqGc73me7/NoFEVREEIIIYQQQoh6aNUOQAghhBBCCBHcJGkQQgghhBBCNEiSBiGEEEIIIUSDJGkQQgghhBBCNEiSBiGEEEIIIUSDJGkQQgghhBBCNChE7QBE28jOziY3N5e+ffty6tQpJk2aRFJSktphCSGEEEKIDkiShk4oMzMTo9GIxWLxv2YymTAYDCQkJKgYmRBCCCGE6IhkeFInlJWVRWRkZI3XE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g77FqLV879bWXlJSExWLBZrP5ezjUJEmDUI8uDK5YCsn5MGASVJ6GTamwbiaUFqodnRBCiA4sJyeH1NTUOvf5bkzrSw7i4+PbLK6OJjs7G6fT6b/Bri41NRWn08natWub3J7ZbCYyMrLWn01SUhKpqak1EolAn/tCCQkJGAwGMjMzGz12zZo17TZMqDrfObOzs9v93BeSpEGor++l8OOtcNUzENIDij6ANZfC9mfBIwvoCSGEaB6n0+l/KnyhhnoZfC7smejKcnJyAOoct28wGDAYDP5jGuN0OsnOzq4zCTAajbXqAwJ
2023-10-28 01:10:36 +03:00
"text/plain": [
"<Figure size 900x600 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for i, (df, bg) in enumerate(zip(dataframes, background.iterrows())):\n",
" level, dev = bg[1]\n",
" I = df[x_name]\n",
" nu = df[y_name] - level\n",
" \n",
" idxmax = nu[16:].idxmax()\n",
" k = p_k / I[idxmax]\n",
" p = I*k\n",
" T = p2T(p)*1e-6\n",
" \n",
2023-12-16 19:39:42 +03:00
" idxs = (T>2e-1) * (T<5.5e-1)\n",
"\n",
2023-10-28 01:10:36 +03:00
" (k, b), _ = curve_fit(line, T[idxs], (nu**0.5 / p**(3/2))[idxs])\n",
" \n",
" plt.plot(T[idxs], (nu**0.5 / p**(3/2))[idxs], \".\", c=f\"C{i}\")\n",
" plt.plot(T[idxs], line(T[idxs], k,b), c=f\"C{i}\", label=r\"$T_\\text{max}=$\" + f\" {-b/k:.2f} МэВ\")\n",
2023-12-16 19:39:42 +03:00
" T_max = -b/k\n",
2023-10-28 01:10:36 +03:00
"\n",
"plt.xlabel(\"Энергия электронов, МэВ\")\n",
"plt.ylabel(\"у.е.\")\n",
"\n",
"plt.legend()\n",
"plt.savefig(\"all_setups-fermi.png\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
2023-12-16 19:39:42 +03:00
"id": "04a55305-a8f9-4c4c-8268-e798855d8fcc",
2023-10-28 01:10:36 +03:00
"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
}