NotebookGUI.ipynb 22.1 KB
Newer Older
1 2 3 4
{
 "cells": [
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
5
   "execution_count": 5,
6
   "metadata": {
7 8 9
    "collapsed": false,
    "deletable": true,
    "editable": true
10
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
11 12 13 14 15 16 17 18 19 20
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The autoreload extension is already loaded. To reload it, use:\n",
      "  %reload_ext autoreload\n"
     ]
    }
   ],
21 22 23
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
24
    "\n",
25
    "\n",
26
    "%load_ext autoreload\n",
27
    "\n",
28
    "from ipywidgets import interact, interactive, fixed, interact_manual\n",
29 30 31
    "import ipywidgets as widgets"
   ]
  },
32 33
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
34
   "execution_count": 6,
35
   "metadata": {
36
    "collapsed": false,
37 38
    "deletable": true,
    "editable": true
39
   },
40 41 42 43 44
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
45
      "Using matplotlib backend: Qt5Agg\n"
46 47 48
     ]
    }
   ],
49
   "source": [
50 51
    "%autoreload\n",
    "%matplotlib"
52 53
   ]
  },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
54 55
  {
   "cell_type": "markdown",
56 57 58 59
   "metadata": {
    "deletable": true,
    "editable": true
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
60 61 62 63
   "source": [
    "## Load old configurations"
   ]
  },
64 65
  {
   "cell_type": "code",
66
   "execution_count": null,
67
   "metadata": {
68 69 70
    "collapsed": false,
    "deletable": true,
    "editable": true
71
   },
72
   "outputs": [],
73
   "source": [
74
    "for i in range(-1,0):\n",
75 76 77 78
    "    config = io.load(i)\n",
    "    print (i ,config['comment'])"
   ]
  },
79 80
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
81
   "execution_count": 19,
82
   "metadata": {
83 84 85
    "collapsed": false,
    "deletable": true,
    "editable": true
86
   },
87 88 89 90 91
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
92
      "best configuration of parabolic mirror (good automatic optimization)\n"
93 94 95
     ]
    }
   ],
96 97 98
   "source": [
    "import DataManager as dm\n",
    "io = dm.IO('Data/')\n",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
99
    "config = io.load(-2)\n",
100 101 102
    "print (config['comment'])"
   ]
  },
103 104
  {
   "cell_type": "markdown",
105 106 107 108
   "metadata": {
    "deletable": true,
    "editable": true
   },
109 110 111 112 113 114
   "source": [
    "## FocusCamera"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
115
   "execution_count": null,
116
   "metadata": {
117 118 119
    "collapsed": false,
    "deletable": true,
    "editable": true
120
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
121
   "outputs": [],
122 123 124 125 126 127 128
   "source": [
    "from Devices.FocusCamera import FocusCamera\n",
    "\n",
    "try:\n",
    "    para_config = config['FocusCamera']\n",
    "except:\n",
    "    para_config = {'ExposureTimeAbs': 10000,\n",
129
    "                 'min_intensity': 2000,\n",
130 131 132 133 134 135 136
    "                  'measure_full' : True}\n",
    "    \n",
    "focus = FocusCamera(para_config)"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
137
   "execution_count": null,
138
   "metadata": {
139 140 141
    "collapsed": false,
    "deletable": true,
    "editable": true
142
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
143
   "outputs": [],
144 145 146 147 148 149
   "source": [
    "meas = focus.measure()"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
150
   "execution_count": null,
151
   "metadata": {
152 153 154
    "collapsed": false,
    "deletable": true,
    "editable": true
155
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
156
   "outputs": [],
157 158 159 160 161
   "source": [
    "focus.plot_measure(meas)\n",
    "plt.show()"
   ]
  },
162 163
  {
   "cell_type": "markdown",
164 165 166 167
   "metadata": {
    "deletable": true,
    "editable": true
   },
168 169 170 171 172 173
   "source": [
    "## ParabolicMirror"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
174
   "execution_count": null,
175
   "metadata": {
176 177 178
    "collapsed": false,
    "deletable": true,
    "editable": true
179
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
180
   "outputs": [],
181 182 183 184 185
   "source": [
    "from Devices.ParabolicMirror import ParabolicMirror\n",
    "\n",
    "\n",
    "try:\n",
186
    "    para_config = config['ParabolicMirror']\n",
187 188 189 190 191 192 193
    "except:\n",
    "    para_config = {'pos_Pay': 3,\n",
    "                 'pos_Paz': 3}\n",
    "    \n",
    "para = ParabolicMirror(para_config, home = True)"
   ]
  },
194 195
  {
   "cell_type": "markdown",
196 197 198 199
   "metadata": {
    "deletable": true,
    "editable": true
   },
200
   "source": [
201
    "## Periscope"
202 203 204 205
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
206
   "execution_count": 20,
Nick Sauerwein's avatar
Nick Sauerwein committed
207
   "metadata": {
208 209 210
    "collapsed": false,
    "deletable": true,
    "editable": true
Nick Sauerwein's avatar
Nick Sauerwein committed
211
   },
212 213 214 215 216 217 218 219 220
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Connnection with motors sucessful!\n"
     ]
    }
   ],
Hermann Benedikt's avatar
Hermann Benedikt committed
221 222 223
   "source": [
    "from Devices.Periscope import Periscope\n",
    "\n",
224 225 226 227 228
    "\n",
    "try:\n",
    "    per_config = config['Periscope']\n",
    "except:\n",
    "    per_config = {'pos_l_x': 0.1,\n",
Hermann Benedikt's avatar
Hermann Benedikt committed
229 230 231 232 233 234 235 236
    "              'pos_l_y': 0.1,\n",
    "              'pos_l_z': 0.1, \n",
    "              'pos_g_origin_x': -25./2,\n",
    "              'pos_g_origin_y': 25./2,\n",
    "              'pos_g_origin_z': 25./2,\n",
    "              'deltaz_Mz': 0,\n",
    "              'deltaz_Cz': 0,\n",
    "              'sync_camera': True}\n",
237
    "    \n",
238
    "per = Periscope(per_config, home = False)"
Hermann Benedikt's avatar
Hermann Benedikt committed
239 240
   ]
  },
241 242
  {
   "cell_type": "markdown",
243 244 245 246
   "metadata": {
    "deletable": true,
    "editable": true
   },
247 248 249 250 251 252
   "source": [
    "## BladePositioning"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
253
   "execution_count": 27,
254
   "metadata": {
255 256 257
    "collapsed": false,
    "deletable": true,
    "editable": true
258 259 260 261 262 263 264 265
   },
   "outputs": [],
   "source": [
    "from Devices.BladePositioning import BladePositioning\n",
    "\n",
    "try:\n",
    "    blade_config = config['BladePositioning']\n",
    "except:\n",
266
    "    blade_config = {'pos_R':344.25, 'pos_L':-2.8}\n",
267 268 269 270 271
    "blade = BladePositioning(blade_config, init = 0)"
   ]
  },
  {
   "cell_type": "code",
272
   "execution_count": null,
273
   "metadata": {
274 275 276
    "collapsed": false,
    "deletable": true,
    "editable": true
277
   },
278
   "outputs": [],
279 280 281 282
   "source": [
    "blade.get_config()"
   ]
  },
Hermann Benedikt's avatar
Hermann Benedikt committed
283 284
  {
   "cell_type": "markdown",
285 286 287 288
   "metadata": {
    "deletable": true,
    "editable": true
   },
Hermann Benedikt's avatar
Hermann Benedikt committed
289
   "source": [
290
    "## Interferometer"
Hermann Benedikt's avatar
Hermann Benedikt committed
291 292 293 294
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
295
   "execution_count": 8,
Hermann Benedikt's avatar
Hermann Benedikt committed
296
   "metadata": {
297 298 299
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
300
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
301 302 303 304 305 306 307 308 309 310 311 312
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "available cameras:\n",
      "<DeviceInfo Basler scA1400-17gm (21145133)>\n",
      "<DeviceInfo Basler avA2300-25gmDSY (21547524)>\n",
      "camera found =) Be happy\n"
     ]
    }
   ],
Hermann Benedikt's avatar
Hermann Benedikt committed
313 314 315
   "source": [
    "from Devices.Interferometer import Interferometer\n",
    "\n",
316 317 318 319 320 321 322 323
    "try:\n",
    "    inter_config = config['Interferometer']\n",
    "except:\n",
    "    inter_config = {'xmax':6.0,\n",
    "                    'xmin':2.6,\n",
    "                    'ymin':3, \n",
    "                    'ymax':12,\n",
    "                    'ExposureTimeAbs':35}\n",
Hermann Benedikt's avatar
Hermann Benedikt committed
324 325 326 327 328
    "inter = Interferometer(inter_config)"
   ]
  },
  {
   "cell_type": "code",
329
   "execution_count": null,
Hermann Benedikt's avatar
Hermann Benedikt committed
330
   "metadata": {
331 332 333
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
334 335 336 337 338 339 340 341
   },
   "outputs": [],
   "source": [
    "#measurement = inter.measure()"
   ]
  },
  {
   "cell_type": "code",
342
   "execution_count": null,
Hermann Benedikt's avatar
Hermann Benedikt committed
343
   "metadata": {
344 345 346
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
347 348 349 350 351 352 353 354
   },
   "outputs": [],
   "source": [
    "#inter.plot_measure(measurement)"
   ]
  },
  {
   "cell_type": "markdown",
355 356 357 358
   "metadata": {
    "deletable": true,
    "editable": true
   },
Hermann Benedikt's avatar
Hermann Benedikt committed
359
   "source": [
360
    "## DelayGenerator"
Hermann Benedikt's avatar
Hermann Benedikt committed
361 362 363 364
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
365
   "execution_count": 26,
Hermann Benedikt's avatar
Hermann Benedikt committed
366
   "metadata": {
367 368 369
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
370 371 372 373 374
   },
   "outputs": [],
   "source": [
    "from Devices.DelayGenerator import DelayGenerator\n",
    "\n",
375 376 377 378 379 380 381
    "try:\n",
    "    delay_config = config['DelayGenerator']\n",
    "except:\n",
    "    delay_config = {'jet_triggered': True,\n",
    "                    'mode': 'single shot',\n",
    "                    'rate': 1.,\n",
    "                    't_sleep': 0.3}\n",
Hermann Benedikt's avatar
Hermann Benedikt committed
382 383 384 385 386 387
    "\n",
    "delay = DelayGenerator(delay_config)"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
388
   "execution_count": 5,
Hermann Benedikt's avatar
Hermann Benedikt committed
389
   "metadata": {
390 391 392
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
393
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
394 395 396 397 398 399 400 401 402 403 404 405
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'time': '2017-03-29_10-39-30.348962'}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
Hermann Benedikt's avatar
Hermann Benedikt committed
406
   "source": [
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
407
    "delay.measure()"
Hermann Benedikt's avatar
Hermann Benedikt committed
408 409 410 411
   ]
  },
  {
   "cell_type": "markdown",
412 413 414 415
   "metadata": {
    "deletable": true,
    "editable": true
   },
Hermann Benedikt's avatar
Hermann Benedikt committed
416
   "source": [
417
    "## DRS4"
Hermann Benedikt's avatar
Hermann Benedikt committed
418 419 420 421
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
422
   "execution_count": 23,
Hermann Benedikt's avatar
Hermann Benedikt committed
423
   "metadata": {
424 425 426
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
427 428 429
   },
   "outputs": [],
   "source": [
430 431
    "from Devices.DRS4 import DRS4\n",
    "\n",
432 433 434 435
    "try:\n",
    "    drs_config = config['DRS4']\n",
    "except:\n",
    "    drs_config = {'trigger_level_CH0': 100,\n",
436 437
    "                  'trigger_mode':2,\n",
    "                  'delay': 0.0}\n",
438 439 440 441 442
    "drs = DRS4(drs_config)"
   ]
  },
  {
   "cell_type": "markdown",
443 444 445 446
   "metadata": {
    "deletable": true,
    "editable": true
   },
447 448
   "source": [
    "## Laser"
Hermann Benedikt's avatar
Hermann Benedikt committed
449 450 451 452
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
453
   "execution_count": 24,
Hermann Benedikt's avatar
Hermann Benedikt committed
454
   "metadata": {
455 456 457
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
458
   },
459 460 461 462 463
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
464
      "16.3315204836\n"
465 466 467
     ]
    }
   ],
Hermann Benedikt's avatar
Hermann Benedikt committed
468
   "source": [
469 470
    "from Devices.Laser import Laser\n",
    "\n",
471 472 473 474 475 476 477
    "try:\n",
    "    laser_config = config['Laser']\n",
    "except:\n",
    "    laser_config = {'max_angle': -22.9,\n",
    "                    'attenuation': 100,\n",
    "                    'comp_lin': 37.796,\n",
    "                    'channel': 1}\n",
478 479 480 481 482 483
    "\n",
    "laser = Laser(laser_config, drs)"
   ]
  },
  {
   "cell_type": "markdown",
484 485 486 487
   "metadata": {
    "deletable": true,
    "editable": true
   },
488 489
   "source": [
    "## FaradayCup"
Hermann Benedikt's avatar
Hermann Benedikt committed
490 491 492 493
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
494
   "execution_count": 25,
Hermann Benedikt's avatar
Hermann Benedikt committed
495
   "metadata": {
496 497 498
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
499 500 501
   },
   "outputs": [],
   "source": [
502
    "from Devices.FaradayCup import FaradayCup\n",
503 504 505 506
    "\n",
    "try:\n",
    "    fara_config = config['FaradayCup']\n",
    "except:\n",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
507
    "    fara_config = {'channel':2 }\n",
Hermann Benedikt's avatar
Hermann Benedikt committed
508
    "\n",
509 510 511 512 513
    "fara = FaradayCup(fara_config, drs)"
   ]
  },
  {
   "cell_type": "markdown",
514 515 516 517
   "metadata": {
    "deletable": true,
    "editable": true
   },
518 519
   "source": [
    "## test_devices"
Hermann Benedikt's avatar
Hermann Benedikt committed
520 521 522 523
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
524
   "execution_count": null,
Hermann Benedikt's avatar
Hermann Benedikt committed
525
   "metadata": {
526 527 528
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
529 530 531
   },
   "outputs": [],
   "source": [
532
    "from Devices.test_devices import test_device1, test_device2\n",
533 534
    "\n",
    "td1 = test_device1(2)\n",
535
    "td2 = test_device2(4.)"
536 537 538 539
   ]
  },
  {
   "cell_type": "markdown",
540 541 542 543
   "metadata": {
    "deletable": true,
    "editable": true
   },
544 545
   "source": [
    "# IO und GUI"
Hermann Benedikt's avatar
Hermann Benedikt committed
546 547 548 549
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
550
   "execution_count": 33,
Hermann Benedikt's avatar
Hermann Benedikt committed
551
   "metadata": {
552 553 554
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
555
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
556 557 558 559 560
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
561
      "Using matplotlib backend: Qt5Agg\n"
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
562 563 564
     ]
    }
   ],
Hermann Benedikt's avatar
Hermann Benedikt committed
565
   "source": [
566 567 568 569
    "import DataManager as dm\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
570
    "io = dm.IO('Data/')\n",
571
    "\n",
572
    "%matplotlib\n",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
573
    "\n",
Advanced Instrumentation's avatar
Advanced Instrumentation committed
574
    "import GUI\n",
575
    "%autoreload"
Hermann Benedikt's avatar
Hermann Benedikt committed
576 577 578 579
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
580
   "execution_count": 34,
Hermann Benedikt's avatar
Hermann Benedikt committed
581
   "metadata": {
582 583 584
    "collapsed": false,
    "deletable": true,
    "editable": true
Hermann Benedikt's avatar
Hermann Benedikt committed
585
   },
586
   "outputs": [],
Hermann Benedikt's avatar
Hermann Benedikt committed
587
   "source": [
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
588 589
    "devices = [delay,laser, inter, drs, fara, per, blade]  #use this to run the LWFA\n",
    "#devices = [inter, per]\n",
590
    "#devices = [per, para, laser, focus]              #use this to do focus optimization\n",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
591
    "#devices = [td1, td2]                             #Use this do debug the gui and data menager"
Hermann Benedikt's avatar
Hermann Benedikt committed
592 593 594 595
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
596
   "execution_count": 35,
597 598
   "metadata": {
    "collapsed": false,
599 600
    "deletable": true,
    "editable": true,
601
    "scrolled": false
602 603
   },
   "outputs": [
604
    {
605 606
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
607
       "model_id": "9687c609909a4a75862ad3471c1722d2"
608 609 610 611 612 613 614 615
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
616
       "model_id": "550ad84aa4a6422caeedb061d82c5ece"
617 618 619 620 621 622 623 624
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
625
       "model_id": "a74d3f227f414c22a418441cc8eff8e2"
626 627 628 629 630 631 632 633
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
634
       "model_id": "b99db782ef5d4d038250a93f49c1c001"
635 636 637 638 639 640 641 642
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
643
       "model_id": "9ddf7ac6d426498c9817a24edc3cf1a4"
644 645 646 647 648 649 650 651
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
652
       "model_id": "3032d69feffc464184f033ce44e0760f"
653 654 655 656 657 658 659 660
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
661
       "model_id": "2bfb23e80c594eae8c297a15f2f7a2f5"
662 663 664 665 666 667 668 669
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
670
       "model_id": "6e5c019ba24743e6978fae40eff0e151"
671 672 673 674 675 676 677 678
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
679
       "model_id": "66c4f1b4d0a243eaac3b87dede72a7c8"
680 681 682 683 684 685 686 687
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
688
       "model_id": "5415b8fd31c546a6ad19f5dd596024c8"
689 690 691 692 693 694 695 696
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
697
       "model_id": "c75838b0f39d4c3183c8d37dbed4c19a"
698 699 700 701 702 703 704 705
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
706
       "model_id": "cb4894a731c5486cb5138f9fdf771bc8"
707 708 709 710 711 712 713 714
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
715
       "model_id": "ddf9af4d8dfa4144a7214b2a04470b88"
716 717 718 719 720 721 722 723
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
724
       "model_id": "b67122affb1d4434a5ccc82c8d328c9c"
725 726 727 728 729 730 731 732
      }
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
733
       "model_id": "7086fe7ca4c04da5b5f5f5dac9ee9091"
734 735 736 737
      }
     },
     "metadata": {},
     "output_type": "display_data"
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
738 739 740
    }
   ],
   "source": [
741
    "plt.ion()\n",
742
    "GUI.main(devices, io, parallel = False)"
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
743 744
   ]
  },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
745 746 747 748 749 750 751 752 753
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
754 755
  {
   "cell_type": "code",
756
   "execution_count": null,
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
757
   "metadata": {
758 759 760
    "collapsed": false,
    "deletable": true,
    "editable": true
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
761
   },
762
   "outputs": [],
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
763 764 765 766 767 768 769 770
   "source": [
    "dm.set_config(devices,io.load(29, elog = True))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
771 772 773
    "collapsed": false,
    "deletable": true,
    "editable": true
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
774 775 776 777 778 779
   },
   "outputs": [],
   "source": [
    "list_of_measurements = io.search(kind = 'measure')"
   ]
  },
780 781 782 783 784 785 786 787 788 789 790 791 792
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "io.search(output = False)"
   ]
  },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
793 794
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
795
   "execution_count": null,
796
   "metadata": {
797 798
    "collapsed": false,
    "deletable": true,
799 800
    "editable": true,
    "scrolled": false
801
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
802
   "outputs": [],
803
   "source": [
804
    "%autoreload\n",
805
    "para.optimize(focus, laser, per, 0.006, output = True)"
806 807 808 809
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
810
   "execution_count": null,
811
   "metadata": {
812
    "collapsed": false,
813 814
    "deletable": true,
    "editable": true
815 816 817
   },
   "outputs": [],
   "source": [
818 819 820 821 822 823 824 825 826 827 828 829 830 831 832
    "class test:\n",
    "    def __init__(self, du):\n",
    "        self.du = du\n",
    "        \n",
    "    def give(self):\n",
    "        print (self.du)\n",
    "        return self.du\n",
    "    def kase(si):\n",
    "        print (si.du)\n",
    "        \n",
    "    def __str__(self):\n",
    "        return 'hege: '+str(self.du)\n",
    "    \n",
    "    def __add__(self, right):\n",
    "        return test(self.du + right.du)"
833 834
   ]
  },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
835 836
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
837
   "execution_count": null,
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
838
   "metadata": {
839 840 841
    "collapsed": true,
    "deletable": true,
    "editable": true
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
842 843
   },
   "outputs": [],
844 845 846 847 848 849 850
   "source": [
    "t1 = test(2)\n",
    "t2 = test(4)"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
851
   "execution_count": null,
852
   "metadata": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
853 854 855
    "collapsed": false,
    "deletable": true,
    "editable": true
856
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
857
   "outputs": [],
858 859 860 861 862 863
   "source": [
    "t1.give()"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
864
   "execution_count": null,
865
   "metadata": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
866 867 868
    "collapsed": false,
    "deletable": true,
    "editable": true
869
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
870
   "outputs": [],
871 872 873 874 875 876
   "source": [
    "t1.du"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
877
   "execution_count": null,
878
   "metadata": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
879 880 881
    "collapsed": false,
    "deletable": true,
    "editable": true
882
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
883
   "outputs": [],
884 885 886 887 888 889
   "source": [
    "t1.kase()"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
890
   "execution_count": null,
891
   "metadata": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
892 893 894
    "collapsed": true,
    "deletable": true,
    "editable": true
895 896 897 898 899 900 901 902
   },
   "outputs": [],
   "source": [
    "t1.du = 4"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
903
   "execution_count": null,
904
   "metadata": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
905 906 907
    "collapsed": false,
    "deletable": true,
    "editable": true
908
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
909
   "outputs": [],
910 911 912 913 914 915
   "source": [
    "t1.give()"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
916
   "execution_count": null,
917
   "metadata": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
918 919 920
    "collapsed": false,
    "deletable": true,
    "editable": true
921
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
922
   "outputs": [],
923 924 925 926 927 928
   "source": [
    "print (t1)"
   ]
  },
  {
   "cell_type": "code",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
929
   "execution_count": null,
930
   "metadata": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
931 932 933
    "collapsed": false,
    "deletable": true,
    "editable": true
934
   },
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
935
   "outputs": [],
936 937 938 939 940 941 942 943
   "source": [
    "print (t1 + t2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
944 945 946
    "collapsed": true,
    "deletable": true,
    "editable": true
947 948
   },
   "outputs": [],
949
   "source": []
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
950 951 952 953 954
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
955
   "display_name": "Python [default]",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
956 957 958
   "language": "python",
   "name": "python3"
  },
959 960 961 962
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
963
   },
964 965 966 967 968
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
Sauerwein Nick Jacob's avatar
Sauerwein Nick Jacob committed
969
   "version": "3.5.3"
970 971 972
  },
  "widgets": {
   "state": {
973
    "0065df34925c4ad18b5e33837ed8762e": {
974 975
     "views": [
      {
976
       "cell_index": 34
977 978 979
      }
     ]
    },
980
    "0c32490fdf0e49209a83fab858376cf1": {
981 982
     "views": [
      {
983
       "cell_index": 34
984 985 986
      }
     ]
    },
987
    "0f446a29d17d40c9af519c71acb6f891": {
988 989
     "views": [
      {
990
       "cell_index": 34
991 992 993
      }
     ]
    },
994
    "151870f89a704faf89bc8b2cbbe5611c": {
995 996
     "views": [
      {
997
       "cell_index": 34
998 999 1000
      }
     ]
    },
1001
    "16f9122ce08d48c39fcf8ee0df28a79c": {
1002 1003
     "views": [
      {
1004
       "cell_index": 34
1005 1006 1007
      }
     ]
    },
1008
    "1ab5a59ccf9f4fef839a79fd4b7a65b0": {
1009 1010
     "views": [
      {
1011
       "cell_index": 34
1012 1013 1014
      }
     ]
    },
1015
    "2fddeec661ed482995d338a7c5312139": {
1016 1017
     "views": [
      {
1018
       "cell_index": 34
1019 1020 1021
      }
     ]
    },
1022
    "3a819ca20ac949e3be372d4c4a9a9487": {
1023 1024
     "views": [
      {
1025
       "cell_index": 34
1026 1027 1028
      }
     ]
    },
1029
    "448db5ef3bc0457190f5f33f19b5f06c": {
1030 1031
     "views": [
      {
1032
       "cell_index": 34
1033 1034 1035
      }
     ]
    },
1036
    "4f4f1ff5355c42a886b75d3a6c044d2c": {
1037 1038
     "views": [
      {
1039
       "cell_index": 34
1040 1041 1042
      }
     ]
    },
1043
    "54a5678c069d48069ab3dfadf649b6dd": {
1044 1045
     "views": [
      {
1046
       "cell_index": 34