mailr22979 - in /trunk: lib/dispersion/b14.py target_functions/relax_disp.py


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

Header


Content

Posted by tlinnet on May 05, 2014 - 20:18:
Author: tlinnet
Date: Mon May  5 20:18:45 2014
New Revision: 22979

URL: http://svn.gna.org/viewcvs/relax?rev=22979&view=rev
Log:
Replaced "power" with ncyc. And made user of numpy power.

sr #3154: (https://gna.org/support/?3154) Implementation of Baldwin (2014) 
B14 model - 2-site exact solution model for all time scales.

This follows the tutorial for adding relaxation dispersion models at:
http://wiki.nmr-relax.com/Tutorial_for_adding_relaxation_dispersion_models_to_relax#Debugging

Modified:
    trunk/lib/dispersion/b14.py
    trunk/target_functions/relax_disp.py

Modified: trunk/lib/dispersion/b14.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/dispersion/b14.py?rev=22979&r1=22978&r2=22979&view=diff
==============================================================================
--- trunk/lib/dispersion/b14.py (original)
+++ trunk/lib/dispersion/b14.py Mon May  5 20:18:45 2014
@@ -99,10 +99,10 @@
 
 # Python module imports.
 import numpy
-from numpy import arccosh, cos, cosh, log, sin, sinh, sqrt
-
-
-def r2eff_B14(r20a=None, r20b=None, pA=None, dw=None, kex=None, power=None, 
relax_time=None, tcp=None, back_calc=None, num_points=None):
+from numpy import arccosh, cos, cosh, log, sin, sinh, sqrt, power
+
+
+def r2eff_B14(r20a=None, r20b=None, pA=None, dw=None, kex=None, ncyc=None, 
relax_time=None, tcp=None, back_calc=None, num_points=None):
     """Calculate the R2eff values for the CR72 model.
 
     See the module docstring for details.
@@ -118,8 +118,8 @@
     @type dw:               float
     @keyword kex:           The kex parameter value (the exchange rate in 
rad/s).
     @type kex:              float
-    @keyword power:         The matrix exponential power array. The number 
of CPMG blocks.
-    @type power:            numpy int16, rank-1 array
+    @keyword ncyc:          The matrix exponential power array. The number 
of CPMG blocks.
+    @type ncyc:             numpy int16, rank-1 array
     @keyword relax_time:    The total relaxation time period (in seconds).
     @type relax_time:       float
     @keyword tcp:           The tau_CPMG times (1 / 4.nu1).
@@ -133,7 +133,6 @@
     # Conversion from relax parameters, to the exact code of Baldwin.
     pb = 1 - pA
     Trel = relax_time
-    ncyc = power
 
     #########################################################################
     ##### Baldwins code.
@@ -202,7 +201,7 @@
     # Exact result for v2v3.
     v3 = sqrt(ex0b**2 - 1)
 
-    y = numpy.power((ex0b - v3) / (ex0b + v3), ncyc)
+    y = power((ex0b - v3) / (ex0b + v3), ncyc)
 
     # Off diagonal common factor. sinh fuctions.
     v2pPdN = (( complex(-deltaR2 + kex, dw) ) * ex0c + (-oGt2 - kge * t1pt2) 
* 2 * ex1c)

Modified: trunk/target_functions/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/target_functions/relax_disp.py?rev=22979&r1=22978&r2=22979&view=diff
==============================================================================
--- trunk/target_functions/relax_disp.py        (original)
+++ trunk/target_functions/relax_disp.py        Mon May  5 20:18:45 2014
@@ -800,7 +800,7 @@
                 dw_frq = dw[si] * self.frqs[0][si][mi]
 
                 # Back calculate the R2eff values.
-                r2eff_B14(r20a=R20A[r20_index], r20b=R20B[r20_index], pA=pA, 
dw=dw_frq, kex=kex, power=self.power[0][mi], 
relax_time=self.relax_times[0][mi], tcp=self.tau_cpmg[0][mi], 
back_calc=self.back_calc[0][si][mi][0], 
num_points=self.num_disp_points[0][si][mi][0])
+                r2eff_B14(r20a=R20A[r20_index], r20b=R20B[r20_index], pA=pA, 
dw=dw_frq, kex=kex, ncyc=self.power[0][mi], 
relax_time=self.relax_times[0][mi], tcp=self.tau_cpmg[0][mi], 
back_calc=self.back_calc[0][si][mi][0], 
num_points=self.num_disp_points[0][si][mi][0])
 
                 # For all missing data points, set the back-calculated value 
to the measured values so that it has no effect on the chi-squared value.
                 for di in range(self.num_disp_points[0][si][mi][0]):




Related Messages


Powered by MHonArc, Updated Mon May 05 20:20:02 2014