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

bokeh added

parent 3d58f75e
File mode changed from 100644 to 100755
......@@ -48,8 +48,9 @@ class Interferometer:
self.psize=1./127.95 #mm
self.mm=int(1./self.psize)
self.ep=1.74/self.psize
print ('connecting camera')
self.connect_camera()
print ('done')
self.set_config(config)
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
import numpy as np
import matplotlib.pyplot as plt
from Devices.PeriscopeTools.PyAPT import APTMotor
import sys
sys.path.append('../pyAPT/')
from pyAPT import Z825B
'''
config file:
......@@ -27,7 +29,7 @@ measurement file (n.a)
class Periscope:
def __init__(self, config, home = False):
import time
time.sleep(1)
time.sleep(0.01)
try:
self.connect_motors()
print ('Connnection with motors sucessful!')
......@@ -84,17 +86,17 @@ class Periscope:
return config
def get_position(self, kind = 'global'):
pos_g = np.array([-self.Px.getPos(), self.Py.getPos(), self.Pz.getPos()])
pos_g = np.array([-self.Px.position(), self.Py.position(), self.Pz.position()])
if kind == 'global':
return pos_g
if kind == 'local':
return pos_g - self.pos_local_origin_g
def get_deltaz_Mz(self):
return self.Pz.getPos() - 25 + self.Mz.getPos()
return self.Pz.position() - 25 + self.Mz.position()
def get_deltaz_Cz(self):
return self.Pz.getPos() - 25 + self.Cz.getPos()
return self.Pz.position() - 25 + self.Cz.position()
def set_bounds(self):
self.xmin = -25
......@@ -105,18 +107,18 @@ class Periscope:
self.zmin = max((max((self.deltaz_Mz, self.deltaz_Cz)), 0))
def connect_motors(self):
self.Mz = APTMotor(83835879, HWTYPE=31)
self.Pz = APTMotor(83832249, HWTYPE=31)
self.Py = APTMotor(83832219, HWTYPE=31)
self.Px = APTMotor(83835886, HWTYPE=31)
self.Cz = APTMotor(83829619, HWTYPE=31)
self.Mz = Z825B(83835879)
self.Pz = Z825B(83832249)
self.Py = Z825B(83832219)
self.Px = Z825B(83835886)
self.Cz = Z825B(83829619)
self.motors = [self.Px, self.Py, self.Pz, self.Mz, self.Cz]
def get_pos_motor(self):
return np.array([motor.getPos() for motor in self.motors])
def home(self):
for motor in self.motors:
motor.go_home()
motor.home()
def set_local_origin(self):
self.pos_local_origin_g = self.get_position()
self.pos_motor_local_origin = self.get_pos_motor()
......@@ -131,18 +133,18 @@ class Periscope:
assert (position_g[2] <= self.zmax),"z coordinate to high!"
def _mxRel(self, dx):
assert (self.Px.mRel(-dx)), 'Motor Px failed'
assert (self.Px.move(-dx)), 'Motor Px failed'
def _myRel(self, dy):
assert (self.Py.mRel(dy)), 'Motor Py failed'
assert (self.Py.move(dy)), 'Motor Py failed'
def _mzRel(self, dz):
assert (self.Pz.mRel(dz)), 'Motor Pz failed'
assert (self.Mz.mRel(-dz)), 'Motor Mz failed'
assert (self.Pz.move(dz)), 'Motor Pz failed'
assert (self.Mz.move(-dz)), 'Motor Mz failed'
def _mCamRel(self, dz):
assert (self.Cz.mRel(-dz)), 'Motor Cz failed'
assert (self.Cz.move(-dz)), 'Motor Cz failed'
def mRel(self, dpos, camera_sync = False):
dx, dy, dz = list(dpos)
......@@ -161,22 +163,22 @@ class Periscope:
self.position_g = [-Px.getPos(), Py.getPos(), Pz.getPos()]
def _mxAbs(self, x):
assert (self.Px.mAbs(-x)), 'Motor Px failed'
assert (self.Px.goto(-x)), 'Motor Px failed'
def _myAbs(self, y):
assert (self.Py.mAbs(y)), 'Motor Py failed'
assert (self.Py.goto(y)), 'Motor Py failed'
def _mzAbs(self, z):
deltaz = -self.deltaz_Mz
assert (self.Pz.mAbs(z)), 'Motor Pz failed'
assert (self.Mz.mAbs(25 - z - deltaz)), 'Motor Mz failed'
assert (self.Pz.goto(z)), 'Motor Pz failed'
assert (self.Mz.goto(25 - z - deltaz)), 'Motor Mz failed'
def _mCamAbs(self, z):
deltaz = -self.deltaz_Cz
assert (self.Cz.mAbs(25 - z - deltaz)), 'Motor Cz failed'
assert (self.Cz.goto(25 - z - deltaz)), 'Motor Cz failed'
def mAbs(self, pos_g, sync_camera = False):
......@@ -185,11 +187,14 @@ class Periscope:
x,y,z = list(pos_g)
if sync_camera:
print ('c')
self._mCamAbs(z)
print ('x')
self._mxAbs(x)
print ('y')
self._myAbs(y)
print ('z')
self._mzAbs(z)
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
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