Ejemplo n.º 1
0
    def __init__(self, dimNames, data, m):
        """Initialise a uniform profile.

        Args:
            dimNames: see function
            data (DataContainer) - DataContainer with
                 - magnitude (Av0)
                 - grid
            m (real) - power for H/H0
        """
        FunctionBase.__init__(self, dimNames)
        self.m = m
        self.data = data
        self.H0 = self.data.v('grid', 'low', 'z', x=0) - self.data.v(
            'grid', 'high', 'z', x=0)

        # change grid to remove z dimension
        self.data.data['grid'] = copy.copy(self.data.data['grid'])
        self.data.data['grid']['dimensions'] = dimNames
        if 'f' in dimNames:
            self.data.data['grid']['axis'] = copy.copy(
                self.data.data['grid']['axis'])

            lenf = self.data.data['grid']['axis']['f'].shape[-1]
            self.data.data['grid']['axis']['f'] = self.data.data['grid'][
                'axis']['f'].reshape(1, lenf)
            self.data.data['grid']['contraction'] = np.asarray([[0, 0], [0,
                                                                         0]])
        return
Ejemplo n.º 2
0
    def __init__(self, dimNames, data):
        FunctionBase.__init__(self, dimNames)
        self.C0 = float(data.v('C0'))

        # call checkVariables method of FunctionBase to make sure that the input is correct
        FunctionBase.checkVariables(self, ('C0', self.C0))
        return
Ejemplo n.º 3
0
 def __init__(self, dimNames, data):
     FunctionBase.__init__(self, dimNames)
     self.L = float(data.v('L'))
     self.C1 = np.array(data.v('C1'))
     self.C2 = np.array(data.v('C2'))
     FunctionBase.checkVariables(self, ('L', self.L), ('C1', self.C1), ('C2', self.C2))
     return
Ejemplo n.º 4
0
 def __init__(self, dimNames, data):
     FunctionBase.__init__(self, dimNames)
     self.L = float(data.v('L'))
     self.C0 = float(data.v('C0'))
     self.CL = float(data.v('CL'))
     FunctionBase.checkVariables(self, ('C0', self.C0), ('CL', self.CL),
                                 ('L', self.L))
     return
Ejemplo n.º 5
0
 def __init__(self, dimNames, data):
     FunctionBase.__init__(self, dimNames)
     self.L = float(data.v('L'))
     self.alpha = float(data.v('alpha'))
     self.beta = float(data.v('beta'))
     self.gamma = float(data.v('gamma'))
     self.xc = float(data.v('xc'))
     self.xl = float(data.v('xl'))
     FunctionBase.checkVariables(self, ('alpha', self.alpha),
                                 ('beta', self.beta), ('xc', self.xc),
                                 ('xl', self.xl), ('L', self.L))
     return
Ejemplo n.º 6
0
    def __init__(self, dimNames, data):
        FunctionBase.__init__(self, dimNames)
        self.L = float(data.v('L'))
        self.C0 = data.v('C0')
        self.C1 = data.v('C1')
        self.xc = float(data.v('xc'))
        self.xl = float(data.v('xl'))

        # call checkVariables method of FunctionBase to make sure that the input is correct
        FunctionBase.checkVariables(self, ('C0', self.C0), ('C1', self.C1),
                                    ('xc', self.xc), ('xl', self.xl),
                                    ('L', self.L))
        return
Ejemplo n.º 7
0
    def __init__(self, dimNames, data):
        FunctionBase.__init__(self, dimNames)
        self.L = float(data.v('L'))
        self.C = np.array(data.v('C'))
        self.XL = float(np.array(data.v('XL')))
        FunctionBase.checkVariables(self, ('C', self.C), ('XL', self.XL),
                                    ('L', self.L))

        # coefficients for the linear function
        self.C_lin = np.asarray([
            np.polyval(np.polyder(self.C), self.XL),
            np.polyval(self.C, self.XL)
        ])
        return
Ejemplo n.º 8
0
    def __init__(self, dimNames, data, m):
        """Initialise a uniform profile with x dependency via H/H0

        Args:
            dimNames: see function
            data (DataContainer) - DataContainer with
                 - magnitude (Av0)
                 - grid
            m (real) - power for H/H0
        """
        FunctionBase.__init__(self, dimNames)
        self.m = m
        self.data = data
        self.H0 = self.data.v('grid', 'low', 'z', x=0) - self.data.v('grid', 'high', 'z', x=0)
        return
Ejemplo n.º 9
0
    def __init__(self, dimNames, data, m):
        """Initialise a parabolic profile.

        Args:
            dimNames: see function
            coef (complex array) - needs to be a real/complex array in shape (x,1,f) (length of x may be 1)
            data (DataContainer) - DataContainer with
                 - roughness (z0*)
                 - roughness (zs*)
                 - magnitude (coef)
                 - grid
            m (real) - power for H/H0

        """
        FunctionBase.__init__(self, dimNames)
        self.data = data
        self.m = m
        self.H0 = self.data.v('grid', 'low', 'z', x=0) - self.data.v(
            'grid', 'high', 'z', x=0)

        return
Ejemplo n.º 10
0
 def __init__(self, input):
     self.__input = input
     FunctionBase.__init__(self, ['x', 'f'])
     return
Ejemplo n.º 11
0
 def __init__(self, dimNames, data):
     FunctionBase.__init__(self, dimNames)
     self.H = data
     return
Ejemplo n.º 12
0
 def __init__(self, dimNames, data):
     FunctionBase.__init__(self, dimNames)
     self.L = float(data.v('L'))
     self.C = np.array(ny.toList(data.v('C')))
     FunctionBase.checkVariables(self, ('C', self.C), ('L', self.L))
     return