mailr23921 - in /branches/disp_spin_speed: lib/dispersion/ target_functions/ test_suite/unit_tests/_lib/_dispersion/


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:47:
Author: tlinnet
Date: Fri Jun 13 11:47:42 2014
New Revision: 23921

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

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

Fixed in target function.
Fixed in lib function.
Fixed 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/tap03.py
    branches/disp_spin_speed/target_functions/relax_disp.py
    
branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py

Modified: branches/disp_spin_speed/lib/dispersion/tap03.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/tap03.py?rev=23921&r1=23920&r2=23921&view=diff
==============================================================================
--- branches/disp_spin_speed/lib/dispersion/tap03.py    (original)
+++ branches/disp_spin_speed/lib/dispersion/tap03.py    Fri Jun 13 11:47:42 
2014
@@ -64,7 +64,7 @@
 from numpy.ma import fix_invalid, masked_where
 
 
-def r1rho_TAP03(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_TAP03(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, Abergel and 
Palmer (2003) equation.
@@ -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,13 +90,14 @@
     @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_gamma_neg = False
     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/target_functions/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=23921&r1=23920&r2=23921&view=diff
==============================================================================
--- branches/disp_spin_speed/target_functions/relax_disp.py     (original)
+++ branches/disp_spin_speed/target_functions/relax_disp.py     Fri Jun 13 
11:47:42 2014
@@ -1872,9 +1872,6 @@
         pA = params[self.end_index[1]]
         kex = params[self.end_index[1]+1]
 
-        # Once off parameter conversions.
-        pB = 1.0 - pA
-
         # Convert dw from ppm to rad/s. Use the out argument, to pass 
directly to structure.
         multiply( multiply.outer( dw.reshape(self.NE, self.NS), 
self.nm_no_nd_struct ), self.frqs_a, out=self.dw_struct )
 
@@ -1882,7 +1879,7 @@
         self.r20_struct[:] = multiply.outer( R20.reshape(self.NE, self.NS, 
self.NM), self.no_nd_struct )
 
         # Back calculate the R1rho values.
-        r1rho_TAP03(r1rho_prime=self.r20_struct, 
omega=self.chemical_shifts_a, offset=self.offset_a, pA=pA, pB=pB, 
dw=self.dw_struct, kex=kex, R1=self.r1_a, 
spin_lock_fields=self.spin_lock_omega1_a, 
spin_lock_fields2=self.spin_lock_omega1_squared_a, 
back_calc=self.back_calc_a, num_points=self.num_disp_points_a)
+        r1rho_TAP03(r1rho_prime=self.r20_struct, 
omega=self.chemical_shifts_a, offset=self.offset_a, pA=pA, dw=self.dw_struct, 
kex=kex, R1=self.r1_a, spin_lock_fields=self.spin_lock_omega1_a, 
spin_lock_fields2=self.spin_lock_omega1_squared_a, back_calc=self.back_calc_a)
 
         # Clean the data for all values, which is left over at the end of 
arrays.
         self.back_calc_a = self.back_calc_a*self.disp_struct

Modified: 
branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py?rev=23921&r1=23920&r2=23921&view=diff
==============================================================================
--- 
branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py 
      (original)
+++ 
branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py 
      Fri Jun 13 11:47:42 2014
@@ -72,7 +72,7 @@
         a = ones([self.num_points])
 
         # Calculate the R1rho values.
-        r1rho_TAP03(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_TAP03(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 12:00:03 2014