mailr19665 - /branches/relax_disp/lib/dispersion/lm63.py


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

Header


Content

Posted by edward on May 06, 2013 - 12:22:
Author: bugman
Date: Mon May  6 12:22:05 2013
New Revision: 19665

URL: http://svn.gna.org/viewcvs/relax?rev=19665&view=rev
Log:
Fix for the lib.dispersion.lm63 module and parameters of zero are now 
gracefully handled.


Modified:
    branches/relax_disp/lib/dispersion/lm63.py

Modified: branches/relax_disp/lib/dispersion/lm63.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/dispersion/lm63.py?rev=19665&r1=19664&r2=19665&view=diff
==============================================================================
--- branches/relax_disp/lib/dispersion/lm63.py (original)
+++ branches/relax_disp/lib/dispersion/lm63.py Mon May  6 12:22:05 2013
@@ -66,4 +66,14 @@
 
     # Loop over the time points, back calculating the R2eff values.
     for i in range(num_points):
-        back_calc[i] = r20 + phi_ex / kex * (1.0 - (4.0 * cpmg_frqs[i] / 
params[2]) * tanh(kex / (4 * cpmg_frqs[i])))
+        # Catch zeros.
+        if phi_ex == 0.0:
+            back_calc[i] = r20
+
+        # Avoid divide by zero.
+        elif kex == 0.0:
+            back_calc[i] = 1e100
+
+        # The full formula.
+        else:
+            back_calc[i] = r20 + phi_ex / kex * (1.0 - (4.0 * cpmg_frqs[i] / 
kex) * tanh(kex / (4 * cpmg_frqs[i])))




Related Messages


Powered by MHonArc, Updated Mon May 06 12:40:01 2013