{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib tk"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['frame__0', 'channels__0', 'tickinfo__0']"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d_q1d = np.load('data/2021-06-08/q1d/85-85.npz')\n",
    "d_2d = np.load('data/2021-06-08/2d/85-85.npz')\n",
    "d = d_q1d\n",
    "d.files"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.imshow(d['frame__0'], cmap=\"bwr\", interpolation=\"none\"\n",
    "           , origin='lower'\n",
    "           , aspect='auto'\n",
    "#            , aspect=0.8/4.7\n",
    "          )\n",
    "plt.colorbar()\n",
    "\n",
    "fontsize = 26\n",
    "ax = plt.gca()\n",
    "# ax.set_title('ProtoDUNE Data', fontsize=fontsize)\n",
    "plt.xticks(fontsize=fontsize)\n",
    "plt.yticks(fontsize=fontsize)\n",
    "ax.xaxis.set_major_locator(plt.MaxNLocator(5))\n",
    "plt.xlabel('wire number', fontsize=fontsize)\n",
    "plt.ylabel('time [tick]', fontsize=fontsize)\n",
    "plt.xlim([0, 1600]) # U, V\n",
    "plt.clim([2300,2400]) # U, V\n",
    "plt.xlim([1600, 2560]) # W\n",
    "plt.clim([885,915]) # W\n",
    "plt.grid()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [],
   "source": [
    "min_tick = 0\n",
    "max_tick = 6000\n",
    "channel = 2150\n",
    "plt.plot(d_2d['frame__0'][min_tick:max_tick,channel],label='2d')\n",
    "plt.plot(d_q1d['frame__0'][min_tick:max_tick,channel],'o',label='q1d')\n",
    "plt.legend(loc='best',fontsize=20)\n",
    "plt.grid()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "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.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
