mailr3768 - /branches/N_state_model/prompt/align_tensor.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on November 21, 2007 - 18:19:
Author: bugman
Date: Wed Nov 21 18:19:07 2007
New Revision: 3768

URL: http://svn.gna.org/viewcvs/relax?rev=3768&view=rev
Log:
Implemented the interface of the align_tensor.init() user function.


Modified:
    branches/N_state_model/prompt/align_tensor.py

Modified: branches/N_state_model/prompt/align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/prompt/align_tensor.py?rev=3768&r1=3767&r2=3768&view=diff
==============================================================================
--- branches/N_state_model/prompt/align_tensor.py (original)
+++ branches/N_state_model/prompt/align_tensor.py Wed Nov 21 18:19:07 2007
@@ -40,4 +40,70 @@
         self.__relax__ = relax
 
 
+    def init(self, params=None, param_types=0, errors=0):
+        """Function for initialising the alignment tensor.
 
+        Keyword Arguments
+        ~~~~~~~~~~~~~~~~~
+
+        params:  The alignment tensor data.
+
+        param_types:  A flag to select different parameter combinations.
+
+        errors:  A flag which determines if the alignment tensor data or its 
errors are being input.
+
+
+        Description
+        ~~~~~~~~~~~
+
+        Using this function, the alignment tensor data can be set up.  The 
params argument should be
+        a tuple of floating point numbers (a list surrounded by round 
brakets).  These correspond to
+        the parameters of the tensor, which can be specified by the 
param_types argument, where the
+        values correspond to
+
+            0:  (Szz, Sxx-yy, Sxy, Sxz, Syz)  (in units of Hertz),
+
+        (other formats may be implemented later).
+
+
+        Examples
+        ~~~~~~~~
+
+        To set a rhombic tensor to the run 'CaM', type one of:
+
+        relax> align_tensor.init((-8.6322e-05, -5.5786e-04, -3.1732e-05, 
2.2927e-05, 2.8599e-04))
+        relax> align_tensor.init((-8.6322e-05, -5.5786e-04, -3.1732e-05, 
2.2927e-05, 2.8599e-04), 0)
+        relax> align_tensor.init(params=(-8.6322e-05, -5.5786e-04, 
-3.1732e-05, 2.2927e-05,
+                                 2.8599e-04))
+        relax> align_tensor.init(params=(-8.6322e-05, -5.5786e-04, 
-3.1732e-05, 2.2927e-05,
+                                 2.8599e-04), param_types=0)
+        """
+
+        # Function intro text.
+        if self.__relax__.interpreter.intro:
+            text = sys.ps3 + "align_tensor.init("
+            text = text + "params=" + `params`
+            text = text + ", param_types=" + `param_types`
+            text = text + ", errors=" + `errors` + ")"
+            print text
+
+        # Parameter argument.
+        if type(params) != int and type(params) != float and type(params) != 
tuple:
+            raise RelaxNumTupleError, ('diffusion parameters', params)
+        if type(params) == tuple:
+            if len(params) != 4 and len(params) != 6:
+                raise RelaxError, "The diffusion parameters argument must 
either be a number or a tuple of numbers of length 4 or 6."
+            for i in xrange(len(params)):
+                if type(params[i]) != float and type(params[i]) != int:
+                    raise RelaxNumTupleError, ('diffusion parameters', 
params)
+
+        # Parameter types argument.
+        if type(param_types) != int:
+            raise RelaxIntError, ('parameter types', param_types)
+
+        # The errors flag.
+        if type(errors) != int or (errors != 0 and errors != 1):
+            raise RelaxBinError, ('errors flag', errors)
+
+        # Execute the functional code.
+        align_tensor.init(params=params, param_types=param_types, 
errors=errors)




Related Messages


Powered by MHonArc, Updated Wed Nov 21 18:40:17 2007