{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "90f04713-016c-4b01-b137-929d94051233",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 150636 characters]",
      "text/plain": [
       "<Figure size 2400x800 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from matplotlib import pyplot as plt\n",
    "import pandas as pd\n",
    "\n",
    "df = pd.read_csv('20250824-temperature-02.csv')\n",
    "df[\"Time\"] = df[\"Time [ms]\"] / 1000. / 60.\n",
    "\n",
    "fig, ax = plt.subplots(figsize=(24, 8))\n",
    "ax.set_ylim(25.4, df[\"Raw\"].max() + 0.01)\n",
    "ax.plot(df[\"Time\"], df[\"Raw\"])\n",
    "ax.plot(df[\"Time\"], df[\"Temperature\"])\n",
    "ax.set_ylabel(\"Temperature / °C\")\n",
    "ax.set_xlabel(\"Time / minutes\")\n",
    "ax.legend([\"Raw Temperature\", \"Temperature\"])\n",
    "ax.grid()\n",
    "\n",
    "def event(time_minutes, label, yoff=0):\n",
    "    y = ax.get_ylim()[1] - yoff\n",
    "    ax.annotate(label, xy=(time_minutes, y))\n",
    "    ax.axvline(x=time_minutes, color=\"red\")\n",
    "\n",
    "event(3330 / 60, \"Start install aluminum\")\n",
    "event(4440 / 60, \"Start remove aluminum\")\n",
    "event(5208 / 60, \"New tip\")\n",
    "event(5450 / 60, \"Aluminum back on STM\")\n",
    "event(5720 / 60, \"First tunneling\", 0.03)\n",
    "event(6860 / 60, \"Stable tunneling started\", 0.26)\n",
    "event(7100 / 60, \"Stable tunneling stopped\", 0.23)\n",
    "event(7200 / 60, \"Heated up the STM externally\")\n",
    "event(7669 / 60, \"Stable tunneling start 80pA\", 0.42)\n",
    "event(7780 / 60, \"Changed to 210pA\", 0.26)\n",
    "event(7990 / 60, \"Drifted out of range\", 0.38)\n",
    "event(8300 / 60, \"Heated again\")\n",
    "event(8327 / 60, \"STM spontaneously starts tunneling\", 0.52)\n",
    "event(8500 / 60, \"Very noisy but long term tunneling\", 0.2)\n",
    "event(8950 / 60, \"End tunneling\", 0.25)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "27c93d69-e38c-4ea9-b773-732695e19a47",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "67c43e91-b1c8-482f-869e-a3c805cc4d41",
   "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.13.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
