mailr24298 - /branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py


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

Header


Content

Posted by tlinnet on June 25, 2014 - 02:14:
Author: tlinnet
Date: Wed Jun 25 02:14:43 2014
New Revision: 24298

URL: http://svn.gna.org/viewcvs/relax?rev=24298&view=rev
Log:
Swapped the dot product position, when propagating the magnetisation in model 
NS CPMG 2site 3D.

This it to try to align to same method as in NS R1rho 2site.

Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion 
models for Clustered analysis.

Modified:
    branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py

Modified: branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py?rev=24298&r1=24297&r2=24298&view=diff
==============================================================================
--- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py (original)
+++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py Wed Jun 25 
02:14:43 2014
@@ -55,7 +55,7 @@
 """
 
 # Python module imports.
-from numpy import array, dot, fabs, float64, einsum, isfinite, log, min, 
multiply, sum
+from numpy import array, dot, fabs, float64, einsum, isfinite, log, min, 
multiply, rollaxis, sum, tile
 from numpy.ma import fix_invalid, masked_where
 
 # relax module imports.
@@ -305,6 +305,9 @@
     evolution_matrix_mat = einsum('...ij,...jk', evolution_matrix_mat, 
Rexpo_mat)
     evolution_matrix_mat = einsum('...ij,...jk', evolution_matrix_mat, 
evolution_matrix_mat)
 
+    # Roll axis around.
+    evolution_matrix_T_mat = rollaxis(evolution_matrix_mat, 6, 5)
+
     # Loop over the spins
     for si in range(NS):
         # Loop over the spectrometer frequencies.
@@ -320,17 +323,17 @@
                 r20a_si_mi_di = r20a[0, si, mi, 0, di]
 
                 # Initial magnetisation.
-                Mint_i = M0[0, si, mi, 0, di]
+                Mint_T_i = M0_T[0, si, mi, 0, di]
 
                 # This matrix is a propagator that will evolve the 
magnetization with the matrix R for a delay tcp.
-                evolution_matrix_i = evolution_matrix_mat[0, si, mi, 0, di]
+                evolution_matrix_T_i = evolution_matrix_T_mat[0, si, mi, 0, 
di]
 
                 # Loop over the CPMG elements, propagating the magnetisation.
                 for j in range(power_si_mi_di):
-                    Mint_i = dot(evolution_matrix_i, Mint_i)
+                    Mint_T_i = dot(Mint_T_i, evolution_matrix_T_i)
 
                 # The next lines calculate the R2eff using a two-point 
approximation, i.e. assuming that the decay is mono-exponential.
-                Mx = Mint_i[1][0] / pA
+                Mx = Mint_T_i[0][1] / pA
                 if Mx <= 0.0 or isNaN(Mx):
                     back_calc[0, si, mi, 0, di] = r20a_si_mi_di
                 else:




Related Messages


Powered by MHonArc, Updated Wed Jun 25 02:20:03 2014