Skip to content
Snippets Groups Projects
Commit 3317e466 authored by Daniel Brown's avatar Daniel Brown
Browse files

fixes for mirror/bs components

parent 8f83578f
Branches
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ from components import * ...@@ -11,6 +11,7 @@ from components import *
from structs import * from structs import *
from pykat.param import Param, putter from pykat.param import Param, putter
import pykat.exceptions as pkex import pykat.exceptions as pkex
from collections import namedtuple
class Command(object): class Command(object):
def __init__(self): def __init__(self):
...@@ -71,6 +72,11 @@ class gauss(object): ...@@ -71,6 +72,11 @@ class gauss(object):
elif len(values) == 8: elif len(values) == 8:
print "" print ""
class tf(Command):
fQ = namedtuple('fQ', 'f', 'Q')
def __init__(self, name, poles, zeros):
pass
class xaxis(Command): class xaxis(Command):
""" """
......
...@@ -155,7 +155,7 @@ class Component(object): ...@@ -155,7 +155,7 @@ class Component(object):
class AbstractMirrorComponent(Component): class AbstractMirrorComponent(Component):
__metaclass__ = abc.ABCMeta __metaclass__ = abc.ABCMeta
def __init__(self, name, R=None, T=None, L=None, phi=0, Rcx=None, Rcy=None, xbeta=None, ybeta=None, mass=None, r_ap=None): def __init__(self, name, R=None, T=None, L=None, phi=0, Rcx=None, Rcy=None, xbeta=None, ybeta=None, mass=None, r_ap=None, Ix=None, Iy=None):
super(AbstractMirrorComponent, self).__init__(name) super(AbstractMirrorComponent, self).__init__(name)
if (L != None and R != None and T != None) and SIfloat(R)+SIfloat(T)+SIfloat(L) != 1: if (L != None and R != None and T != None) and SIfloat(R)+SIfloat(T)+SIfloat(L) != 1:
...@@ -179,6 +179,8 @@ class AbstractMirrorComponent(Component): ...@@ -179,6 +179,8 @@ class AbstractMirrorComponent(Component):
self.__xbeta = AttrParam("xbeta", self, SIfloat(xbeta), canFsig=True, fsig_name="x") self.__xbeta = AttrParam("xbeta", self, SIfloat(xbeta), canFsig=True, fsig_name="x")
self.__ybeta = AttrParam("ybeta", self, SIfloat(ybeta), canFsig=True, fsig_name="y") self.__ybeta = AttrParam("ybeta", self, SIfloat(ybeta), canFsig=True, fsig_name="y")
self.__mass = AttrParam("mass", self, SIfloat(mass)) self.__mass = AttrParam("mass", self, SIfloat(mass))
self.__Ix = AttrParam("Ix", self, SIfloat(Ix))
self.__Iy = AttrParam("Iy", self, SIfloat(Iy))
self.__r_ap = AttrParam("r_ap", self, SIfloat(r_ap)) self.__r_ap = AttrParam("r_ap", self, SIfloat(r_ap))
@property @property
...@@ -196,6 +198,16 @@ class AbstractMirrorComponent(Component): ...@@ -196,6 +198,16 @@ class AbstractMirrorComponent(Component):
@mass.setter @mass.setter
def mass(self,value): self.__mass.value = SIfloat(value) def mass(self,value): self.__mass.value = SIfloat(value)
@property
def Ix(self): return self.__Ix
@Ix.setter
def Ix(self,value): self.__Ix.value = SIfloat(value)
@property
def Iy(self): return self.__Iy
@Iy.setter
def Iy(self,value): self.__Iy.value = SIfloat(value)
@property @property
def R(self): return self.__R def R(self): return self.__R
@R.setter @R.setter
...@@ -250,11 +262,11 @@ class AbstractMirrorComponent(Component): ...@@ -250,11 +262,11 @@ class AbstractMirrorComponent(Component):
self.Rcy = value self.Rcy = value
elif key in ["Rc", "ROC", "r", "rc", "roc"]: elif key in ["Rc", "ROC", "r", "rc", "roc"]:
self.Rc = value self.Rc = value
elif key in ["M, m, Mass, mass"]: elif key in ["M","m", "Mass", "mass"]:
self.mass = value self.mass = value
elif key in ["xbeta, xBeta"]: elif key in ["xbeta", "xBeta"]:
self.xbeta = value self.xbeta = value
elif key in ["ybeta, yBeta"]: elif key in ["ybeta","yBeta"]:
self.ybeta = value self.ybeta = value
elif key in ["x_off"]: elif key in ["x_off"]:
self.x_offset = value self.x_offset = value
...@@ -262,6 +274,10 @@ class AbstractMirrorComponent(Component): ...@@ -262,6 +274,10 @@ class AbstractMirrorComponent(Component):
self.y_offset = value self.y_offset = value
elif key in ["r_ap"]: elif key in ["r_ap"]:
self.r_ap = value self.r_ap = value
elif key in ["Ix","ix"]:
self.Ix = value
elif key in ["Iy","iy"]:
self.Iy = value
else: else:
return False return False
...@@ -331,7 +347,7 @@ class beamSplitter(AbstractMirrorComponent): ...@@ -331,7 +347,7 @@ class beamSplitter(AbstractMirrorComponent):
self._requested_node_names.append(node3) self._requested_node_names.append(node3)
self._requested_node_names.append(node4) self._requested_node_names.append(node4)
self.__alpha = AttrParam("alpha", self, SIfloat(alpha)) self.__alpha = Param("alpha", self, SIfloat(alpha))
@property @property
def alpha(self): return self.__alpha def alpha(self): return self.__alpha
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment