Commit 5a5c246a authored by Andreas Freise's avatar Andreas Freise
Browse files

making pykat read m1 and m2 correctly and addoing SIfloat ocnversion for

mirror params.
parent cefecdf7
......@@ -155,60 +155,61 @@ class mirror(Component):
self.__r_ap = float(r_ap)
self.__mass = float(mass)
self.__R = float(R)
self.__T = float(T)
self.__phi = float(phi)
self.__Rcx = float(Rcx)
self.__Rcy = float(Rcy)
self.__xbeta = float(xbeta)
self.__ybeta = float(ybeta)
self.__r_ap = SIfloat(r_ap)
self.__mass = SIfloat(mass)
self.__R = SIfloat(R)
self.__T = SIfloat(T)
self.__phi = SIfloat(phi)
self.__Rcx = SIfloat(Rcx)
self.__Rcy = SIfloat(Rcy)
self.__xbeta = SIfloat(xbeta)
self.__ybeta = SIfloat(ybeta)
def r_ap(self): return Param('r_ap', self.__r_ap)
def r_ap(self,value): self.__aperture = float(value)
def r_ap(self,value): self.__aperture = SIfloat(value)
def mass(self): return Param('mass', self.__mass)
def mass(self,value): self.__mass = float(value)
def mass(self,value): self.__mass = SIfloat(value)
def R(self): return Param('R', self.__R)
def R(self,value): self.__R = float(value)
def R(self,value): self.__R = SIfloat(value)
def T(self): return Param('T', self.__T)
def T(self,value): self.__T = float(value)
def T(self,value): self.__T = SIfloat(value)
def phi(self): return Param('phi', self.__phi)
def phi(self,value): self.__phi = float(value)
def phi(self,value): self.__phi = SIfloat(value)
def Rcx(self): return Param('Rcx', self.__Rcx)
def Rcx(self,value): self.__Rcx = float(value)
def Rcx(self,value): self.__Rcx = SIfloat(value)
def Rcy(self): return Param('Rcy', self.__Rcy)
def Rcy(self,value): self.__Rcy = float(value)
def Rcy(self,value): self.__Rcy = SIfloat(value)
def xbeta(self): return Param('xbeta', self.__xbeta)
def xbeta(self,value): self.__xbeta = float(value)
def xbeta(self,value): self.__xbeta = SIfloat(value)
def ybeta(self): return Param('ybeta', self.__ybeta)
def ybeta(self,value): self.__ybeta = float(value)
def ybeta(self,value): self.__ybeta = SIfloat(value)
def Rc(self):
......@@ -219,14 +220,14 @@ class mirror(Component):
def Rc(self,value):
self.Rcx = float(value)
self.Rcy = float(value)
self.Rcx = SIfloat(value)
self.Rcy = SIfloat(value)
def parseFinesseText(text):
values = text.split(" ")
if values[0] != "m":
if values[0] != "m" and values[0] != "m1" and values[0] != "m2":
raise exceptions.RuntimeError("'{0}' not a valid Finesse mirror command".format(text))
values.pop(0) # remove initial value
......@@ -234,8 +235,15 @@ class mirror(Component):
if len(values) != 6:
raise exceptions.RuntimeError("Mirror Finesse code format incorrect '{0}'".format(text))
return mirror(values[0], values[4], values[5], R=values[1], T=values[2], phi=values[3])
if len(values[0])==1:
return mirror(values[0], values[4], values[5], R=values[1], T=values[2], phi=values[3])
if values[0][1]==1:
return mirror(values[0], values[4], values[5], R=1.0-SIfloat(values[1])-SIfloat(values[2]), T=values[1], phi=values[3])
return mirror(values[0], values[4], values[5], R=values[1], T=1.0-SIfloat(values[1])-SIfloat(values[2]), phi=values[3])
def getFinesseText(self):
rtn = []
......@@ -194,7 +194,7 @@ class kat(object):
first = line.split(" ",1)[0]
obj = None
if(first == "m"):
if(first == "m" or first == "m1" or first == "m2"):
obj = pykat.components.mirror.parseFinesseText(line)
elif(first == "s"):
obj =
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