Author: bugman Date: Fri Mar 21 11:12:56 2014 New Revision: 22517 URL: http://svn.gna.org/viewcvs/relax?rev=22517&view=rev Log: Merged revisions 22516 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r22516 | bugman | 2014-03-21 11:09:18 +0100 (Fri, 21 Mar 2014) | 7 lines Bug fix for all of the R1rho relaxation dispersion models. The atan2() function is now being used rather than atan() for determining the rotating frame tilt angle. This is to allow the angle to be in the correct quandrant - i.e. to have a sign or direction. ........ Modified: branches/double_rotor/ (props changed) branches/double_rotor/lib/dispersion/mp05.py branches/double_rotor/lib/dispersion/ns_r1rho_2site.py branches/double_rotor/lib/dispersion/ns_r1rho_3site.py branches/double_rotor/lib/dispersion/tap03.py branches/double_rotor/lib/dispersion/tp02.py Propchange: branches/double_rotor/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Fri Mar 21 11:12:56 2014 @@ -1 +1 @@ -/trunk:1-22512 +/trunk:1-22516 Modified: branches/double_rotor/lib/dispersion/mp05.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/lib/dispersion/mp05.py?rev=22517&r1=22516&r2=22517&view=diff ============================================================================== --- branches/double_rotor/lib/dispersion/mp05.py (original) +++ branches/double_rotor/lib/dispersion/mp05.py Fri Mar 21 11:12:56 2014 @@ -60,7 +60,7 @@ """ # Python module imports. -from math import atan, cos, pi, sin +from math import atan2, cos, pi, sin def r1rho_MP05(r1rho_prime=None, omega=None, offset=None, pA=None, pB=None, dw=None, kex=None, R1=0.0, spin_lock_fields=None, spin_lock_fields2=None, back_calc=None, num_points=None): @@ -116,7 +116,7 @@ weff2 = spin_lock_fields2[i] + d**2 # Effective field at pop-average. # The rotating frame flip angle. - theta = atan(spin_lock_fields[i] / d) + theta = atan2(spin_lock_fields[i], d) # Repetitive calculations (to speed up calculations). sin_theta2 = sin(theta)**2 Modified: branches/double_rotor/lib/dispersion/ns_r1rho_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/lib/dispersion/ns_r1rho_2site.py?rev=22517&r1=22516&r2=22517&view=diff ============================================================================== --- branches/double_rotor/lib/dispersion/ns_r1rho_2site.py (original) +++ branches/double_rotor/lib/dispersion/ns_r1rho_2site.py Fri Mar 21 11:12:56 2014 @@ -52,7 +52,7 @@ import dep_check # Python module imports. -from math import atan, cos, log, pi, sin, sqrt +from math import atan2, cos, log, pi, sin, sqrt from numpy import dot # relax module imports. @@ -115,7 +115,7 @@ rr1rho_3d(matrix=matrix, R1=r1, r1rho_prime=r1rho_prime, pA=pA, pB=pB, wA=dA, wB=dB, w1=spin_lock_fields[i], k_AB=k_AB, k_BA=k_BA) # The following lines rotate the magnetization previous to spin-lock into the weff frame. - theta = atan(spin_lock_fields[i]/dA) + theta = atan2(spin_lock_fields[i], dA) M0[0] = sin(theta) # The A state initial X magnetisation. M0[2] = cos(theta) # The A state initial Z magnetisation. Modified: branches/double_rotor/lib/dispersion/ns_r1rho_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/lib/dispersion/ns_r1rho_3site.py?rev=22517&r1=22516&r2=22517&view=diff ============================================================================== --- branches/double_rotor/lib/dispersion/ns_r1rho_3site.py (original) +++ branches/double_rotor/lib/dispersion/ns_r1rho_3site.py Fri Mar 21 11:12:56 2014 @@ -58,7 +58,7 @@ import dep_check # Python module imports. -from math import atan, cos, log, pi, sin, sqrt +from math import atan2, cos, log, pi, sin, sqrt from numpy import dot # relax module imports. @@ -135,7 +135,7 @@ rr1rho_3d_3site(matrix=matrix, R1=r1, r1rho_prime=r1rho_prime, pA=pA, pB=pB, pC=pC, wA=dA, wB=dB, wC=dC, w1=spin_lock_fields[i], k_AB=k_AB, k_BA=k_BA, k_BC=k_BC, k_CB=k_CB, k_AC=k_AC, k_CA=k_CA) # The following lines rotate the magnetization previous to spin-lock into the weff frame. - theta = atan(spin_lock_fields[i]/dA) + theta = atan2(spin_lock_fields[i], dA) M0[0] = sin(theta) # The A state initial X magnetisation. M0[2] = cos(theta) # The A state initial Z magnetisation. Modified: branches/double_rotor/lib/dispersion/tap03.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/lib/dispersion/tap03.py?rev=22517&r1=22516&r2=22517&view=diff ============================================================================== --- branches/double_rotor/lib/dispersion/tap03.py (original) +++ branches/double_rotor/lib/dispersion/tap03.py Fri Mar 21 11:12:56 2014 @@ -60,7 +60,7 @@ """ # Python module imports. -from math import atan, cos, pi, sin, sqrt +from math import atan2, cos, pi, sin, sqrt def r1rho_TAP03(r1rho_prime=None, omega=None, offset=None, pA=None, pB=None, dw=None, kex=None, R1=0.0, spin_lock_fields=None, spin_lock_fields2=None, back_calc=None, num_points=None): @@ -128,8 +128,8 @@ weff2 = gamma*spin_lock_fields2[i] + d**2 # Effective field at pop-average. # The rotating frame flip angle. - theta = atan(spin_lock_fields[i] / d) - hat_theta = atan(sqrt(gamma)*spin_lock_fields[i] / d) + theta = atan2(spin_lock_fields[i], d) + hat_theta = atan2(sqrt(gamma)*spin_lock_fields[i], d) # Repetitive calculations (to speed up calculations). sin_theta2 = sin(theta)**2 Modified: branches/double_rotor/lib/dispersion/tp02.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/lib/dispersion/tp02.py?rev=22517&r1=22516&r2=22517&view=diff ============================================================================== --- branches/double_rotor/lib/dispersion/tp02.py (original) +++ branches/double_rotor/lib/dispersion/tp02.py Fri Mar 21 11:12:56 2014 @@ -60,7 +60,7 @@ """ # Python module imports. -from math import atan, cos, pi, sin +from math import atan2, cos, pi, sin def r1rho_TP02(r1rho_prime=None, omega=None, offset=None, pA=None, pB=None, dw=None, kex=None, R1=0.0, spin_lock_fields=None, spin_lock_fields2=None, back_calc=None, num_points=None): @@ -118,7 +118,7 @@ weff2 = spin_lock_fields2[i] + d2 # Effective field at pop-average. # The rotating frame flip angle. - theta = atan(spin_lock_fields[i] / d) + theta = atan2(spin_lock_fields[i], d) # Repetitive calculations (to speed up calculations). sin_theta2 = sin(theta)**2