mailr23460 - /branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py


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

Header


Content

Posted by tlinnet on May 27, 2014 - 12:26:
Author: tlinnet
Date: Tue May 27 12:26:26 2014
New Revision: 23460

URL: http://svn.gna.org/viewcvs/relax?rev=23460&view=rev
Log:
Modified unit tests demonstrating edge cases 'no Rex' failures of the model 
'TAP03'.

The cathing of errors for off-resonance R1rho models was implemented wrong.

This was pointed out in the post 
http://article.gmane.org/gmane.science.nmr.relax.devel/5938.
And post http://article.gmane.org/gmane.science.nmr.relax.devel/5944.

This follows from the ideas in the post 
http://article.gmane.org/gmane.science.nmr.relax.devel/5858.
This is related to: task #7793: (https://gna.org/task/?7793) Speed-up of 
dispersion models.

Modified:
    branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py

Modified: 
branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py?rev=23460&r1=23459&r2=23460&view=diff
==============================================================================
--- branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py  
  (original)
+++ branches/disp_speed/test_suite/unit_tests/_lib/_dispersion/test_tap03.py  
  Tue May 27 12:26:26 2014
@@ -21,7 +21,7 @@
 
###############################################################################
 
 # Python module imports.
-from numpy import array, float64, int16, pi, zeros
+from numpy import arctan2, array, cos, float64, int16, pi, sin, zeros
 from unittest import TestCase
 
 # relax module imports.
@@ -70,14 +70,17 @@
         # Calculate the R1rho values.
         R1rho = r1rho_TAP03(r1rho_prime=self.r1rho_prime, omega=self.omega, 
offset=self.offset, pA=self.pA, pB=pB, dw=dw_frq, kex=self.kex, R1=self.r1, 
spin_lock_fields=spin_lock_omega1, 
spin_lock_fields2=spin_lock_omega1_squared, num_points=self.num_points)
 
+        # Compare to function value.
+        Wa = self.omega                         # Larmor frequency [s^-1].
+        Wb = self.omega + dw_frq                # Larmor frequency [s^-1].
+        W = self.pA * Wa + pB * Wb              # Pop-averaged Larmor 
frequency [s^-1].
+        d = W - self.offset                     # Offset of spin-lock from 
pop-average.
+        theta = arctan2(spin_lock_omega1, d)    # The rotating frame flip 
angle.
+        r1rho_no_rex = self.r1 * cos(theta)**2 + self.r1rho_prime * 
sin(theta)**2
 
         # Check all R1rho values.
-        if self.kex > 1.e5:
-            for i in range(self.num_points):
-                self.assertAlmostEqual(R1rho[i], self.r1, 6)
-        else:
-            for i in range(self.num_points):
-                self.assertAlmostEqual(R1rho[i], self.r1rho_prime)
+        for i in range(self.num_points):
+            self.assertAlmostEqual(R1rho[i], r1rho_no_rex[i])
 
 
     def param_conversion(self, pA=None, dw=None, sfrq=None, 
spin_lock_nu1=None):




Related Messages


Powered by MHonArc, Updated Tue May 27 12:40:02 2014