Skip to content
Snippets Groups Projects
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
Branches
No related tags found
No related merge requests found
......@@ -57,12 +57,13 @@ class photodiode(Detector):
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,6 +207,7 @@ class kat(object):
elif(first == "gauss" or first == "gauss*" or first == "gauss**"):
after_process.append(line)
else:
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
......@@ -273,6 +275,7 @@ class kat(object):
cmd.append('--no-backspace')
cmd.append(katfile.name)
if self.verbose:
print cmd
p=subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
err = ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment