From b5ed10f44547e3277ae92a149c03c76e977598a4 Mon Sep 17 00:00:00 2001 From: Andreas Freise <adf@star.bham.ac.uk> Date: Tue, 7 Jan 2014 20:33:06 +0000 Subject: [PATCH] some more errors with scale, maxtem and phase commands. --- pykat/commands.py | 2 +- pykat/detectors.py | 4 ++-- pykat/finesse.py | 22 +++++++++++++--------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/pykat/commands.py b/pykat/commands.py index e90e507..27a3bda 100644 --- a/pykat/commands.py +++ b/pykat/commands.py @@ -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): diff --git a/pykat/detectors.py b/pykat/detectors.py index 1e0fae0..4f94cc9 100644 --- a/pykat/detectors.py +++ b/pykat/detectors.py @@ -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)) diff --git a/pykat/finesse.py b/pykat/finesse.py index cb839f1..bf1b2e3 100644 --- a/pykat/finesse.py +++ b/pykat/finesse.py @@ -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)) -- GitLab