mailr19996 - /branches/relax_disp/lib/dispersion/m61.py


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

Header


Content

Posted by edward on June 09, 2013 - 20:41:
Author: bugman
Date: Sun Jun  9 20:41:50 2013
New Revision: 19996

URL: http://svn.gna.org/viewcvs/relax?rev=19996&view=rev
Log:
Completed the lib.dispersion.m61.r1rho_M61() function.

Now the R1 relaxation rate and rotating frame tilt angle are correctly 
handled.  This is not used in
the target functions as support for the R1 and offset is not yet implemented.


Modified:
    branches/relax_disp/lib/dispersion/m61.py

Modified: branches/relax_disp/lib/dispersion/m61.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/dispersion/m61.py?rev=19996&r1=19995&r2=19996&view=diff
==============================================================================
--- branches/relax_disp/lib/dispersion/m61.py (original)
+++ branches/relax_disp/lib/dispersion/m61.py Sun Jun  9 20:41:50 2013
@@ -41,10 +41,10 @@
 """
 
 # Python module imports.
-from math import pi, sin
+from math import cos, pi, sin
 
 
-def r1rho_M61(r1rho_prime=None, phi_ex=None, kex=None, theta=pi/2, 
spin_lock_fields=None, back_calc=None, num_points=None):
+def r1rho_M61(r1rho_prime=None, phi_ex=None, kex=None, theta=pi/2, R1=0.0, 
spin_lock_fields=None, back_calc=None, num_points=None):
     """Calculate the R2eff values for the M61 model.
 
     See the module docstring for details.
@@ -58,6 +58,8 @@
     @type kex:                  float
     @keyword theta:             The rotating frame tilt angle.
     @type theta:                float
+    @keyword R1:                The R1 relaxation rate.
+    @type R1:                   float
     @keyword spin_lock_fields:  The CPMG nu1 frequencies.
     @type spin_lock_fields:     numpy rank-1 float array
     @keyword back_calc:         The array for holding the back calculated 
R1rho values.  Each element corresponds to one of the spin-lock fields.
@@ -68,15 +70,17 @@
 
     # Repetitive calculations (to speed up calculations).
     kex2 = kex**2
+    sin_theta2 = sin(theta)**2
+    R1_R2 = R1 * cos(theta)**2  +  r1rho_prime * sin(theta)**2
 
     # The numerator.
-    numer = sin(theta)**2 * phi_ex * kex
+    numer = sin_theta2 * phi_ex * kex
 
     # Loop over the dispersion points, back calculating the R1rho values.
     for i in range(num_points):
         # Catch zeros (to avoid pointless mathematical operations).
         if numer == 0.0:
-            back_calc[i] = r1rho_prime
+            back_calc[i] = R1_R2
             continue
 
         # Denominator.
@@ -88,4 +92,4 @@
             continue
 
         # R1rho calculation.
-        back_calc[i] = r1rho_prime + numer / denom
+        back_calc[i] = R1_R2 + numer / denom




Related Messages


Powered by MHonArc, Updated Sun Jun 09 22:20:02 2013