mailr23273 - /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 20, 2014 - 22:29:
Author: tlinnet
Date: Tue May 20 22:29:45 2014
New Revision: 23273

URL: http://svn.gna.org/viewcvs/relax?rev=23273&view=rev
Log:
Math-domain catching for model TAP03.

Another check for division with 0 inserted.

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=23273&r1=23272&r2=23273&view=diff
==============================================================================
--- branches/disp_speed/lib/dispersion/tap03.py (original)
+++ branches/disp_speed/lib/dispersion/tap03.py Tue May 20 22:29:45 2014
@@ -127,6 +127,13 @@
     wbeff2 = gamma*spin_lock_fields2 + db**2     # Effective field at B.
     weff2 = gamma*spin_lock_fields2 + d**2       # Effective field at 
pop-average.
 
+    # Catch math domain error of dividing with 0.
+    # This is when weff2 = 0.
+    if min(abs(weff2)) == 0:
+        R2eff = array([1e100]*num_points)
+
+        return R2eff
+
     # The rotating frame flip angle.
     theta = arctan2(spin_lock_fields, d)
     hat_theta = arctan2(sqrt(gamma)*spin_lock_fields, d)




Related Messages


Powered by MHonArc, Updated Tue May 20 22:40:02 2014