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