Author: tlinnet Date: Thu Jun 12 12:12:59 2014 New Revision: 23865 URL: http://svn.gna.org/viewcvs/relax?rev=23865&view=rev Log: Made the lib function of CR72 accept the R20A, R20B and dw of the original array. This is for speed-up. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/lib/dispersion/cr72.py Modified: branches/disp_spin_speed/lib/dispersion/cr72.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/cr72.py?rev=23865&r1=23864&r2=23865&view=diff ============================================================================== --- branches/disp_spin_speed/lib/dispersion/cr72.py (original) +++ branches/disp_spin_speed/lib/dispersion/cr72.py Thu Jun 12 12:12:59 2014 @@ -98,7 +98,7 @@ # Repetitive calculations (to speed up calculations). eta_scale = 2.0**(-3.0/2.0) -def r2eff_CR72(r20a=None, r20b=None, pA=None, dw=None, kex=None, cpmg_frqs=None, back_calc=None, num_points=None): +def r2eff_CR72(r20a=None, r20a_orig=None, r20b=None, r20b_orig=None, pA=None, dw=None, dw_orig=None, kex=None, cpmg_frqs=None, back_calc=None, num_points=None): """Calculate the R2eff values for the CR72 model. See the module docstring for details. @@ -106,12 +106,18 @@ @keyword r20a: The R20 parameter value of state A (R2 with no exchange). @type r20a: numpy float array of rank [NE][NS][[NM][NO][ND] + @keyword r20a_orig: The R20 parameter value of state A (R2 with no exchange). This is only for faster checking of zero value, which result in no exchange. + @type r20a_orig: numpy float array of rank-1 @keyword r20b: The R20 parameter value of state B (R2 with no exchange). @type r20b: numpy float array of rank [NE][NS][[NM][NO][ND] + @keyword r20b_orig: The R20 parameter value of state B (R2 with no exchange). This is only for faster checking of zero value, which result in no exchange. + @type r20b_orig: numpy float array of rank-1 @keyword pA: The population of state A. @type pA: float @keyword dw: The chemical exchange difference between states A and B in rad/s. @type dw: numpy array of rank [NE][NS][[NM][NO][ND] + @keyword dw_orig: The chemical exchange difference between states A and B in ppm. This is only for faster checking of zero value, which result in no exchange. + @type dw_orig: numpy float array of rank-1 @keyword kex: The kex parameter value (the exchange rate in rad/s). @type kex: float @keyword cpmg_frqs: The CPMG nu1 frequencies. @@ -133,7 +139,7 @@ return # Test if dw is zero. Wait for replacement, since this is spin specific. - if min(fabs(dw)) == 0.0: + if min(fabs(dw_orig)) == 0.0: t_dw_zero = True mask_dw_zero = masked_where(dw == 0.0, dw) @@ -147,7 +153,7 @@ k_AB = pB * kex # The Psi and zeta values. - if sum(r20a - r20b) != 0.0: + if sum(r20a_orig - r20b_orig) != 0.0: fact = r20a - r20b - k_BA + k_AB Psi = fact**2 - dw2 + 4.0*pA*pB*kex**2 zeta = 2.0*dw * fact