Commit cefecdf7 authored by Daniel Brown's avatar Daniel Brown
Browse files

Merge branch 'master' of gitmaster.atlas.aei.uni-hannover.de:pykat/pykat

parents 35a3040f 0112f5dc
......@@ -56,13 +56,14 @@ class photodiode(Detector):
if values==None:
values = []
list.__init__(self,[SIfloat(value) for value in values])
"""
def __setitem__(self, key, value):
list.__setitem__(self,key, SIfloat(value))
def append(self, value):
list.append(self,SIfloat(value))
"""
### todo add append with SIfloat
class __Phi(list):
......@@ -82,13 +83,13 @@ class photodiode(Detector):
return list.__getitem__(self,key)
else:
return float(list.__getitem__(self,key))
"""
def __setitem__(self,key,value):
list.__setitem__(self,key, self.__convertValue(value))
def append(self, value):
list.append(self,self.__convertValue(value))
"""
### todo add append with convertValue
......@@ -157,18 +158,17 @@ class photodiode(Detector):
#raise NotImplementedError("This function is not implemented")
def getFinesseText(self) :
print "a"
if self.enabled:
print "b"
rtn = []
__f_phi=range(len(self.f)+len(self.phi))
__f_phi[::2]=self.f
__f_phi[1::2]=self.phi
__f_phi_str = " ".join(map(str, __f_phi))
if self._alternate_beam:
rtn.append("pd{0}{1} {2} {3} {4}".format(self.sensype, self.num_demods, __f_phi, self.name, self.node.name))
rtn.append("pd{0}{1} {2} {3} {4}".format(self.senstype, self.num_demods, self.name, __f_phi_str, self.node.name))
else:
rtn.append("pd{0}{1} {2} {3} {4}*".format(self.senstype, self.num_demods, __f_phi, self.name, self.node.name))
rtn.append("pd{0}{1} {2} {3} {4}*".format(self.senstype, self.num_demods, self.name, __f_phi_str, self.node.name))
if self.noplot:
rtn.append("noplot {0}".format(self.name))
......
......@@ -79,6 +79,7 @@ class kat(object):
def __init__(self, kat_file=None, kat_code=None, katdir="", katname="", tempdir=None, tempname=None):
self.scene = None # scene object for GUI
self.verbose = True
self.__blocks = {} # dictionary of blocks that are used
self.__components = {} # dictionary of optical components
self.__detectors = {} # dictionary of detectors
......@@ -206,7 +207,8 @@ class kat(object):
elif(first == "gauss" or first == "gauss*" or first == "gauss**"):
after_process.append(line)
else:
print "Parsing `{0}` into pykat object not implemented yet, added as extra line.".format(line)
if self.verbose:
print "Parsing `{0}` into pykat object not implemented yet, added as extra line.".format(line)
obj = line
# manually add the line to the block contents
self.__blocks[self.__currentTag].contents.append(line)
......@@ -273,7 +275,8 @@ class kat(object):
cmd.append('--no-backspace')
cmd.append(katfile.name)
print cmd
if self.verbose:
print cmd
p=subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
err = ""
......
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