diff --git a/pykat/commands.py b/pykat/commands.py index 7d3e716fc04c715a4a6d6db9d8f17bc896e6f6e2..05d52c6f4fe366e15ec5f62223c6c234baf35f2e 100644 --- a/pykat/commands.py +++ b/pykat/commands.py @@ -11,6 +11,7 @@ from components import * from structs import * from pykat.param import Param, putter import pykat.exceptions as pkex +from collections import namedtuple class Command(object): def __init__(self): @@ -71,7 +72,12 @@ class gauss(object): elif len(values) == 8: print "" - +class tf(Command): + fQ = namedtuple('fQ', 'f', 'Q') + + def __init__(self, name, poles, zeros): + pass + class xaxis(Command): """ The xaxis object is a unique object to each pykat.finesse.kat instance. It provides diff --git a/pykat/components.py b/pykat/components.py index 50897522d5f937727d889ec896e840ecf8b7789e..9a7a28749b583d81054571145af4ff0b5bdb7b42 100644 --- a/pykat/components.py +++ b/pykat/components.py @@ -155,7 +155,7 @@ class Component(object): class AbstractMirrorComponent(Component): __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) if (L != None and R != None and T != None) and SIfloat(R)+SIfloat(T)+SIfloat(L) != 1: @@ -179,6 +179,8 @@ class AbstractMirrorComponent(Component): 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.__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)) @property @@ -196,6 +198,16 @@ class AbstractMirrorComponent(Component): @mass.setter 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 def R(self): return self.__R @R.setter @@ -250,11 +262,11 @@ class AbstractMirrorComponent(Component): self.Rcy = value elif key in ["Rc", "ROC", "r", "rc", "roc"]: self.Rc = value - elif key in ["M, m, Mass, mass"]: + elif key in ["M","m", "Mass", "mass"]: self.mass = value - elif key in ["xbeta, xBeta"]: + elif key in ["xbeta", "xBeta"]: self.xbeta = value - elif key in ["ybeta, yBeta"]: + elif key in ["ybeta","yBeta"]: self.ybeta = value elif key in ["x_off"]: self.x_offset = value @@ -262,6 +274,10 @@ class AbstractMirrorComponent(Component): self.y_offset = value elif key in ["r_ap"]: self.r_ap = value + elif key in ["Ix","ix"]: + self.Ix = value + elif key in ["Iy","iy"]: + self.Iy = value else: return False @@ -331,7 +347,7 @@ class beamSplitter(AbstractMirrorComponent): self._requested_node_names.append(node3) self._requested_node_names.append(node4) - self.__alpha = AttrParam("alpha", self, SIfloat(alpha)) + self.__alpha = Param("alpha", self, SIfloat(alpha)) @property def alpha(self): return self.__alpha