Commit 4a73267c authored by Nick Sauerwein's avatar Nick Sauerwein
Browse files

before optimizer

parent a2fb5eb6
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -32,6 +32,7 @@ zmin: minimal z in mm ...@@ -32,6 +32,7 @@ zmin: minimal z in mm
z0: offset of z to fit blade edge z0: offset of z to fit blade edge
x0: offset of x to fit blade edge x0: offset of x to fit blade edge
ExposureTimeAbs: exposure time in us ExposureTimeAbs: exposure time in us
BitsOfImage: 8 or 12 (8 if you want to do fast images, for tomography use 12!)
TriggerMode: On/Off TriggerMode: On/Off
Tomography: boolean Tomography: boolean
take_data: boolean take_data: boolean
...@@ -68,7 +69,7 @@ class Interferometer: ...@@ -68,7 +69,7 @@ class Interferometer:
def set_config(self,config): def set_config(self,config):
self.take_data = config['take_data'] self.take_data = config['take_data']
self.cam.properties['PixelFormat'] = 'Mono12' self.cam.properties['PixelFormat'] = 'Mono'+str(config['BitsOfImage'])
self.cam.properties['ExposureTimeAbs']=config['ExposureTimeAbs'] self.cam.properties['ExposureTimeAbs']=config['ExposureTimeAbs']
self.cam.properties['TriggerMode']=config['TriggerMode'] self.cam.properties['TriggerMode']=config['TriggerMode']
self.xmin, self.xmax, self.zmin, self.zmax = (config['xmin'], config['xmax'], self.xmin, self.xmax, self.zmin, self.zmax = (config['xmin'], config['xmax'],
...@@ -84,6 +85,7 @@ class Interferometer: ...@@ -84,6 +85,7 @@ class Interferometer:
config = {} config = {}
config['ExposureTimeAbs'] = self.cam.properties['ExposureTimeAbs'] config['ExposureTimeAbs'] = self.cam.properties['ExposureTimeAbs']
config['TriggerMode'] = self.cam.properties['TriggerMode'] config['TriggerMode'] = self.cam.properties['TriggerMode']
config['BitsOfImage'] = int(self.cam.properties['PixelFormat'][4:])
config['xmin'], config['xmax'],config['zmin'], config['zmax']= (self.xmin, self.xmax, self.zmin, self.zmax) config['xmin'], config['xmax'],config['zmin'], config['zmax']= (self.xmin, self.xmax, self.zmin, self.zmax)
config['x0'], config['z0'] = (self.x0, self.z0) config['x0'], config['z0'] = (self.x0, self.z0)
config['Tomography'] = self.Tomography config['Tomography'] = self.Tomography
......
...@@ -103,8 +103,8 @@ class Periscope: ...@@ -103,8 +103,8 @@ class Periscope:
self.ymin = 0 self.ymin = 0
self.xmax = 0 self.xmax = 0
self.ymax = 25 self.ymax = 25
self.zmax = min((25 + min((self.deltaz_Mz, self.deltaz_Cz)), 25)) self.zmax = min((25 + self.deltaz_Mz, 25))
self.zmin = max((max((self.deltaz_Mz, self.deltaz_Cz)), 0)) self.zmin = max((self.deltaz_Mz, 0))
def connect_motors(self): def connect_motors(self):
self.Mz = Z825B(83829619) #Z825B(83835879) self.Mz = Z825B(83829619) #Z825B(83835879)
......
...@@ -35,20 +35,20 @@ ...@@ -35,20 +35,20 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 6,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"best configuration (rotary stage error) loaded\n" "vacuum and stage problems solved loaded\n"
] ]
} }
], ],
"source": [ "source": [
"import DataManager as dm\n", "import DataManager as dm\n",
"io = dm.IO('Data/EXP270617/')\n", "io = dm.IO('Data/EXP040717/')\n",
"\n", "\n",
"\n", "\n",
"config = io.load(-1)\n", "config = io.load(-1)\n",
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"{'time': '2017-06-27_15-53-47.628620'}" "{'time': '2017-07-04_14-16-36.977481'}"
] ]
}, },
"execution_count": 4, "execution_count": 4,
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 7,
"metadata": { "metadata": {
"hideCode": false, "hideCode": false,
"hidePrompt": false "hidePrompt": false
...@@ -350,7 +350,7 @@ ...@@ -350,7 +350,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 26, "execution_count": 29,
"metadata": { "metadata": {
"hideCode": false, "hideCode": false,
"hidePrompt": false, "hidePrompt": false,
...@@ -362,10 +362,10 @@ ...@@ -362,10 +362,10 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"find rot. ref.\n", "find rot. ref.\n",
"R 0.0\n", "R 360.0\n",
"rot. ref. done\n", "rot. ref. done\n",
"find lin. ref.\n", "find lin. ref.\n",
"L 0.0\n", "L -0.0\n",
"lin. ref. done\n" "lin. ref. done\n"
] ]
} }
...@@ -441,6 +441,7 @@ ...@@ -441,6 +441,7 @@
" 'x0': 4.,\n", " 'x0': 4.,\n",
" 'z0': 10.5,\n", " 'z0': 10.5,\n",
" 'ExposureTimeAbs':35,\n", " 'ExposureTimeAbs':35,\n",
" 'BitsOfImage':8\n",
" 'TriggerMode':'On',\n", " 'TriggerMode':'On',\n",
" 'rescale':5,\n", " 'rescale':5,\n",
" 'Tomography': False,\n", " 'Tomography': False,\n",
...@@ -487,7 +488,7 @@ ...@@ -487,7 +488,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13, "execution_count": 8,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -496,8 +497,8 @@ ...@@ -496,8 +497,8 @@
"text": [ "text": [
"connecting camera\n", "connecting camera\n",
"available cameras:\n", "available cameras:\n",
"<DeviceInfo Basler avA2300-25gmDSY (21547524)>\n",
"<DeviceInfo Basler scA1400-17gm (21145133)>\n", "<DeviceInfo Basler scA1400-17gm (21145133)>\n",
"<DeviceInfo Basler avA2300-25gmDSY (21547524)>\n",
"camera found =) Be happy\n", "camera found =) Be happy\n",
"done\n" "done\n"
] ]
...@@ -519,7 +520,7 @@ ...@@ -519,7 +520,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 14, "execution_count": 10,
"metadata": { "metadata": {
"collapsed": true "collapsed": true
}, },
...@@ -530,7 +531,7 @@ ...@@ -530,7 +531,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 15, "execution_count": 11,
"metadata": { "metadata": {
"collapsed": true "collapsed": true
}, },
...@@ -551,7 +552,7 @@ ...@@ -551,7 +552,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 16, "execution_count": 12,
"metadata": { "metadata": {
"collapsed": true, "collapsed": true,
"hideCode": false, "hideCode": false,
...@@ -582,7 +583,7 @@ ...@@ -582,7 +583,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 17, "execution_count": 13,
"metadata": { "metadata": {
"collapsed": true, "collapsed": true,
"hideCode": false, "hideCode": false,
...@@ -615,7 +616,7 @@ ...@@ -615,7 +616,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 18, "execution_count": 14,
"metadata": { "metadata": {
"collapsed": true, "collapsed": true,
"hideCode": false, "hideCode": false,
...@@ -647,7 +648,7 @@ ...@@ -647,7 +648,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 19, "execution_count": 2,
"metadata": { "metadata": {
"collapsed": true, "collapsed": true,
"hideCode": false, "hideCode": false,
...@@ -673,7 +674,7 @@ ...@@ -673,7 +674,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 29, "execution_count": 9,
"metadata": { "metadata": {
"collapsed": true, "collapsed": true,
"hideCode": false, "hideCode": false,
...@@ -685,7 +686,7 @@ ...@@ -685,7 +686,7 @@
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"import numpy as np\n", "import numpy as np\n",
"\n", "\n",
"io = dm.IO('Data/EXP280617/')\n", "io = dm.IO('Data/EXP040717/')\n",
"\n", "\n",
"\n", "\n",
"import GUI" "import GUI"
...@@ -693,7 +694,7 @@ ...@@ -693,7 +694,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 33, "execution_count": 12,
"metadata": { "metadata": {
"collapsed": true, "collapsed": true,
"hideCode": false, "hideCode": false,
...@@ -710,8 +711,8 @@ ...@@ -710,8 +711,8 @@
"\n", "\n",
"#devices = [para, laser]#, 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 = [laser, drs]\n",
"devices = [delay, inter, per, para, plasmacam, laser, fara]\n", "#devices = [td1,td2]\n",
"\n", "devices = [per, plasmacam]\n",
"#devices = [delay, inter, blade]\n", "#devices = [delay, inter, blade]\n",
"#devices = [plasmacam]\n", "#devices = [plasmacam]\n",
"#devices = [focus, para]" "#devices = [focus, para]"
...@@ -719,7 +720,7 @@ ...@@ -719,7 +720,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 34, "execution_count": 13,
"metadata": { "metadata": {
"hideCode": false, "hideCode": false,
"hidePrompt": false, "hidePrompt": false,
...@@ -730,22 +731,28 @@ ...@@ -730,22 +731,28 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"DelayGenerator config time: 0.0026977062225341797\n", "Periscope config time: 0.04131889343261719\n",
"Interferometer config time: 0.0007109642028808594\n", "PlasmaCamHorizontal config time: 0.002178192138671875\n"
"Periscope config time: 0.03913760185241699\n", ]
"ParabolicMirror config time: 0.014693737030029297\n", },
"PlasmaCamHorizontal config time: 0.0023813247680664062\n", {
"Laser config time: 0.0021207332611083984\n", "ename": "RuntimeError",
"FaradayCup config time: 6.67572021484375e-06\n", "evalue": "Unknown exception",
"DelayGenerator measure time: 0.00040650367736816406\n", "output_type": "error",
"Laser measure time: 0.0021486282348632812\n", "traceback": [
"FaradayCup measure time: 0.002347230911254883\n", "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"maximal possible rate: 12.2\n" "\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/home/data/lwfaserver/GUI.py\u001b[0m in \u001b[0;36mmeasure\u001b[0;34m(bt, comment, name)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdraw_all\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mforce\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 382\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 383\u001b[0;31m \u001b[0mloop_measure\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 384\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 385\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/home/data/lwfaserver/GUI.py\u001b[0m in \u001b[0;36mloop_measure\u001b[0;34m(parallel, connec)\u001b[0m\n\u001b[1;32m 334\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 335\u001b[0m \u001b[0;31m#getting data from devices\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 336\u001b[0;31m \u001b[0mmeasurement\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmeasure\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevices\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdevices2measure\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdevices2measure\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 337\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 338\u001b[0m \u001b[0;31m#save data\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/home/data/lwfaserver/DataManager.py\u001b[0m in \u001b[0;36mmeasure\u001b[0;34m(devices, devices2measure)\u001b[0m\n\u001b[1;32m 143\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mtime\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 144\u001b[0m \u001b[0mt\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtime\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtime\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 145\u001b[0;31m \u001b[0mdata\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'measure'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mdevice_name\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmeasure\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 146\u001b[0m \u001b[0mprint\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mdevice_name\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m' measure time: '\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mtime\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtime\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0mt\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 147\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/home/data/lwfaserver/Devices/PlasmaCamHorizontal.py\u001b[0m in \u001b[0;36mmeasure\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[0mD\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 71\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mimg\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcam\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgrab_images\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 72\u001b[0m \u001b[0mD\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfliplr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 73\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32mPyPylon/cython/factory.pyx\u001b[0m in \u001b[0;36mgrab_images (cython/factory.cpp:5250)\u001b[0;34m()\u001b[0m\n",
"\u001b[0;31mRuntimeError\u001b[0m: Unknown exception"
] ]
} }
], ],
"source": [ "source": [
"GUI.main(devices, io)" "GUI.main(devices, io)\n"
] ]
}, },
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment