mailr23461 - /branches/disp_speed/lib/dispersion/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:28 2014
New Revision: 23461

URL: http://svn.gna.org/viewcvs/relax?rev=23461&view=rev
Log:
Critical fix for the math domain catching of 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.

Modified:
    branches/disp_speed/lib/dispersion/tap03.py

Modified: branches/disp_speed/lib/dispersion/tap03.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_speed/lib/dispersion/tap03.py?rev=23461&r1=23460&r2=23461&view=diff
==============================================================================
--- branches/disp_speed/lib/dispersion/tap03.py (original)
+++ branches/disp_speed/lib/dispersion/tap03.py Tue May 27 12:26:28 2014
@@ -60,7 +60,7 @@
 """
 
 # Python module imports.
-from numpy import arctan2, array, isfinite, sin, sqrt, sum
+from numpy import arctan2, array, isfinite, min, sin, sqrt, sum
 
 
 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, 
num_points=None):
@@ -114,6 +114,10 @@
 
     gamma = 1.0 + phi_ex*(sigma2 - kex2 + spin_lock_fields2) / (sigma2 + 
kex2 + spin_lock_fields2)**2
 
+    # Bad gamma.
+    if min(gamma) < 0.0:
+        return array([1e100]*num_points)
+
     # Special omega values.
     waeff2 = gamma*spin_lock_fields2 + da**2     # Effective field at A.
     wbeff2 = gamma*spin_lock_fields2 + db**2     # Effective field at B.
@@ -132,7 +136,7 @@
     # Catch zeros (to avoid pointless mathematical operations).
     # This will result in no exchange, returning flat lines.
     if numer == 0.0:
-        return array([r1rho_prime]*num_points)
+        return R1_cos_theta2 + R1rho_prime_sin_theta2
 
     # Denominator.
     denom = waeff2*wbeff2/weff2 + kex2 - 2.0*hat_sin_theta2*phi_ex + (1.0 - 
gamma)*spin_lock_fields2




Related Messages


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