mailRe: r8353 - /branches/relax_disp/specific_fns/relax_disp.py


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

Header


Content

Posted by Sébastien Morin on January 09, 2009 - 21:56:
Hi Ed,

I was pretty sure there was something about this... Where whould the
lower case names be in the code ? And where the mixed lower/upper case
names should be ?

Also, this code is, for sure, not functionnal for now since I'll have to
think about how the parameters are stored (etc) when selecting the slow-
or fast-exchange regime... Of course, no model all parameters R2, Rex,
kex, R2A, kA and dw...

Regards,


Séb  :)



Edward d'Auvergne wrote:
Hi,

I think this change conflicts with the rest of relax.  The parameters
like Rex as stored in the lower case data structures 'rex', etc. but
when a user is selecting models or asks for parameter values, the
natural mix of lower and upper case should be used.  For example to
ask for the S2f parameter in model-free analysis, you use the string
'S2f' in the value.write() user function.  These strings are the
interface for the user, and hence the natural cases should be used.
Internally in relax it doesn't matter.

Regards,

Edward


On Fri, Jan 9, 2009 at 9:36 PM,  <sebastien.morin.1@xxxxxxxxx> wrote:
  
Author: semor
Date: Fri Jan  9 21:36:55 2009
New Revision: 8353

URL: http://svn.gna.org/viewcvs/relax?rev=8353&view=rev
Log:
Corrected a few formatting issues and still added parameters for the slow- 
and fast-exchange regime.


Modified:
   branches/relax_disp/specific_fns/relax_disp.py

Modified: branches/relax_disp/specific_fns/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_fns/relax_disp.py?rev=8353&r1=8352&r2=8353&view=diff
==============================================================================
--- branches/relax_disp/specific_fns/relax_disp.py (original)
+++ branches/relax_disp/specific_fns/relax_disp.py Fri Jan  9 21:36:55 2009
@@ -62,7 +62,7 @@
        # Loop over the model parameters.
        for i in xrange(len(spin.params)):
            # Transversal relaxation rate.
-            if spin.params[i] == 'R2':
+            if spin.params[i] == 'r2':
                if sim_index != None:
                    param_vector.append(spin.r2_sim[sim_index])
                elif spin.r2 == None:
@@ -71,7 +71,7 @@
                    param_vector.append(spin.r2)

            # Chemical exchange contribution to 'R2'.
-            elif spin.params[i] == 'Rex':
+            elif spin.params[i] == 'rex':
                if sim_index != None:
                    param_vector.append(spin.rex_sim[sim_index])
                elif spin.rex == None:
@@ -89,7 +89,7 @@
                    param_vector.append(spin.kex)

            # Relaxation rate for state A.
-            if spin.params[i] == 'R2A':
+            if spin.params[i] == 'r2a':
                if sim_index != None:
                    param_vector.append(spin.r2a_sim[sim_index])
                elif spin.r2a == None:
@@ -334,11 +334,11 @@
        The names are as follows:

            - 'params', an array of the parameter names associated with 
the model.
-            - 'R2', the transversal relaxation rate.
-            - 'Rex', the chemical exchange contribution to 'R2'.
+            - 'r2', the transversal relaxation rate.
+            - 'rex', the chemical exchange contribution to 'R2'.
            - 'kex', the exchange rate.
-            - 'R2A', the transversal relaxation rate for state A.
-            - 'kA', the exchange rate from state A to state B.
+            - 'r2a', the transversal relaxation rate for state A.
+            - 'ka', the exchange rate from state A to state B.
            - 'dw', the chemical shift difference between states A and B.
            - 'chi2', chi-squared value.
            - 'iter', iterations.
@@ -419,15 +419,15 @@
        | Data type                                         | Object name  
 | Value    |
        
|___________________________________________________|_______________|__________|
        |                                                   |              
 |          |
-        | Transversal relaxation rate                       | 'R2'        
  | 8.0      |
+        | Transversal relaxation rate                       | 'r2'        
  | 8.0      |
        |                                                   |              
 |          |
-        | Chemical exchange contribution to 'R2'            | 'Rex'       
  | 2.0      |
+        | Chemical exchange contribution to 'R2'            | 'rex'       
  | 2.0      |
        |                                                   |              
 |          |
        | Exchange rate                                     | 'kex'        
 | 10000.0  |
        |                                                   |              
 |          |
-        | Relaxation rate for state A                       | 'R2A'       
  | 0.0      |
+        | Transversal relaxation rate for state A           | 'r2a'       
  | 8.0      |
        |                                                   |              
 |          |
-        | Exchange rate from state A to state B             | 'kA'        
  | 10000.0  |
+        | Exchange rate from state A to state B             | 'ka'        
  | 10000.0  |
        |                                                   |              
 |          |
        | Chemical shift difference between states A and B  | 'dw'         
 | 100      |
        |                                                   |              
 |          |
@@ -435,17 +435,29 @@

        """

-        # Relaxation rate.
-        if param == 'rx':
+        # Transversal relaxation rate.
+        if param == 'r2':
            return 8.0

-        # Initial intensity.
-        if param == 'i0':
+        # Chemical exchange contribution to 'R2'.
+        if param == 'rex':
+            return 2.0
+
+        # Exchange rate.
+        if param == 'kes':
            return 10000.0

-        # Intensity at infinity.
-        if param == 'iinf':
-            return 0.0
+        # Transversal relaxation rate for state A.
+        if param == 'r2a' :
+            return 8.0
+
+        # Exchange rate from state A to state B.
+        if param == 'ka' :
+            return 10000
+
+        # Chemical shift difference between states A and B.
+        if param == 'dw' :
+            return 100


    def disassemble_param_vector(self, param_vector=None, spin=None, 
sim_index=None):
@@ -1003,15 +1015,15 @@
        | Data type                                         | Object name  
| Patterns                 |
        
|___________________________________________________|______________|__________________________|
        |                                                   |              
|                          |
-        | Transversal relaxation rate                       | 'R2'        
 | '^[Rr]2$'                |
+        | Transversal relaxation rate                       | 'r2'        
 | '^[Rr]2$'                |
        |                                                   |              
|                          |
-        | Chemical exchange contribution to 'R2'            | 'Rex'       
 | '^[Rr]ex$'               |
+        | Chemical exchange contribution to 'R2'            | 'rex'       
 | '^[Rr]ex$'               |
        |                                                   |              
|                          |
        | Exchange rate                                     | 'kex'        
| '^[Kk]ex$'               |
        |                                                   |              
|                          |
-        | Relaxation rate for state A                       | 'R2A'       
 | '^[Rr]2A$'               |
+        | Transversal relaxation rate for state A           | 'r2a'       
 | '^[Rr]2A$'               |
        |                                                   |              
|                          |
-        | Exchange rate from state A to state B             | 'kA'        
 | '^[Kk]A$'                |
+        | Exchange rate from state A to state B             | 'ka'        
 | '^[Kk]A$'                |
        |                                                   |              
|                          |
        | Chemical shift difference between states A and B  | 'dw'         
| '^[Dd]w$'                |
        |                                                   |              
|                          |
@@ -1103,12 +1115,12 @@
        # Fast-exchange regime.
        if model == 'fast':
            print "Two parameter exponential fit."
-            params = ['R2', 'Rex', 'kex']
+            params = ['r2', 'rex', 'kex']

        # Slow-exchange regime.
        elif model == 'slow':
            print "Three parameter inversion recovery fit."
-            params = ['R2A', 'kA', 'dw']
+            params = ['r2a', 'ka', 'dw']

        # Invalid model.
        else:


_______________________________________________
relax (http://nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

    

_______________________________________________
relax (http://nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel

  




Related Messages


Powered by MHonArc, Updated Fri Jan 09 22:20:15 2009