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
z0: offset of z to fit blade edge
x0: offset of x to fit blade edge
ExposureTimeAbs: exposure time in us
BitsOfImage: 8 or 12 (8 if you want to do fast images, for tomography use 12!)
TriggerMode: On/Off
Tomography: boolean
take_data: boolean
......@@ -68,7 +69,7 @@ class Interferometer:
def set_config(self,config):
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['TriggerMode']=config['TriggerMode']
self.xmin, self.xmax, self.zmin, self.zmax = (config['xmin'], config['xmax'],
......@@ -84,6 +85,7 @@ class Interferometer:
config = {}
config['ExposureTimeAbs'] = self.cam.properties['ExposureTimeAbs']
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['x0'], config['z0'] = (self.x0, self.z0)
config['Tomography'] = self.Tomography
......
......@@ -103,8 +103,8 @@ class Periscope:
self.ymin = 0
self.xmax = 0
self.ymax = 25
self.zmax = min((25 + min((self.deltaz_Mz, self.deltaz_Cz)), 25))
self.zmin = max((max((self.deltaz_Mz, self.deltaz_Cz)), 0))
self.zmax = min((25 + self.deltaz_Mz, 25))
self.zmin = max((self.deltaz_Mz, 0))
def connect_motors(self):
self.Mz = Z825B(83829619) #Z825B(83835879)
......
......@@ -35,20 +35,20 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"best configuration (rotary stage error) loaded\n"
"vacuum and stage problems solved loaded\n"
]
}
],
"source": [
"import DataManager as dm\n",
"io = dm.IO('Data/EXP270617/')\n",
"io = dm.IO('Data/EXP040717/')\n",
"\n",
"\n",
"config = io.load(-1)\n",
......@@ -178,7 +178,7 @@
{
"data": {
"text/plain": [
"{'time': '2017-06-27_15-53-47.628620'}"
"{'time': '2017-07-04_14-16-36.977481'}"
]
},
"execution_count": 4,
......@@ -300,7 +300,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {
"hideCode": false,
"hidePrompt": false
......@@ -350,7 +350,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 29,
"metadata": {
"hideCode": false,
"hidePrompt": false,
......@@ -362,10 +362,10 @@
"output_type": "stream",
"text": [
"find rot. ref.\n",
"R 0.0\n",
"R 360.0\n",
"rot. ref. done\n",
"find lin. ref.\n",
"L 0.0\n",
"L -0.0\n",
"lin. ref. done\n"
]
}
......@@ -441,6 +441,7 @@
" 'x0': 4.,\n",
" 'z0': 10.5,\n",
" 'ExposureTimeAbs':35,\n",
" 'BitsOfImage':8\n",
" 'TriggerMode':'On',\n",
" 'rescale':5,\n",
" 'Tomography': False,\n",
......@@ -487,7 +488,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 8,
"metadata": {},
"outputs": [
{
......@@ -496,8 +497,8 @@
"text": [
"connecting camera\n",
"available cameras:\n",
"<DeviceInfo Basler avA2300-25gmDSY (21547524)>\n",
"<DeviceInfo Basler scA1400-17gm (21145133)>\n",
"<DeviceInfo Basler avA2300-25gmDSY (21547524)>\n",
"camera found =) Be happy\n",
"done\n"
]
......@@ -519,7 +520,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 10,
"metadata": {
"collapsed": true
},
......@@ -530,7 +531,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 11,
"metadata": {
"collapsed": true
},
......@@ -551,7 +552,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 12,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -582,7 +583,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 13,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -615,7 +616,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 14,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -647,7 +648,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 2,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -673,7 +674,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 9,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -685,7 +686,7 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"io = dm.IO('Data/EXP280617/')\n",
"io = dm.IO('Data/EXP040717/')\n",
"\n",
"\n",
"import GUI"
......@@ -693,7 +694,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 12,
"metadata": {
"collapsed": true,
"hideCode": false,
......@@ -710,8 +711,8 @@
"\n",
"#devices = [para, laser]#, delay]#, inter] #Use this do debug the gui and data menager\n",
"#devices = [laser, drs]\n",
"devices = [delay, inter, per, para, plasmacam, laser, fara]\n",
"\n",
"#devices = [td1,td2]\n",
"devices = [per, plasmacam]\n",
"#devices = [delay, inter, blade]\n",
"#devices = [plasmacam]\n",
"#devices = [focus, para]"
......@@ -719,7 +720,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 13,
"metadata": {
"hideCode": false,
"hidePrompt": false,
......@@ -730,22 +731,28 @@
"name": "stdout",
"output_type": "stream",
"text": [
"DelayGenerator config time: 0.0026977062225341797\n",
"Interferometer config time: 0.0007109642028808594\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",
"FaradayCup config time: 6.67572021484375e-06\n",
"DelayGenerator measure time: 0.00040650367736816406\n",
"Laser measure time: 0.0021486282348632812\n",
"FaradayCup measure time: 0.002347230911254883\n",
"maximal possible rate: 12.2\n"
"Periscope config time: 0.04131889343261719\n",
"PlasmaCamHorizontal config time: 0.002178192138671875\n"
]
},
{
"ename": "RuntimeError",
"evalue": "Unknown exception",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\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": [
"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