Commit a2fb5eb6 authored by Nick Sauerwein's avatar Nick Sauerwein
Browse files

AnalysisTools added

parent 2abfc98f
......@@ -2,12 +2,21 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 10,
"metadata": {
"hideCode": false,
"hidePrompt": false
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
......@@ -34,20 +43,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"z persicope aligned loaded\n"
]
}
],
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import DataManager as dm\n",
"io = dm.IO('Data/')\n",
"io = dm.IO('Data/EXP2206/')\n",
"\n",
"\n",
"config = io.load(-1)\n",
......@@ -56,86 +59,76 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"collapsed": true,
"hideCode": false,
"hidePrompt": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"-9 old parabolic mirror position (elog 32)\n",
"-8 Parabilic Mirror manual optimization\n",
"-7 Optimal focus (programm) \n",
"-6 Optimal focus (programm terminated, better =) )\n",
"-5 Optimal focus 2 (programm)\n",
"-4 beginning of longitudinal alignment\n",
"-3 Intensity scan\n",
"-2 intensety scan (all devices)\n",
"-1 z persicope aligned\n"
]
}
],
"outputs": [],
"source": [
"for i in range(-9,0):\n",
"for i in range(1,):\n",
" configs = io.load(i)\n",
" print (i ,configs['comment'])"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"dm.print_dict(config)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## DelayGenerator"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from Devices.DelayGenerator import DelayGenerator\n",
"\n",
"try:\n",
" delay_config = config['DelayGenerator']\n",
"except:\n",
" delay_config = {'jet_triggered': True,\n",
" 'mode': 'single shot',\n",
" 'rate': 10.,\n",
" 't_sleep': 0.05}\n",
"\n",
"delay = DelayGenerator(delay_config)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"time = 2017-05-19_12-33-53.297785\n",
"[DelayGenerator]\n",
" mode = single shot\n",
" jet_triggered = True\n",
" rate = 10.309278350515463\n",
" t_sleep = 0.05\n",
"[Interferometer]\n",
" ExposureTimeAbs = 35.0\n",
" TriggerMode = On\n",
" xmin = 2.6\n",
" xmax = 6.0\n",
" zmin = 3\n",
" zmax = 12\n",
"[Laser]\n",
" max_angle = -22.9\n",
" attenuation = 100.0\n",
" comp_lin = 38.2\n",
" channel = 1\n",
"[DRS4]\n",
" trigger_mode = 2\n",
" trigger_level_CH0 = 100.0\n",
" delay = 0.0\n",
"[FaradayCup]\n",
" channel = 2\n",
"[Periscope]\n",
" pos_g_origin_x = -17.89999999999999\n",
" pos_g_origin_y = 7.380000000000001\n",
" pos_g_origin_z = 15.869\n",
" pos_l_x = -3.0999708488806057\n",
" pos_l_y = 3.499984841417909\n",
" pos_l_z = -1.7000109608208955\n",
" deltaz_Mz = 9.299877565298507\n",
" deltaz_Cz = -6.617500233208954\n",
" sync_camera = True\n",
"[ParabolicMirror]\n",
" pos_Pay = 5.004168610074627\n",
" pos_Paz = 4.700909514925373\n",
"comment = z persicope aligned\n"
]
"data": {
"text/plain": [
"{'time': '2017-06-26_12-40-16.890023'}"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dm.print_dict(config)"
"delay.measure()"
]
},
{
......@@ -154,8 +147,7 @@
"metadata": {
"collapsed": true,
"hideCode": false,
"hidePrompt": false,
"scrolled": true
"hidePrompt": false
},
"outputs": [],
"source": [
......@@ -210,20 +202,13 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"collapsed": true,
"hideCode": false,
"hidePrompt": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Connnection with motors sucessful!\n"
]
}
],
"outputs": [],
"source": [
"from Devices.ParabolicMirror import ParabolicMirror\n",
"\n",
......@@ -234,7 +219,7 @@
" para_config = {'pos_Pay': 3,\n",
" 'pos_Paz': 3}\n",
" \n",
"para = ParabolicMirror(para_config, home = True)"
"para = ParabolicMirror(para_config, home = False)"
]
},
{
......@@ -249,25 +234,13 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"collapsed": true,
"hideCode": false,
"hidePrompt": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dummmotor used\n",
"Connnection with motors sucessful!\n",
"c\n",
"x\n",
"y\n",
"z\n"
]
}
],
"outputs": [],
"source": [
"from Devices.Periscope import Periscope\n",
"\n",
......@@ -285,7 +258,7 @@
" 'deltaz_Cz': 0,\n",
" 'sync_camera': False}\n",
" \n",
"per = Periscope(per_config, home = True)"
"per = Periscope(per_config, home = False)"
]
},
{
......@@ -300,10 +273,12 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {
"collapsed": true,
"hideCode": false,
"hidePrompt": false
"hidePrompt": false,
"scrolled": true
},
"outputs": [],
"source": [
......@@ -318,7 +293,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 5,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -344,7 +319,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {
"hideCode": false,
"hidePrompt": false
......@@ -377,13 +352,17 @@
" 'z0': 10.5,\n",
" 'ExposureTimeAbs':35,\n",
" 'TriggerMode':'On',\n",
" 'rescale':5}\n",
"inter = Interferometer(inter_config)"
" 'rescale':5,\n",
" 'Tomography': False,\n",
" 'num_av': 1,\n",
" 'num_dir': 2,\n",
" 'take_data': True}\n",
"inter = Interferometer(inter_config, blade = blade, delay = delay)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -396,7 +375,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -418,127 +397,45 @@
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"connecting camera\n",
"available cameras:\n",
"<DeviceInfo Basler avA2300-25gmDSY (21547524)>\n",
"<DeviceInfo Basler scA1400-17gm (21145133)>\n",
"camera found =) Be happy\n",
"done\n"
]
}
],
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from Devices.PlasmaCamHorizontal import PlasmaCamHorizontal\n",
"\n",
"try:\n",
" inter_config = config['PlasmaCamHorizontal']\n",
" plasmacam_config = config['PlasmaCamHorizontal']\n",
"except:\n",
" inter_config = {\n",
" plasmacam_config = {\n",
" 'y0': 6.8,\n",
" 'z0': 8.45,\n",
" 'ExposureTimeAbs':200000,\n",
" 'ExposureTimeAbs':81800,\n",
" 'TriggerMode':'Off'}\n",
"plasmacam = PlasmaCamHorizontal(inter_config)"
"plasmacam = PlasmaCamHorizontal(plasmacam_config)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"measurement = plasmacam.measure()"
"#measurement = plasmacam.measure()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"http://localhost:5006/?bokeh-session-id=PlasmaCamHorizontal\n"
]
},
{
"data": {
"text/html": [
"<script type='text/javascript'>window.open('http://localhost:5006/?bokeh-session-id=PlasmaCamHorizontal', '_blank','width=500, height=500');</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plasmacam.plot_measure(measurement)"
]
},
{
"cell_type": "markdown",
"metadata": {
"hideCode": false,
"hidePrompt": false
},
"source": [
"## DelayGenerator"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"collapsed": true,
"hideCode": false,
"hidePrompt": false
"collapsed": true
},
"outputs": [],
"source": [
"from Devices.DelayGenerator import DelayGenerator\n",
"\n",
"try:\n",
" delay_config = config['DelayGenerator']\n",
"except:\n",
" delay_config = {'jet_triggered': True,\n",
" 'mode': 'single shot',\n",
" 'rate': 10.,\n",
" 't_sleep': 0.05}\n",
"\n",
"delay = DelayGenerator(delay_config)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"hideCode": false,
"hidePrompt": false
},
"outputs": [
{
"data": {
"text/plain": [
"{'time': '2017-06-13_15-54-23.981302'}"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"delay.measure()"
"#plasmacam.plot_measure(measurement)"
]
},
{
......@@ -553,7 +450,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -584,7 +481,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -617,7 +514,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -649,7 +546,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": null,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -670,7 +567,7 @@
"hidePrompt": false
},
"source": [
"# IO und GUI"
"# GUI"
]
},
{
......@@ -687,7 +584,7 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"io = dm.IO('Data/')\n",
"io = dm.IO('Data/EXP2206/')\n",
"\n",
"\n",
"import GUI"
......@@ -695,7 +592,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 13,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -706,20 +603,22 @@
},
"outputs": [],
"source": [
"#devices = [delay,inter,laser, drs, fara, blade]#, focus]#, per]#, blade] #use this to run the LWFA\n",
"devices = [blade,delay, inter]#, blade]#, focus]#, per]#, blade] #use this to run the LWFA\n",
"#devices = [td1, td2]#,fara]#, inter]\n",
"#devices = [ para, laser, focus] #use this to do focus optimization\n",
"\n",
"#devices = [per, para]#, delay]#, inter] #Use this do debug the gui and data menager\n",
"#devices = [para, laser]#, delay]#, inter] #Use this do debug the gui and data menager\n",
"#devices = [laser, drs]\n",
"#devices = [per]\n",
"#devices = [per, para, plasmacam]\n",
"\n",
"devices = [delay, inter, plasmacam, blade]"
"#devices = [delay, inter, blade]\n",
"#devices = [plasmacam]\n",
"#devices = [focus, para]"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 18,
"metadata": {
"hideCode": false,
"hidePrompt": false,
......@@ -730,16 +629,145 @@
"name": "stdout",
"output_type": "stream",
"text": [
"DelayGenerator config time: 0.003238677978515625\n",
"Interferometer config time: 0.0007772445678710938\n",
"PlasmaCamHorizontal config time: 0.0026106834411621094\n",
"BladePositioning config time: 0.602971076965332\n",
"DelayGenerator measure time: 0.0004241466522216797\n",
"Interferometer measure time: 0.25462961196899414\n",
"PlasmaCamHorizontal measure time: 0.3014042377471924\n",
"maximal possible rate: 0.4\n",
"set rate cannot be reached.\n"
"BladePositioning config time: 0.6034305095672607\n",
"DelayGenerator config time: 0.003995180130004883\n",
"Interferometer config time: 0.0008571147918701172\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "961283acd553401aa04e249b22cca144"
}
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "273e0a0f14124047ac63b8a18f0ef6e4"
}
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9290384571dd4f408ec3be94a422441f"
}
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "45473543ddcc49b4ae53bd6ad997d3b3"
}
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "52b6beed1dcd4916a735a37c83777cbd"
}
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7e145fb9cf41460593ff71a3a8cadda0"
}
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7eae4aaa5689435b85a6bad4c4e71f2b"
}
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ffe2b81257724745b0c9b4eb1ef5bd87"