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

small bugg fixes

parent eeafde1e
...@@ -139,7 +139,6 @@ def measure(devices, devices2measure = 'all'): ...@@ -139,7 +139,6 @@ def measure(devices, devices2measure = 'all'):
import time import time
t = time.time() t = time.time()
data['measure'][device_name] = device.measure() data['measure'][device_name] = device.measure()
print (device_name,' measured')
print (device_name,' measure time: ',time.time() - t) print (device_name,' measure time: ',time.time() - t)
return data return data
......
...@@ -21,7 +21,6 @@ import socket ...@@ -21,7 +21,6 @@ import socket
class DRS4: class DRS4:
def __init__(self, config): def __init__(self, config):
caput('FIN-LSCP-DRS1:FLAG_GAIN',1) caput('FIN-LSCP-DRS1:FLAG_GAIN',1)
self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.set_config(config) self.set_config(config)
def set_config(self, config): def set_config(self, config):
...@@ -64,16 +63,4 @@ class DRS4: ...@@ -64,16 +63,4 @@ class DRS4:
def getTriggerMode(self): def getTriggerMode(self):
return caget('FIN-LSCP-DRS1:TRIG_MODE') return caget('FIN-LSCP-DRS1:TRIG_MODE')
#def trigger(self):
# self.socket.sendto('drsstart\n'.encode(), ('wd017.psi.ch', 3000))
#def measure(self):
# import time
# time.sleep(self.delay)
# self.trigger()
# import datetime
# time = str(datetime.datetime.now()).replace(':','-').replace(' ','_')
# measurement = {'time': time}
# return measurement
\ No newline at end of file
...@@ -107,7 +107,7 @@ class plot_config_tool: ...@@ -107,7 +107,7 @@ class plot_config_tool:
self.widget = self.cb self.widget = self.cb
else: else:
self.widget = widgets.HTML('Type '+str(np.dtype(type(value)))+' not history plottalbe') self.widget = widgets.HTML(variable_name+' not history plottalbe ('+str(np.dtype(type(value)))+')')
def change_bool(self, new): def change_bool(self, new):
self.plot_config[self.variable_name] = new['new'] self.plot_config[self.variable_name] = new['new']
...@@ -242,7 +242,7 @@ def main(devices, io, parallel = False): ...@@ -242,7 +242,7 @@ def main(devices, io, parallel = False):
vb_config.children = [bt_refresh, tab] vb_config.children = [bt_refresh, tab]
bt_refresh.on_click(refresh) bt_refresh.on_click(refresh)
display(widgets.HTML('<b><br>Plot measure configuration</b>')) display(widgets.HTML('<b><br>Plot measurement configuration</b>'))
bt_plot_config_init = widgets.Button(description='Measure to initialize') bt_plot_config_init = widgets.Button(description='Measure to initialize')
global plot_config global plot_config
plot_config = {} plot_config = {}
...@@ -256,7 +256,6 @@ def main(devices, io, parallel = False): ...@@ -256,7 +256,6 @@ def main(devices, io, parallel = False):
devices2measure = find_devices2measure() devices2measure = find_devices2measure()
print (devices2measure)
measurement = dm.measure(devices2measure) measurement = dm.measure(devices2measure)
global plot_config global plot_config
plot_config = {} plot_config = {}
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": 20,
"metadata": { "metadata": {
"hideCode": false, "hideCode": false,
"hidePrompt": false "hidePrompt": false
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
"traceback": [ "traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mFtdiError\u001b[0m Traceback (most recent call last)", "\u001b[0;31mFtdiError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-5-85a132f2e043>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 15\u001b[0m 'sync_camera': False}\n\u001b[1;32m 16\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 17\u001b[0;31m \u001b[0mper\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mPeriscope\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mper_config\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhome\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;32m<ipython-input-20-85a132f2e043>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 15\u001b[0m 'sync_camera': False}\n\u001b[1;32m 16\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 17\u001b[0;31m \u001b[0mper\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mPeriscope\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mper_config\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhome\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/home/data/lwfaserver/Devices/Periscope.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, config, home)\u001b[0m\n\u001b[1;32m 32\u001b[0m \u001b[0mtime\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0.01\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 33\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 34\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconnect_motors\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 35\u001b[0m \u001b[0mprint\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m'Connnection with motors sucessful!'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mexcept\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/home/data/lwfaserver/Devices/Periscope.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, config, home)\u001b[0m\n\u001b[1;32m 32\u001b[0m \u001b[0mtime\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0.01\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 33\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 34\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconnect_motors\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 35\u001b[0m \u001b[0mprint\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m'Connnection with motors sucessful!'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 36\u001b[0m \u001b[0;32mexcept\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/home/data/lwfaserver/Devices/Periscope.py\u001b[0m in \u001b[0;36mconnect_motors\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 108\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 109\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mconnect_motors\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 110\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mMz\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mZ825B\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m83829619\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m#Z825B(83835879)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 111\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mPz\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mZ825B\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m83832249\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 112\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mPy\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mZ825B\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m83832219\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/home/data/lwfaserver/Devices/Periscope.py\u001b[0m in \u001b[0;36mconnect_motors\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 108\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 109\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mconnect_motors\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 110\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mMz\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mZ825B\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m83829619\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m#Z825B(83835879)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 111\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mPz\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mZ825B\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m83832249\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 112\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mPy\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mZ825B\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m83832219\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/home/data/pyAPT/pyAPT/z825b.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 7\u001b[0m \"\"\"\n\u001b[1;32m 8\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 9\u001b[0;31m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mZ825B\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 10\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 11\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/home/data/pyAPT/pyAPT/z825b.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 7\u001b[0m \"\"\"\n\u001b[1;32m 8\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 9\u001b[0;31m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mZ825B\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 10\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 11\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
...@@ -626,7 +626,7 @@ ...@@ -626,7 +626,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 14, "execution_count": 21,
"metadata": { "metadata": {
"collapsed": true, "collapsed": true,
"hideCode": false, "hideCode": false,
...@@ -637,7 +637,7 @@ ...@@ -637,7 +637,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"devices = [delay,inter,laser, drs, fara]#, per]#, focus]#, per]#, blade] #use this to run the LWFA\n", "devices = [delay,inter,laser, drs, fara, blade]#, per]#, focus]#, per]#, blade] #use this to run the LWFA\n",
"#devices = [td1, td2,fara]#, inter]\n", "#devices = [td1, td2,fara]#, inter]\n",
"#devices = [ para, laser, focus] #use this to do focus optimization\n", "#devices = [ para, laser, focus] #use this to do focus optimization\n",
"#devices = [td1, td2]#, delay]#, inter] #Use this do debug the gui and data menager\n", "#devices = [td1, td2]#, delay]#, inter] #Use this do debug the gui and data menager\n",
...@@ -647,7 +647,7 @@ ...@@ -647,7 +647,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 15, "execution_count": 22,
"metadata": { "metadata": {
"hideCode": false, "hideCode": false,
"hidePrompt": false, "hidePrompt": false,
...@@ -658,55 +658,14 @@ ...@@ -658,55 +658,14 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"DelayGenerator config time: 0.003587961196899414\n", "DelayGenerator config time: 0.0025169849395751953\n",
"Interferometer config time: 0.0007643699645996094\n", "Interferometer config time: 0.0005269050598144531\n",
"Laser config time: 0.0026557445526123047\n", "Laser config time: 0.0014438629150390625\n",
"DRS4 config time: 0.0018012523651123047\n", "DRS4 config time: 0.001211404800415039\n",
"FaradayCup config time: 1.0251998901367188e-05\n", "FaradayCup config time: 3.337860107421875e-06\n",
"DelayGenerator measured\n", "BladePositioning config time: 0.6026744842529297\n",
"DelayGenerator measure time: 0.0010149478912353516\n", "DelayGenerator measure time: 0.0002646446228027344\n",
"Interferometer measured\n", "Interferometer measure time: 0.2594449520111084\n",
"Interferometer measure time: 0.26818370819091797\n",
"http://localhost:5006/?bokeh-session-id=Interferometer_Image\n"
]
},
{
"data": {
"text/html": [
"<script type='text/javascript'>window.open('http://localhost:5006/?bokeh-session-id=Interferometer_Image', '_blank','width=500, height=500');</script>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"http://localhost:5006/?bokeh-session-id=Interferometer_Phase\n"
]
},
{
"data": {
"text/html": [
"<script type='text/javascript'>window.open('http://localhost:5006/?bokeh-session-id=Interferometer_Phase', '_blank','width=500, height=500');</script>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/data/lwfaserver/Devices/InterferometerTools/routines.py:207: RuntimeWarning: divide by zero encountered in true_divide\n",
" return np.exp(-1./x**2*(6.*(x[1]-x[0]))**2)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"maximal possible rate: 0.5\n", "maximal possible rate: 0.5\n",
"set rate cannot be reached.\n" "set rate cannot be reached.\n"
] ]
......
No preview for this file type
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