Commit 4a56f411 authored by Sauerwein Nick Jacob's avatar Sauerwein Nick Jacob
Browse files

after scan of charge

parent c33ab658
......@@ -32,7 +32,7 @@ class FaradayCup:
time = datetime.datetime.now()
measurement = {}
measurement = {'time': time,'sig_time': sig_time, 'sig_uvolt': sig_uvolt}
measurement = {'time': time,'sig_time': sig_time, 'sig_uvolt': sig_uvolt, 'peak_uvolt': np.min(sig_uvolt) }
return measurement
def plot_measure(self, measurement, config = None):
......
......@@ -213,7 +213,7 @@ def ft(D):
kx = np.r_[-lx/2.:lx/2.]/lx
F0=np.fft.fft(D,axis=0)
F0=np.fft.fftshift(F0, axes=0)
F0[lx/2:,:]=0.
F0[int(lx/2):,:]=0.
F0=np.transpose(np.transpose(F0)*Ga(kx))
IF0=np.fft.ifft(F0,axis=0)
return IF0
......
......@@ -2,13 +2,22 @@
"cells": [
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 5,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"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",
......@@ -22,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 6,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -69,7 +78,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 19,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -80,14 +89,14 @@
"name": "stdout",
"output_type": "stream",
"text": [
"before optimization 2\n"
"best configuration of parabolic mirror (good automatic optimization)\n"
]
}
],
"source": [
"import DataManager as dm\n",
"io = dm.IO('Data/')\n",
"config = io.load(-1)\n",
"config = io.load(-2)\n",
"print (config['comment'])"
]
},
......@@ -103,25 +112,13 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"available cameras:\n",
"<DeviceInfo Basler scA1400-17gm (21145133)>\n",
"<DeviceInfo Basler acA3800-10gm (22005848)>\n",
"<DeviceInfo Basler avA2300-25gmDSY (21547524)>\n",
"camera found =) Be happy\n"
]
}
],
"outputs": [],
"source": [
"from Devices.FocusCamera import FocusCamera\n",
"\n",
......@@ -137,44 +134,26 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"# of contours: 1\n"
]
}
],
"outputs": [],
"source": [
"meas = focus.measure()"
]
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.35225725265 2.40014815635\n",
"# of contours: 1\n",
"0.00924077391017 0.00951045659382\n"
]
}
],
"outputs": [],
"source": [
"focus.plot_measure(meas)\n",
"plt.show()"
......@@ -192,22 +171,13 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"C:\\Users\\sauerwein_n\\Desktop\\lwfatools\n",
"Connnection with motors sucessful!\n"
]
}
],
"outputs": [],
"source": [
"from Devices.ParabolicMirror import ParabolicMirror\n",
"\n",
......@@ -233,7 +203,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 20,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -280,7 +250,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 27,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -322,13 +292,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"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"
]
}
],
"source": [
"from Devices.Interferometer import Interferometer\n",
"\n",
......@@ -381,7 +362,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 26,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -404,15 +385,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"{'time': '2017-03-29_10-39-30.348962'}"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#delay.measure()"
"delay.measure()"
]
},
{
......@@ -427,7 +419,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 23,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -458,7 +450,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 24,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -469,7 +461,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"-4.46505117708\n"
"16.3315204836\n"
]
}
],
......@@ -499,7 +491,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 25,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -512,7 +504,7 @@
"try:\n",
" fara_config = config['FaradayCup']\n",
"except:\n",
" fara_config = {'channel':0 }\n",
" fara_config = {'channel':2 }\n",
"\n",
"fara = FaradayCup(fara_config, drs)"
]
......@@ -529,7 +521,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -555,7 +547,7 @@
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": 33,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -566,8 +558,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"This computer does not support elog\n",
"Using matplotlib backend: MacOSX\n"
"Using matplotlib backend: Qt5Agg\n"
]
}
],
......@@ -586,7 +577,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": 34,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -594,14 +585,15 @@
},
"outputs": [],
"source": [
"#devices = [delay, inter, drs, fara, per, blade] #use this to run the LWFA\n",
"devices = [delay,laser, inter, drs, fara, per, blade] #use this to run the LWFA\n",
"#devices = [inter, per]\n",
"#devices = [per, para, laser, focus] #use this to do focus optimization\n",
"devices = [td1, td2] #Use this do debug the gui and data menager"
"#devices = [td1, td2] #Use this do debug the gui and data menager"
]
},
{
"cell_type": "code",
"execution_count": 50,
"execution_count": 35,
"metadata": {
"collapsed": false,
"deletable": true,
......@@ -612,7 +604,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8e8af3de41934f48a320330b848139a8"
"model_id": "9687c609909a4a75862ad3471c1722d2"
}
},
"metadata": {},
......@@ -621,7 +613,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d7e0387c4dd54762a1093afc72280455"
"model_id": "550ad84aa4a6422caeedb061d82c5ece"
}
},
"metadata": {},
......@@ -630,7 +622,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "73bd2aeff4cf42e7824989917cd120a5"
"model_id": "a74d3f227f414c22a418441cc8eff8e2"
}
},
"metadata": {},
......@@ -639,7 +631,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "89735e9c9fc4446aaf61990b8799a61f"
"model_id": "b99db782ef5d4d038250a93f49c1c001"
}
},
"metadata": {},
......@@ -648,7 +640,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "40507e43073e49ddb97ff0ea5beda0c2"
"model_id": "9ddf7ac6d426498c9817a24edc3cf1a4"
}
},
"metadata": {},
......@@ -657,7 +649,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9a91ee404b6f4089a10196111d718e40"
"model_id": "3032d69feffc464184f033ce44e0760f"
}
},
"metadata": {},
......@@ -666,7 +658,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6fc4b50e42274687b65938fda23b4703"
"model_id": "2bfb23e80c594eae8c297a15f2f7a2f5"
}
},
"metadata": {},
......@@ -675,7 +667,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "acd38a37411c40d2bf09424c8f4431ec"
"model_id": "6e5c019ba24743e6978fae40eff0e151"
}
},
"metadata": {},
......@@ -684,7 +676,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "229469f3dd4040258cca303c9d43e690"
"model_id": "66c4f1b4d0a243eaac3b87dede72a7c8"
}
},
"metadata": {},
......@@ -693,7 +685,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e77b5ca8057f4bfc939795375d76ecf1"
"model_id": "5415b8fd31c546a6ad19f5dd596024c8"
}
},
"metadata": {},
......@@ -702,7 +694,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8f2d45ace1d64bafa7e085b315bcc203"
"model_id": "c75838b0f39d4c3183c8d37dbed4c19a"
}
},
"metadata": {},
......@@ -711,7 +703,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "baa2828eef63435b914895319d1bf229"
"model_id": "cb4894a731c5486cb5138f9fdf771bc8"
}
},
"metadata": {},
......@@ -720,7 +712,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e98f49002f8a4fef9d1344a3ee46cae8"
"model_id": "ddf9af4d8dfa4144a7214b2a04470b88"
}
},
"metadata": {},
......@@ -729,7 +721,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0470df650ae64ed5aa2439cca2044243"
"model_id": "b67122affb1d4434a5ccc82c8d328c9c"
}
},
"metadata": {},
......@@ -738,7 +730,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "5f41c8145fbd484bab2b31d499dc1238"
"model_id": "7086fe7ca4c04da5b5f5f5dac9ee9091"
}
},
"metadata": {},
......@@ -750,6 +742,15 @@
"GUI.main(devices, io, parallel = False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
......@@ -791,750 +792,14 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true,
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"-------------------------------------------\n",
"Parameters: (4.6572995185852051, 4.4394240379333496, -6.5980353355407715)\n",
"2.57502847246 2.61087044567\n",
"0.00701086652501 0.00594195758977\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Program Files\\Anaconda3\\lib\\site-packages\\matplotlib\\backend_bases.py:2445: MatplotlibDeprecationWarning: Using default event loop until function specific to this GUI is implemented\n",
" warnings.warn(str, mplDeprecation)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"FWHMxs: [0.0061673218736930657, 0.0067317594146163451, 0.0064542725898446562, 0.0064888008523826812, 0.0068385227094136525, 0.0064071325093988385, 0.0070054950218532142, 0.006186747382972424, 0.0058454513513508388, 0.0070108665250132596]\n",
"maxits: [2668, 2509, 2532, 2654, 2434, 2691, 2602, 2687, 2818, 2691]\n",
"mean: 0.00960554364851 error: 0.000824978973319\n",
"-------------------------------------------\n",
"Parameters: (4.8901644945144653, 4.4394240379333496, -6.5980353355407715)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [985, 1130, 1098, 1055, 1027, 1023, 1023, 971, 990, 990]\n",
"mean: 0.0797705050091 error: 0.00349869876561\n",
"-------------------------------------------\n",
"Parameters: (4.6572995185852051, 4.6613952398300169, -6.5980353355407715)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1032, 999, 896, 1013, 976, 1013, 934, 943, 1004, 980]\n",
"mean: 0.0838248186028 error: 0.0034083823459\n",
"-------------------------------------------\n",
"Parameters: (4.6572995185852051, 4.4394240379333496, -6.9279371023178102)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1027, 990, 1060, 1070, 1004, 1018, 934, 948, 1070, 929]\n",
"mean: 0.0817286558016 error: 0.00403401461112\n",
"-------------------------------------------\n",
"Parameters: (4.812542835871378, 4.2174528360366823, -6.8179698467254628)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1088, 1046, 1051, 1032, 976, 952, 1098, 910, 1027, 1004]\n",
"mean: 0.0806911315116 error: 0.00435889262649\n",
"-------------------------------------------\n",
"Parameters: (4.9160383807288266, 4.2914432366689041, -6.414756576220193)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1004, 1037, 1112, 966, 999, 985, 999, 1051, 1088, 924]\n",
"mean: 0.0808131567377 error: 0.00403918468379\n",
"-------------------------------------------\n",
"Parameters: (4.8513536651929208, 4.3284384369850155, -6.5430517077445973)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [976, 1159, 1070, 1023, 990, 1037, 1027, 1018, 962, 995]\n",
"mean: 0.0800724984994 error: 0.00375312512553\n",
"-------------------------------------------\n",
"Parameters: (4.7866689496570167, 4.5874048391977942, -6.3414450724919629)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [990, 957, 999, 962, 1032, 1027, 1027, 980, 1084, 1041]\n",
"mean: 0.0812276058427 error: 0.0028468300267\n",
"-------------------------------------------\n",
"Parameters: (4.8060743643177872, 4.3099408368269607, -6.6988386531670878)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1041, 971, 1013, 976, 859, 948, 1116, 995, 929, 1065]\n",
"mean: 0.0830481240459 error: 0.0056141740909\n",
"-------------------------------------------\n",
"Parameters: (4.7737320065498352, 4.4394240379333496, -6.5980353355407715)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1051, 1023, 1201, 962, 1088, 995, 1055, 1032, 1018, 966]\n",
"mean: 0.0791318501531 error: 0.00446268751494\n",
"-------------------------------------------\n",
"Parameters: (4.7543265918890629, 4.3839312374591826, -6.5705435216426844)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1074, 1065, 1009, 1112, 1009, 1112, 1032, 957, 976, 1037]\n",
"mean: 0.0790824729346 error: 0.00364526584714\n",
"-------------------------------------------\n",
"Parameters: (4.7349211772282915, 4.3284384369850155, -6.7080025911331171)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1084, 1009, 1060, 1004, 1009, 966, 1177, 1084, 976, 1004]\n",
"mean: 0.0792331192522 error: 0.00421384728921\n",
"-------------------------------------------\n",
"Parameters: (4.72198423412111, 4.5134144385655723, -6.4697402040163672)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1070, 1140, 1093, 1018, 976, 1037, 1018, 990, 976, 1037]\n",
"mean: 0.0792923643393 error: 0.00356187253152\n",
"-------------------------------------------\n",
"Parameters: (4.7316869414514962, 4.3746824373801552, -6.6484369943539292)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1065, 938, 1102, 905, 1018, 1013, 1088, 1023, 980, 1009]\n",
"mean: 0.081060551933 error: 0.00459446199038\n",
"-------------------------------------------\n",
"Parameters: (4.705813055237134, 4.4116776376962665, -6.5842894285917275)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1027, 980, 1018, 1116, 980, 1009, 1027, 985, 1051, 1018]\n",
"mean: 0.0803365959696 error: 0.00276978212745\n",
"-------------------------------------------\n",
"Parameters: (4.7155157625675201, 4.4394240379333496, -6.5980353355407715)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1065, 1032, 966, 1065, 980, 1070, 990, 976, 995, 1009]\n",
"mean: 0.0808378973177 error: 0.00286063093731\n",
"-------------------------------------------\n",
"Parameters: (4.6961103479067479, 4.3839312374591826, -6.6530189633369439)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1145, 985, 1037, 1023, 938, 920, 995, 1018, 1051, 1018]\n",
"mean: 0.0811386403979 error: 0.00442349971249\n",
"-------------------------------------------\n",
"Parameters: (4.6896418763531571, 4.4764192382494619, -6.5338877697785698)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1187, 1018, 1009, 1009, 1051, 966, 1023, 971, 1116, 1018]\n",
"mean: 0.0792933918745 error: 0.00435711181058\n",
"-------------------------------------------\n",
"Parameters: (4.652987204216144, 4.445589904652703, -6.5461063537332738)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [1712, 1562, 1562, 1552, 1538, 1529, 1637, 1913, 1515, 1501]\n",
"mean: 0.0513881726983 error: 0.003269149523\n",
"-------------------------------------------\n",
"Parameters: (4.6274726775325368, 4.4959444828607431, -6.534396877443351)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",
"maxits: [948, 990, 1009, 1013, 999, 1051, 1023, 1027, 1074, 999]\n",
"mean: 0.080928791469 error: 0.00249355210214\n",
"-------------------------------------------\n",
"Parameters: (4.6862279608109851, 4.4327443489873861, -6.5718162908046338)\n",
"2.57628226191 2.60599204986\n",
"FWHMxs: [0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02]\n",