{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from numpy import loadtxt\n",
    "from urllib import urlopen\n",
    "\n",
    "baseURL = \"http://golem.fjfi.cvut.cz/utils/data/\"\n",
    "ShotNo = 22471\n",
    "identifier = \"loop_voltage\"\n",
    "#Create a path to data\n",
    "dataURL = urlopen(baseURL+ str(ShotNo) + '/' + identifier)\n",
    "#Load data from GOLEM server \n",
    "data=loadtxt(dataURL, delimiter='\\t')\n",
    "#Plot the graph\n",
    "plt.plot(data[:,0], data[:,1], 'k-') \n",
    "plt.savefig('graph.jpg')\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
