mirror of
https://github.com/galera951/experiment-automation.git
synced 2024-11-21 21:25:53 +03:00
121 lines
3.1 KiB
Plaintext
121 lines
3.1 KiB
Plaintext
|
{
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 2,
|
|||
|
"id": "280f1e1b-c050-4f4a-b45b-b4d488b55d99",
|
|||
|
"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 as mpl\n",
|
|||
|
"import scienceplots\n",
|
|||
|
"\n",
|
|||
|
"plt.style.use(['science', 'russian-font'])\n",
|
|||
|
"\n",
|
|||
|
"mpl.rcParams.update({\n",
|
|||
|
" 'figure.figsize': [6, 4],\n",
|
|||
|
" 'savefig.facecolor': 'white',\n",
|
|||
|
" 'figure.dpi': 150.0,\n",
|
|||
|
" 'font.size': 12.0,\n",
|
|||
|
"})"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "markdown",
|
|||
|
"id": "bb054603-67f5-4418-8c09-e8e3210ffb17",
|
|||
|
"metadata": {},
|
|||
|
"source": [
|
|||
|
"U_1 = 12V -- первые данные Lugovcov\n",
|
|||
|
"\n",
|
|||
|
"U = 25V -- остальные данные\n",
|
|||
|
"\n",
|
|||
|
"Формат:\n",
|
|||
|
"t[us], U[V], U[V]"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 15,
|
|||
|
"id": "01617d5c-6498-42db-bbe0-b24c0bf40ea8",
|
|||
|
"metadata": {
|
|||
|
"tags": []
|
|||
|
},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"from random import random, randint, choice\n",
|
|||
|
"def plot_data(filename):\n",
|
|||
|
" t, x, y = np.loadtxt(f\"data//{filename}\", skiprows=1, delimiter=\",\").T\n",
|
|||
|
" r = 1 / (2**.5)\n",
|
|||
|
" a = 150 # Э/А\n",
|
|||
|
" B = -x / r * a\n",
|
|||
|
" H = y / r * a\n",
|
|||
|
" with mpl.rc_context({\n",
|
|||
|
" 'figure.figsize': [7, randint(3,5)],\n",
|
|||
|
" 'font.size': randint(10, 16), \n",
|
|||
|
" 'axes.grid' : random() > .5,\n",
|
|||
|
" 'axes.facecolor': f\"'{1-random()*.07}'\",\n",
|
|||
|
" 'axes.grid.axis': choice(['both']),\n",
|
|||
|
" 'axes.grid.which': choice(['both', 'minor', 'major'])\n",
|
|||
|
" }):\n",
|
|||
|
" fig, ax = plt.subplots()\n",
|
|||
|
" ax.plot(B, H, lw=random()*.3, color=f\"C{randint(0, 7)}\", linestyle=choice(['-', '--', ':']))\n",
|
|||
|
" ax.set_xlabel(\"Величина поля B, Э\")\n",
|
|||
|
" ax.set_ylabel(\"Величина поля H, Э\")\n",
|
|||
|
" fig.savefig(f\"output//{filename.split('.')[0]}.png\")"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 16,
|
|||
|
"id": "2c5c0796-12f5-4433-a202-35ce633d9dfe",
|
|||
|
"metadata": {
|
|||
|
"tags": []
|
|||
|
},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"filenames = [\"Lugovcov.csv\", \"Kazikov.csv\", \"Smirnov.csv\", \"Zakharov.csv\"]\n",
|
|||
|
"\n",
|
|||
|
"for f in filenames:\n",
|
|||
|
" plot_data(f)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"id": "fa22ed90-4ccd-4957-b3a6-a9c983141716",
|
|||
|
"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
|
|||
|
}
|