{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "877ecd7c",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "c7b1f50c",
   "metadata": {},
   "outputs": [],
   "source": [
    "delim = ';'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c906f335",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 514272 characters]\n",
      "text/plain": [
       "<Figure size 1080x5616 with 130 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from math import isqrt\n",
    "\n",
    "count = 5\n",
    "\n",
    "plt_in_row = 5\n",
    "\n",
    "fig, axs = plt.subplots(26, plt_in_row, figsize=(3*plt_in_row, 3*26), sharey=True)\n",
    "    \n",
    "for j,k in zip(range(1,27), range(65,91)):\n",
    "    num = j\n",
    "    letter = chr(k)\n",
    "    filename = f'{num}{letter}.csv'\n",
    "    for i in range(0, count):\n",
    "        path = f'/opt/iui-datarelease1-sose2021/{i}/split_letters_csv/{filename}'\n",
    "        try:\n",
    "            ex_letter = pd.read_csv(path, delim)\n",
    "        except:\n",
    "            continue\n",
    "        f = ex_letter['Force']\n",
    "        temp_axs = axs[j-1][i%plt_in_row]\n",
    "        temp_axs.title.set_text(f'{letter}')\n",
    "        temp_axs.plot(ex_letter['Time']-ex_letter['Time'][0], f)\n",
    "    \n",
    "plt.savefig('./single_first_five.png')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "89662e4f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from math import isqrt\n",
    "\n",
    "count = 100\n",
    "\n",
    "numxalph = np.array(np.meshgrid(range(65,91), range(0,4)))[0].flatten()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "28c993cc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 1573772 characters]\n",
      "text/plain": [
       "<Figure size 1440x4320 with 26 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, axs = plt.subplots(13,2,figsize=(20, 60), sharey=True)\n",
    "\n",
    "for j,k in zip(range(1,105),numxalph):\n",
    "    num = j\n",
    "    letter = chr(k)\n",
    "    filename = f'{num}{letter}.csv'\n",
    "    r = int((j-1)/2)%13\n",
    "    c = (j-1)%2\n",
    "    for i in range(0, count):\n",
    "        path = f'/opt/iui-datarelease1-sose2021/{i}/split_letters_csv/{filename}'\n",
    "        try:\n",
    "            ex_letter = pd.read_csv(path, delim)\n",
    "        except:\n",
    "            continue\n",
    "        f = ex_letter['Force']\n",
    "        idx = (f > 100) | (f == 0)\n",
    "        f=f[idx]\n",
    "        t=ex_letter['Time']-ex_letter['Time'][0]\n",
    "        t=t[idx]\n",
    "        axs[r][c].title.set_text(f'{letter}')\n",
    "        axs[r][c].plot(f)\n",
    "plt.savefig('./all_entries.png')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6bf9cbc7",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
