Commit b5ed10f4 authored by Andreas Freise's avatar Andreas Freise
Browse files

some more errors with scale, maxtem and phase commands.

parent fa438397
......@@ -57,7 +57,7 @@ class xaxis(Command):
self.mx = putter("mx1")
if scale == "lin":
scale = cale.linear
scale = Scale.linear
elif scale == "log":
scale = Scale.logarithmic
elif isinstance(scale, str):
......
......@@ -302,8 +302,8 @@ class photodiode(Detector):
else:
rtn.append("pd{0}{1} {2} {3} {4}*".format(self.senstype, self.num_demods, self.name, __f_phi_str, self.node.name))
if self.scale !=1.0 and self.scale != None:
rtn.append("scale {0} {1}".format(self.name, self.scale))
if self.scale != None and self.scale !='':
rtn.append("scale {1} {0}".format(self.name, self.scale))
if self.noplot:
rtn.append("noplot {0}".format(self.name))
......
......@@ -182,7 +182,7 @@ class kat(object):
@property
def noxaxis(self): return self.__noxaxis
@noxaxis.setter
def noxaxis(self,value): self.__noxaxis = bool(value)
def noxaxis(self,value): self.__noxaxis = bool(value)
def logo(self):
print """ ..-
......@@ -256,7 +256,6 @@ class kat(object):
first = line.split(" ",1)[0]
obj = None
if(first == "m" or first == "m1" or first == "m2"):
obj = pykat.components.mirror.parseFinesseText(line)
elif(first == "s"):
......@@ -288,20 +287,25 @@ class kat(object):
elif(first == "phase"):
v = line.split(" ")
if len(v) != 2:
raise pkex.BasePyKatException("Phase command `{0}` is incorrect.".format(line))
raise pkex.BasePyKatException("phase command `{0}` is incorrect.".format(line))
else:
self.phase = int(v[1])
elif(first == "maxtem"):
v = line.split(" ")
if len(v) != 2:
raise pkex.BasePyKatException("maxtem command `{0}` is incorrect.".format(line))
else:
self.maxtem = int(v[1])
elif(first == "retrace"):
v = line.split(" ")
if len(v) > 2:
raise pkex.BasePyKatException("Retrace command `{0}` is incorrect.".format(line))
elif len(v) == 2:
self.retrace = v[1]
self.retrace = v[1]
elif(first == "deriv_h"):
v = line.split(" ")
if len(v) != 2:
raise pkex.BasePyKatException("Deriv_h command `{0}` is incorrect.".format(line))
raise pkex.BasePyKatException("deriv_h command `{0}` is incorrect.".format(line))
else:
self.deriv_h = float(v[1])
else:
......@@ -626,8 +630,8 @@ class kat(object):
if key != NO_BLOCK:
out.append("%%% FTend " + key + "\n")
if self.noxaxis != None and self.noxaxis == True:
if self.noxaxis == True:
out.append("noxaxis\n")
# now loop through all the nodes and get any gauss commands
......@@ -641,7 +645,7 @@ class kat(object):
out.append(txt + "\n")
if self.scale != None and self.scale !=1.0: out.append("scale {0}\n".format(self.scale))
if self.scale != None and self.scale !='': out.append("scale {0}\n".format(self.scale))
if self.phase != None: out.append("phase {0}\n".format(self.phase))
if self.maxtem != None: out.append("maxtem {0}\n".format(self.maxtem))
......
Supports Markdown
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