mailr23917 - in /branches/disp_spin_speed: lib/dispersion/tp02.py test_suite/unit_tests/_lib/_dispersion/test_tp02.py


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

Header


Content

Posted by tlinnet on June 13, 2014 - 11:17:
Author: tlinnet
Date: Fri Jun 13 11:17:53 2014
New Revision: 23917

URL: http://svn.gna.org/viewcvs/relax?rev=23917&view=rev
Log:
Removed number of points and pB to be send to lib function of model TP02.

Number of points are not used anymore.
pB is calculated in lib function insted.

Also removed in corresponding unit tests.

Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion 
models for Clustered analysis.

Modified:
    branches/disp_spin_speed/lib/dispersion/tp02.py
    
branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_tp02.py

Modified: branches/disp_spin_speed/lib/dispersion/tp02.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/tp02.py?rev=23917&r1=23916&r2=23917&view=diff
==============================================================================
--- branches/disp_spin_speed/lib/dispersion/tp02.py     (original)
+++ branches/disp_spin_speed/lib/dispersion/tp02.py     Fri Jun 13 11:17:53 
2014
@@ -64,7 +64,7 @@
 from numpy.ma import fix_invalid, masked_where
 
 
-def r1rho_TP02(r1rho_prime=None, omega=None, offset=None, pA=None, pB=None, 
dw=None, kex=None, R1=0.0, spin_lock_fields=None, spin_lock_fields2=None, 
back_calc=None, num_points=None):
+def r1rho_TP02(r1rho_prime=None, omega=None, offset=None, pA=None, dw=None, 
kex=None, R1=0.0, spin_lock_fields=None, spin_lock_fields2=None, 
back_calc=None):
     """Calculate the R1rho' values for the TP02 model.
 
     See the module docstring for details.  This is the Trott and Palmer 
(2002) equation according to Korzhnev (J. Biomol. NMR (2003), 26, 39-48).
@@ -78,8 +78,6 @@
     @type offset:               numpy float array of rank 
[NE][NS][[NM][NO][ND]
     @keyword pA:                The population of state A.
     @type pA:                   float
-    @keyword pB:                The population of state B.
-    @type pB:                   float
     @keyword dw:                The chemical exchange difference between 
states A and B in rad/s.
     @type dw:                   numpy float array of rank 
[NE][NS][[NM][NO][ND]
     @keyword kex:               The kex parameter value (the exchange rate 
in rad/s).
@@ -92,12 +90,13 @@
     @type spin_lock_fields2:    numpy float array of rank 
[NE][NS][[NM][NO][ND]
     @keyword back_calc:         The array for holding the back calculated 
R1rho values.  Each element corresponds to the combination of offset and spin 
lock field.
     @type back_calc:            numpy float array of rank 
[NE][NS][[NM][NO][ND]
-    @keyword num_points:        The number of points on the dispersion 
curve, equal to the length of the spin_lock_fields and back_calc arguments.
-    @type num_points:           numpy int array of rank [NE][NS][[NM][NO][ND]
     """
 
     # Flag to tell if values should be replaced if it is zero.
     t_numer_zero = False
+
+    # Parameter conversions.
+    pB = 1.0 - pA
 
     # Repetitive calculations (to speed up calculations).
     Wa = omega                  # Larmor frequency [s^-1].

Modified: 
branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_tp02.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_tp02.py?rev=23917&r1=23916&r2=23917&view=diff
==============================================================================
--- 
branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_tp02.py  
      (original)
+++ 
branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_tp02.py  
      Fri Jun 13 11:17:53 2014
@@ -72,7 +72,7 @@
         a = ones([self.num_points])
 
         # Calculate the R1rho values.
-        r1rho_TP02(r1rho_prime=self.r1rho_prime, omega=self.omega, 
offset=self.offset, pA=self.pA, pB=pB, dw=dw_frq*a, kex=self.kex, R1=self.r1, 
spin_lock_fields=spin_lock_omega1, 
spin_lock_fields2=spin_lock_omega1_squared, back_calc=self.R1rho, 
num_points=self.num_points)
+        r1rho_TP02(r1rho_prime=self.r1rho_prime, omega=self.omega, 
offset=self.offset, pA=self.pA, dw=dw_frq*a, kex=self.kex, R1=self.r1, 
spin_lock_fields=spin_lock_omega1, 
spin_lock_fields2=spin_lock_omega1_squared, back_calc=self.R1rho)
 
         # Compare to function value.
         # Larmor frequency [s^-1].




Related Messages


Powered by MHonArc, Updated Fri Jun 13 11:40:02 2014