r24005 - /branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py
Author: tlinnet Date: Mon Jun 16 22:11:41 2014 New Revision: 24005 URL: http://svn.gna.org/viewcvs/relax?rev=24005view=rev Log: Fix for documentation in ns mmq 2site/sq/dq/zq/mq. Now explains which dimension data should be in. 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_mmq_2site.py Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py?rev=24005r1=24004r2=24005view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py Mon Jun 16 22:11:41 2014 @@ -105,31 +105,31 @@ @keyword m2:A complex numpy matrix to be populated. @type m2: numpy rank-2, 2D complex64 array @keyword R20A: The transverse, spin-spin relaxation rate for state A. -@type R20A: float +@type R20A: numpy float array of rank [NS][[NM][NO][ND] @keyword R20B: The transverse, spin-spin relaxation rate for state B. -@type R20B: float +@type R20B: numpy float array of rank [NS][[NM][NO][ND] @keyword pA:The population of state A. @type pA: float @keyword pB:The population of state B. @type pB: float @keyword dw:The chemical exchange difference between states A and B in rad/s. -@type dw: float +@type dw: numpy float array of rank [NS][[NM][NO][ND] @keyword dwH: The proton chemical exchange difference between states A and B in rad/s. -@type dwH: float +@type dwH: numpy float array of rank [NS][[NM][NO][ND] @keyword k_AB: The rate of exchange from site A to B (rad/s). @type k_AB: float @keyword k_BA: The rate of exchange from site B to A (rad/s). @type k_BA: float @keyword inv_tcpmg: The inverse of the total duration of the CPMG element (in inverse seconds). -@type inv_tcpmg:float +@type inv_tcpmg:numpy float array of rank [NS][[NM][NO][ND] @keyword tcp: The tau_CPMG times (1 / 4.nu1). -@type tcp: numpy rank-1 float array +@type tcp: numpy float array of rank [NS][[NM][NO][ND] @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. -@type back_calc:numpy rank-1 float array +@type back_calc:numpy float array of rank [NS][[NM][NO][ND] @keyword num_points:The number of points on the dispersion curve, equal to the length of the tcp and back_calc arguments. -@type num_points: int +@type num_points: numpy int array of rank [NS][[NM][NO][ND] @keyword power: The matrix exponential power array. -@type power:numpy int16, rank-1 array +@type power:numpy int array of rank [NS][[NM][NO][ND] # Extract shape of experiment. @@ -254,31 +254,31 @@ @keyword m2:A complex numpy matrix to be populated. @type m2: numpy rank-2, 2D complex64 array @keyword R20A: The transverse, spin-spin relaxation rate for state A. -@type R20A: float +@type R20A: numpy float array of rank [NS][[NM][NO][ND] @keyword R20B: The transverse, spin-spin relaxation rate for state B. -@type R20B: float +@type R20B: numpy float array of rank [NS][[NM][NO][ND] @keyword pA:The population of state A. @type pA: float @keyword pB:The population of state B. @type pB: float @keyword dw:The combined chemical exchange difference between states A and B in rad/s. It should be set to dwH for 1H SQ data, dw for heteronuclear SQ data, dwH-dw for ZQ data, and dwH+dw for DQ data. -@type dw: float +@type dw: numpy float array of rank [NS][[NM][NO][ND] @keyword dwH: Unused - this is simply to match the r2eff_ns_mmq_2site_mq() function arguments. -@type dwH: float +@type dwH: numpy float array of rank [NS][[NM][NO][ND] @keyword k_AB: The rate of exchange from site A to B (rad/s). @type k_AB: float @keyword k_BA: The rate of exchange from site B to A (rad/s). @type k_BA: float @keyword inv_tcpmg: The inverse of the total duration of the CPMG element (in inverse seconds). -@type inv_tcpmg:float +@type
r24001 - /branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py
Author: tlinnet Date: Mon Jun 16 22:11:33 2014 New Revision: 24001 URL: http://svn.gna.org/viewcvs/relax?rev=24001view=rev Log: Changed unit test of MMQ CR72 to pass. dw needs to be of numpy structure. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py Modified: branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py?rev=24001r1=24000r2=24001view=diff == --- branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py (original) +++ branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py Mon Jun 16 22:11:33 2014 @@ -20,7 +20,7 @@ ### # Python module imports. -from numpy import array, float64, int16, pi, zeros +from numpy import array, float64, int16, ones, pi, zeros from unittest import TestCase # relax module imports. @@ -41,7 +41,7 @@ self.kex = 1000.0 # Required data structures. -self.num_points = 7 +self.num_points = 6 self.ncyc = array([2, 4, 8, 10, 20, 40]) relax_times = 0.04 self.cpmg_frqs = self.ncyc / relax_times @@ -59,8 +59,10 @@ # Parameter conversions. k_AB, k_BA, pB, dw_frq, dwH_frq = self.param_conversion(pA=self.pA, kex=self.kex, dw=self.dw, dwH=self.dwH, sfrq=self.sfrq) +a = ones(self.ncyc.shape) + # Calculate the R2eff values. -r2eff_mmq_cr72(r20=self.r20, pA=self.pA, pB=pB, dw=dw_frq, dwH=dwH_frq, kex=self.kex, k_AB=k_AB, k_BA=k_BA, cpmg_frqs=self.cpmg_frqs, inv_tcpmg=self.inv_relax_times, tcp=self.tau_cpmg, back_calc=self.R2eff, num_points=self.num_points, power=self.ncyc) +r2eff_mmq_cr72(r20=self.r20*a, pA=self.pA, pB=pB, dw=dw_frq*a, dwH=dwH_frq*a, kex=self.kex, k_AB=k_AB, k_BA=k_BA, cpmg_frqs=self.cpmg_frqs, inv_tcpmg=self.inv_relax_times, tcp=self.tau_cpmg, back_calc=self.R2eff) # Check all R2eff values. for i in range(self.num_points): @@ -184,10 +186,10 @@ def test_mmq_cr72_no_rex8(self): -Test the r2eff_mmq_cr72() function for no exchange when kex = 1e5. +Test the r2eff_mmq_cr72() function for no exchange when kex = 1e8. # Parameter reset. -self.kex = 1e5 +self.kex = 1e8 # Calculate and check the R2eff values. self.calc_r2eff() ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24003 - /branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py
Author: tlinnet Date: Mon Jun 16 22:11:38 2014 New Revision: 24003 URL: http://svn.gna.org/viewcvs/relax?rev=24003view=rev Log: Modified lib function for NS MMQ 2site, to have looping over spins and frequencies inside lib function. 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_mmq_2site.py Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py?rev=24003r1=24002r2=24003view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py Mon Jun 16 22:11:38 2014 @@ -132,91 +132,107 @@ @type power:numpy int16, rank-1 array -# Populate the m1 and m2 matrices (only once per function call for speed). -populate_matrix(matrix=m1, R20A=R20A, R20B=R20B, dw=-dw-dwH, k_AB=k_AB, k_BA=k_BA) # D+ matrix component. -populate_matrix(matrix=m2, R20A=R20A, R20B=R20B, dw=dw-dwH, k_AB=k_AB, k_BA=k_BA)# Z- matrix component. - -# Loop over the time points, back calculating the R2eff values. -for i in range(num_points): -# The M1 and M2 matrices. -M1 = matrix_exponential(m1*tcp[i])# Equivalent to D+. -M2 = matrix_exponential(m2*tcp[i])# Equivalent to Z-. - -# The complex conjugates M1* and M2* -M1_star = conj(M1)# Equivalent to D+*. -M2_star = conj(M2)# Equivalent to Z-*. - -# Repetitive dot products (minimised for speed). -M1_M2 = dot(M1, M2) -M2_M1 = dot(M2, M1) -M1_M2_M2_M1 = dot(M1_M2, M2_M1) -M2_M1_M1_M2 = dot(M2_M1, M1_M2) -M1_M2_star = dot(M1_star, M2_star) -M2_M1_star = dot(M2_star, M1_star) -M1_M2_M2_M1_star = dot(M1_M2_star, M2_M1_star) -M2_M1_M1_M2_star = dot(M2_M1_star, M1_M2_star) - -# Special case of 1 CPMG block - the power is zero. -if power[i] == 1: -# M1.M2. -A = M1_M2 - -# M1*.M2*. -B = M1_M2_star - -# M2.M1. -C = M2_M1 - -# M2*.M1*. -D = M2_M1_star - -# Matrices for even number of CPMG blocks. -elif power[i] % 2 == 0: -# The power factor (only calculate once). -fact = int(floor(power[i] / 2)) - -# (M1.M2.M2.M1)^(n/2). -A = square_matrix_power(M1_M2_M2_M1, fact) - -# (M2*.M1*.M1*.M2*)^(n/2). -B = square_matrix_power(M2_M1_M1_M2_star, fact) - -# (M2.M1.M1.M2)^(n/2). -C = square_matrix_power(M2_M1_M1_M2, fact) - -# (M1*.M2*.M2*.M1*)^(n/2). -D = square_matrix_power(M1_M2_M2_M1_star, fact) - -# Matrices for odd number of CPMG blocks. -else: -# The power factor (only calculate once). -fact = int(floor((power[i] - 1) / 2)) - -# (M1.M2.M2.M1)^((n-1)/2).M1.M2. -A = square_matrix_power(M1_M2_M2_M1, fact) -A = dot(A, M1_M2) - -# (M1*.M2*.M2*.M1*)^((n-1)/2).M1*.M2*. -B = square_matrix_power(M1_M2_M2_M1_star, fact) -B = dot(B, M1_M2_star) - -# (M2.M1.M1.M2)^((n-1)/2).M2.M1. -C = square_matrix_power(M2_M1_M1_M2, fact) -C = dot(C, M2_M1) - -# (M2*.M1*.M1*.M2*)^((n-1)/2).M2*.M1*. -D = square_matrix_power(M2_M1_M1_M2_star, fact) -D = dot(D, M2_M1_star) - -# The next lines calculate the R2eff using a two-point approximation, i.e. assuming that the decay is mono-exponential. -A_B = dot(A, B) -C_D = dot(C, D) -Mx = dot(dot(F_vector, (A_B + C_D)), M0) -Mx = Mx.real / 2.0 -if Mx = 0.0 or isNaN(Mx): -back_calc[i] = 1e99 -else: -back_calc[i]= -inv_tcpmg[i] * log(Mx / pA) +# Extract shape of experiment. +NS, NM, NO = num_points.shape + +# Loop over spins. +for si in range(NS): +# Loop over the spectrometer frequencies. +for mi in range(NM): +# Loop over offsets: +for oi in range(NO): + +r20a_si_mi_oi = R20A[si][mi][oi][0] +r20b_si_mi_oi = R20B[si][mi][oi][0] +dw_si_mi_oi = dw[si][mi][oi][0] +dwH_si_mi_oi = dwH[si][mi][oi][0] +num_points_si_mi_oi = num_points[si][mi][oi] + +# Populate the m1 and m2 matrices (only once per function call for speed). +populate_matrix(matrix=m1, R20A=r20a_si_mi_oi, R20B=r20b_si_mi_oi, dw=-dw_si_mi_oi - dwH_si_mi_oi, k_AB=k_AB, k_BA=k_BA) # D+ matrix component. +populate_matrix(matrix=m2, R20A=r20a_si_mi_oi, R20B=r20b_si_mi_oi, dw=dw_si_mi_oi
r24007 - /branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py
Author: tlinnet Date: Mon Jun 16 22:11:56 2014 New Revision: 24007 URL: http://svn.gna.org/viewcvs/relax?rev=24007view=rev Log: Changed the calculation of inner product in model ns cpmg 2site 3d. The out argument of numpy.dot is buggy, and should not be used. 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=24007r1=24006r2=24007view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py Mon Jun 16 22:11:56 2014 @@ -141,9 +141,6 @@ # The matrix R that contains all the contributions to the evolution, i.e. relaxation, exchange and chemical shift evolution. R = rcpmg_3d(R1A=r10a, R1B=r10b, R2A=R2A_si_mi, R2B=R2B_si_mi, pA=pA, pB=pB, dw=dw_si_mi, k_AB=k_AB, k_BA=k_BA) -# The essential evolution matrix. This initialises the structure. -evolution_matrix = asarray(R) * 0.0 - # Loop over the time points, back calculating the R2eff values. for di in range(num_points_si_mi): # Extract the values from the higher dimensional arrays. @@ -160,10 +157,10 @@ # The essential evolution matrix. # This is the first round. -dot(Rexpo, r180x, evolution_matrix) -dot(evolution_matrix * 1.0, Rexpo, evolution_matrix) +evolution_matrix = dot(Rexpo, r180x) +evolution_matrix = dot(evolution_matrix, Rexpo) # The second round. -dot(evolution_matrix * 1.0, evolution_matrix * 1.0, evolution_matrix) +evolution_matrix = dot(evolution_matrix, evolution_matrix ) # Loop over the CPMG elements, propagating the magnetisation. for j in range(power_si_mi_di): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24008 - /trunk/test_suite/shared_data/dispersion/profiling/profiling_cr72.txt
Author: tlinnet Date: Tue Jun 17 09:18:19 2014 New Revision: 24008 URL: http://svn.gna.org/viewcvs/relax?rev=24008view=rev Log: Adding last profiling information for model CR72. Modified: trunk/test_suite/shared_data/dispersion/profiling/profiling_cr72.txt [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/test_suite/shared_data/dispersion/profiling/profiling_cr72.txt URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/dispersion/profiling/profiling_cr72.txt?rev=24008r1=24007r2=24008view=diff ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24010 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 09:18:39 2014 New Revision: 24010 URL: http://svn.gna.org/viewcvs/relax?rev=24010view=rev Log: Added missing instances of cleaning the data. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24010r1=24009r2=24010view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 09:18:39 2014 @@ -1309,6 +1309,9 @@ # Back calculate the R2eff values. r2eff_mmq_cr72(r20=r20, pA=pA, pB=pB, dw=aliased_dw, dwH=aliased_dwH, kex=kex, k_AB=k_AB, k_BA=k_BA, cpmg_frqs=self.cpmg_frqs[ei], inv_tcpmg=self.inv_relax_times[ei], tcp=self.tau_cpmg[ei], back_calc=self.back_calc[ei]) +# Clean the data for all values, which is left over at the end of arrays. +self.back_calc[ei] = self.back_calc[ei]*self.disp_struct[ei] + # 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. if self.has_missing: # Replace with values. @@ -1340,6 +1343,9 @@ # Reshape R20 to per experiment, spin and frequency. self.back_calc[:] = multiply.outer( R20.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) + +# Clean the data for all values, which is left over at the end of arrays. +self.back_calc = self.back_calc*self.disp_struct ## 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. if self.has_missing: @@ -1554,6 +1560,9 @@ # Back calculate the R2eff values for each experiment type. self.r2eff_ns_mmq[ei](M0=self.M0, m1=self.m1, m2=self.m2, R20A=r20, R20B=r20, pA=pA, pB=pB, dw=aliased_dw, dwH=aliased_dwH, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_times[ei], tcp=self.tau_cpmg[ei], back_calc=self.back_calc[ei], num_points=self.num_disp_points[ei], power=self.power[ei]) +# Clean the data for all values, which is left over at the end of arrays. +self.back_calc[ei] = self.back_calc[ei]*self.disp_struct[ei] + # 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. if self.has_missing: # Replace with values. @@ -1811,7 +1820,6 @@ return chi2_rankN(self.values, self.back_calc, self.errors) - def func_TSMFK01(self, params): Target function for the the Tollinger et al. (2001) 2-site very-slow exchange model, range of microsecond to second time scale. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24009 - /trunk/test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Tue Jun 17 09:18:24 2014 New Revision: 24009 URL: http://svn.gna.org/viewcvs/relax?rev=24009view=rev Log: Added systemtest for model LM63 3 site. According to results folder in: test_suite/shared_data/dispersion/Hansen/relax_results/LM63 3-site This should pass. But i doesnt? Modified: trunk/test_suite/system_tests/relax_disp.py Modified: trunk/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=24009r1=24008r2=24009view=diff == --- trunk/test_suite/system_tests/relax_disp.py (original) +++ trunk/test_suite/system_tests/relax_disp.py Tue Jun 17 09:18:24 2014 @@ -2492,6 +2492,70 @@ self.assertAlmostEqual(spin71.phi_ex, 0.0553787828347638) self.assertAlmostEqual(spin71.kex/1000, 2781.72293906248/1000) self.assertAlmostEqual(spin71.chi2, 17.0776399916287) + + +def test_hansen_cpmg_data_to_lm63_3site(self): +Optimisation of Dr. Flemming Hansen's CPMG data to the LM63 dispersion model. + +This uses the data from Dr. Flemming Hansen's paper at http://dx.doi.org/10.1021/jp074793o. This is CPMG data with a fixed relaxation time period. + + +# Base data setup. +self.setup_hansen_cpmg_data(model='LM63 3-site') + +# Alias the spins. +spin70 = return_spin(:70) +spin71 = return_spin(:71) + +# The R20 keys. +r20_key1 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, frq=500e6) +r20_key2 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, frq=800e6) + +## Set the initial parameter values. +spin70.r2 = {r20_key1: 7.570370921220954, r20_key2: 8.694446951909107} +spin70.phi_ex_B = 0.14872003058250227 +spin70.phi_ex_C = 0.1319419923472704 +spin70.kB = 4103.672910444741 +spin70.kC = 7029.001690726248 +spin71.r2 = {r20_key1: 5.1347793381636, r20_key2: 7.156573986051575} +spin71.phi_ex_B = 0.04013553485505605 +spin71.phi_ex_C = 0.020050748406928887 +spin71.kB = 4045.3007136121364 +spin71.kC = 3586.38798270774 + +#self.interpreter.relax_disp.r20_from_min_r2eff(force=False) +#self.interpreter.grid_search(lower=None, upper=None, inc=41, constraints=True, verbosity=1) + +# Low precision optimisation. +self.interpreter.minimise(min_algor='simplex', line_search=None, hessian_mod=None, hessian_type=None, func_tol=1e-25, grad_tol=None, max_iter=1000, constraints=True, scaling=True, verbosity=1) + +# Printout. +print(\n\nOptimised parameters:\n) +print(%-20s %-20s %-20s % (Parameter, Value (:70), Value (:71))) +print(%-20s %20.15g %20.15g % (R2 (500 MHz), spin70.r2[r20_key1], spin71.r2[r20_key1])) +print(%-20s %20.15g %20.15g % (R2 (800 MHz), spin70.r2[r20_key2], spin71.r2[r20_key2])) +print(%-20s %20.15g %20.15g % (phi_ex_B, spin70.phi_ex_B, spin71.phi_ex_B)) +print(%-20s %20.15g %20.15g % (phi_ex_C, spin70.phi_ex_C, spin71.phi_ex_C)) +print(%-20s %20.15g %20.15g % (kB, spin70.kB, spin71.kB)) +print(%-20s %20.15g %20.15g % (kC, spin70.kC, spin71.kC)) +print(%-20s %20.15g %20.15g\n % (chi2, spin70.chi2, spin71.chi2)) + +# Checks for residue :70. +#self.assertAlmostEqual(spin70.r2[r20_key1], 6.74362294539099) +#self.assertAlmostEqual(spin70.r2[r20_key2], 6.57406797067481, 6) +self.assertAlmostEqual(spin70.phi_ex_B, 0.148720030582502) +self.assertAlmostEqual(spin70.phi_ex_C, 0.13194199234727) +self.assertAlmostEqual(spin70.kB/1000, 4103.67291044474/1000, 6) +self.assertAlmostEqual(spin70.kC/1000, 7029.00169072625/1000, 6) +#self.assertAlmostEqual(spin70.chi2, 363.534044873483) + +# Checks for residue :71. +#self.assertAlmostEqual(spin71.r2[r20_key1], 5.00776657712558) +self.assertAlmostEqual(spin71.phi_ex_B, 0.040135534855056) +self.assertAlmostEqual(spin71.phi_ex_C, 0.0200507484069289) +self.assertAlmostEqual(spin71.kB/1000, 4045.30071361214/1000) +self.assertAlmostEqual(spin71.kC/1000, 3586.38798270774/1000) +#self.assertAlmostEqual(spin71.chi2, 17.0776399916287) def test_hansen_cpmg_data_to_ns_cpmg_2site_3D(self): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24011 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 09:18:41 2014 New Revision: 24011 URL: http://svn.gna.org/viewcvs/relax?rev=24011view=rev Log: Bug fix for model LM63 3site. The index si has to be used to extract data to lib function. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24011r1=24010r2=24011view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 09:18:41 2014 @@ -1075,7 +1075,7 @@ rex_C_scaled = rex_C[si] * self.frqs_squared[0][si][mi][0][0] # Back calculate the R2eff values. -r2eff_LM63_3site(r20=R20[r20_index], rex_B=rex_B_scaled, rex_C=rex_C_scaled, quart_kB=quart_kB, quart_kC=quart_kC, cpmg_frqs=self.cpmg_frqs[0][mi][0], back_calc=self.back_calc[0][si][mi][0], num_points=self.num_disp_points[0][si][mi][0]) +r2eff_LM63_3site(r20=R20[r20_index], rex_B=rex_B_scaled, rex_C=rex_C_scaled, quart_kB=quart_kB, quart_kC=quart_kC, cpmg_frqs=self.cpmg_frqs[0][si][mi][0], 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]): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24012 - in /branches/disp_spin_speed: ./ docs/latex/ test_suite/ test_suite/shared_data/dispersion/profiling/ test_suite/sy...
Author: tlinnet Date: Tue Jun 17 09:20:13 2014 New Revision: 24012 URL: http://svn.gna.org/viewcvs/relax?rev=24012view=rev Log: Merged revisions 23881,23945,24008-24009 via svnmerge from svn+ssh://tlin...@svn.gna.org/svn/relax/trunk r23881 | bugman | 2014-06-12 14:47:31 +0200 (Thu, 12 Jun 2014) | 8 lines Better handling of the control-C keyboard interrupt signal in the relax test suite. This includes two changes. The Python 2.7 and higher unittest.installHandler() function is now called, when present, to terminate all tests using the unittest module control-C handler. The second change is that the keyboard interrupt signal is caught in a try-except statement, a message printed out, and the tests terminated. This should be an improvement for all systems. r23945 | bugman | 2014-06-13 17:54:50 +0200 (Fri, 13 Jun 2014) | 17 lines Reverted r23693 as SciPy is actually still used in the frame order analyses. The command used was: $ svn merge -r23693:r23692 . . r23693 | bugman | 2014-06-06 14:24:44 +0200 (Fri, 06 Jun 2014) | 6 lines Changed paths: M /trunk/docs/latex/install.tex Removed all SciPy references in the installation chapter of the manual. This is because SciPy is no longer used in the frame order analysis, hence it is not used for any part of relax. . r24008 | tlinnet | 2014-06-17 09:18:19 +0200 (Tue, 17 Jun 2014) | 1 line Adding last profiling information for model CR72. r24009 | tlinnet | 2014-06-17 09:18:24 +0200 (Tue, 17 Jun 2014) | 8 lines Added systemtest for model LM63 3 site. According to results folder in: test_suite/shared_data/dispersion/Hansen/relax_results/LM63 3-site This should pass. But i doesnt? Modified: branches/disp_spin_speed/ (props changed) branches/disp_spin_speed/docs/latex/install.tex branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.txt branches/disp_spin_speed/test_suite/system_tests/relax_disp.py branches/disp_spin_speed/test_suite/test_suite_runner.py [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/disp_spin_speed/docs/latex/install.tex URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/docs/latex/install.tex?rev=24012r1=24011r2=24012view=diff Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.txt URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.txt?rev=24012r1=24011r2=24012view=diff Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24012r1=24011r2=24012view=diff Modified: branches/disp_spin_speed/test_suite/test_suite_runner.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/test_suite_runner.py?rev=24012r1=24011r2=24012view=diff ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24013 - /branches/disp_spin_speed/test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Tue Jun 17 09:33:32 2014 New Revision: 24013 URL: http://svn.gna.org/viewcvs/relax?rev=24013view=rev Log: Temporary added systemtest: test_korzhnev_2005_all_data_disp_speed_bug. This makes a minimisation with 1 iteration, and so will give the chi2 value at the preset parameter values. This is chi2 value should give 162.5, but gives 74.7104. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24013r1=24012r2=24013view=diff == --- branches/disp_spin_speed/test_suite/system_tests/relax_disp.py (original) +++ branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Tue Jun 17 09:33:32 2014 @@ -3558,6 +3558,101 @@ self.assertAlmostEqual(spin.chi2/1000, 162.511988511609/1000, 3) +def test_korzhnev_2005_all_data_disp_speed_bug(self): +Optimisation of all the Korzhnev et al., 2005 CPMG data using the 'NS MMQ 2-site' model. + +This uses the data from Dmitry Korzhnev's paper at U{DOI: 10.1021/ja054550ehttp://dx.doi.org/10.1021/ja054550e}. This is the 1H SQ, 15N SQ, ZQ, DQ, 1H MQ and 15N MQ data for residue Asp 9 of the Fyn SH3 domain mutant. + +Here all data will be optimised. The values found by cpmg_fit using just this data are: + +- r2 = {'H-S 500': 6.671649051677150, 'H-S 600': 6.988634195648529, 'H-S 800': 5.527971316790596, +'N-S 500': 8.394988400015988, 'N-S 600': 8.891359568401835, 'N-S 800': 10.405356669006709, +'NHZ 500': 5.936446687394352, 'NHZ 600': 6.717058062814535, 'NHZ 800': 6.838733853403030, +'NHD 500': 8.593136215779710, 'NHD 600': 10.651511259239674, 'NHD 800': 12.567902357560627, +'HNM 500': 7.851325614877817, 'HNM 600': 8.408803624020202, 'HNM 800': 11.227489645758979, +'NHM 500': 9.189159145380575, 'NHM 600': 9.856814478405868, 'NHM 800': 11.967910041807118}, +- pA = 0.943125351763911, +- dw = 4.421827493809807, +- dwH = -0.272637034755752, +- kex = 360.609744568697238, +- chi2 = 162.589570340050813. + + +# Base data setup. +self.setup_korzhnev_2005_data(data_list=['SQ', '1H SQ', 'DQ', 'ZQ', 'MQ', '1H MQ']) + +# Alias the spin. +spin = return_spin(:9@N) + +# The R20 keys. +r20_key1 = generate_r20_key(exp_type=EXP_TYPE_CPMG_PROTON_SQ, frq=500e6) +r20_key2 = generate_r20_key(exp_type=EXP_TYPE_CPMG_PROTON_SQ, frq=600e6) +r20_key3 = generate_r20_key(exp_type=EXP_TYPE_CPMG_PROTON_SQ, frq=800e6) +r20_key4 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, frq=500e6) +r20_key5 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, frq=600e6) +r20_key6 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, frq=800e6) +r20_key7 = generate_r20_key(exp_type=EXP_TYPE_CPMG_ZQ, frq=500e6) +r20_key8 = generate_r20_key(exp_type=EXP_TYPE_CPMG_ZQ, frq=600e6) +r20_key9 = generate_r20_key(exp_type=EXP_TYPE_CPMG_ZQ, frq=800e6) +r20_key10 = generate_r20_key(exp_type=EXP_TYPE_CPMG_DQ, frq=500e6) +r20_key11 = generate_r20_key(exp_type=EXP_TYPE_CPMG_DQ, frq=600e6) +r20_key12 = generate_r20_key(exp_type=EXP_TYPE_CPMG_DQ, frq=800e6) +r20_key13 = generate_r20_key(exp_type=EXP_TYPE_CPMG_PROTON_MQ, frq=500e6) +r20_key14 = generate_r20_key(exp_type=EXP_TYPE_CPMG_PROTON_MQ, frq=600e6) +r20_key15 = generate_r20_key(exp_type=EXP_TYPE_CPMG_PROTON_MQ, frq=800e6) +r20_key16 = generate_r20_key(exp_type=EXP_TYPE_CPMG_MQ, frq=500e6) +r20_key17 = generate_r20_key(exp_type=EXP_TYPE_CPMG_MQ, frq=600e6) +r20_key18 = generate_r20_key(exp_type=EXP_TYPE_CPMG_MQ, frq=800e6) + +# Set the initial parameter values. +spin.r2 = { +r20_key1: 6.67288025927458, r20_key2: 6.98951408255098, r20_key3: 5.52959273852704, +r20_key4: 8.39471048876782, r20_key5: 8.89290699178799, r20_key6: 10.40770687236930, +r20_key7: 5.93611174376373, r20_key8: 6.71735669582514, r20_key9: 6.83835225518265, +r20_key10: 8.59615074668922, r20_key11: 10.65121378892910, r20_key12: 12.57108229191090, +r20_key13: 7.85956711501608, r20_key14: 8.41891642907918, r20_key15: 11.23620892230380, +r20_key16: 9.19654863789350, r20_key17: 9.86031627358462, r20_key18: 11.97523755925750 +} +spin.pA = 0.943129019477673 +spin.dw = 4.42209952545181 +spin.dwH = -0.27258970590969 +spin.kex
r24014 - in /branches/disp_spin_speed/lib/dispersion: ns_cpmg_2site_3d.py ns_cpmg_2site_star.py ns_mmq_2site.py
Author: tlinnet Date: Tue Jun 17 09:47:09 2014 New Revision: 24014 URL: http://svn.gna.org/viewcvs/relax?rev=24014view=rev Log: Updated documentation on dimensionality of numpy array num_points. They are in dimension [NE][NS][[NM][NO], where oi gives the number of dispersion points at that offset. 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 branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.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=24014r1=24013r2=24014view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py Tue Jun 17 09:47:09 2014 @@ -97,7 +97,7 @@ @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. @type back_calc:numpy float array of rank [NE][NS][[NM][NO][ND] @keyword num_points:The number of points on the dispersion curve, equal to the length of the tcp and back_calc arguments. -@type num_points: numpy int array of rank [NE][NS][[NM][NO][ND] +@type num_points: numpy int array of rank [NE][NS][[NM][NO] @keyword power: The matrix exponential power array. @type power:numpy int array of rank [NE][NS][[NM][NO][ND] Modified: branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py?rev=24014r1=24013r2=24014view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py Tue Jun 17 09:47:09 2014 @@ -100,7 +100,7 @@ @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. @type back_calc:numpy float array of rank [NE][NS][[NM][NO][ND] @keyword num_points:The number of points on the dispersion curve, equal to the length of the tcp and back_calc arguments. -@type num_points: numpy int array of rank [NE][NS][[NM][NO][ND] +@type num_points: numpy int array of rank [NE][NS][[NM][NO] @keyword power: The matrix exponential power array. @type power:numpy int array of rank [NE][NS][[NM][NO][ND] Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py?rev=24014r1=24013r2=24014view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py Tue Jun 17 09:47:09 2014 @@ -276,7 +276,7 @@ @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. @type back_calc:numpy float array of rank [NS][[NM][NO][ND] @keyword num_points:The number of points on the dispersion curve, equal to the length of the tcp and back_calc arguments. -@type num_points: numpy int array of rank [NS][[NM][NO][ND] +@type num_points: numpy int array of rank [NS][[NM][NO] @keyword power: The matrix exponential power array. @type power:numpy int array of rank [NS][[NM][NO][ND] ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24019 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 11:56:45 2014 New Revision: 24019 URL: http://svn.gna.org/viewcvs/relax?rev=24019view=rev Log: Moved the cleaning of data points and replacing of values of out loop for model ns mmq 2site. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24019r1=24018r2=24019view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 11:56:45 2014 @@ -1560,20 +1560,16 @@ # Back calculate the R2eff values for each experiment type. self.r2eff_ns_mmq[ei](M0=self.M0, m1=self.m1, m2=self.m2, R20A=r20, R20B=r20, pA=pA, pB=pB, dw=aliased_dw, dwH=aliased_dwH, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_times[ei], tcp=self.tau_cpmg[ei], back_calc=self.back_calc[ei], num_points=self.num_disp_points[ei], power=self.power[ei]) -# Clean the data for all values, which is left over at the end of arrays. -self.back_calc[ei] = self.back_calc[ei]*self.disp_struct[ei] - -# 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. -if self.has_missing: -# Replace with values. -mask_replace_blank_ei = masked_equal(self.missing, 1.0) -self.back_calc[mask_replace_blank_ei.mask] = self.values[mask_replace_blank_ei.mask] - -# Calculate and return the chi-squared value. -chi2_sum += chi2_rankN(self.values[ei], self.back_calc[ei], self.errors[ei]) +# Clean the data for all values, which is left over at the end of arrays. +self.back_calc = self.back_calc*self.disp_struct + +## 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. +if self.has_missing: +# Replace with values. +self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] # Return the total chi-squared value. -return chi2_sum +return chi2_rankN(self.values, self.back_calc, self.errors) def func_ns_mmq_3site(self, params): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24018 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 11:56:43 2014 New Revision: 24018 URL: http://svn.gna.org/viewcvs/relax?rev=24018view=rev Log: Fix for systemtest: test_korzhnev_2005_all_data The masking for replacing values was wrong. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24018r1=24017r2=24018view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 11:56:43 2014 @@ -1566,8 +1566,8 @@ # 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. if self.has_missing: # Replace with values. -mask_replace_blank_ei = masked_equal(self.missing[ei], 1.0) -self.back_calc[ei][mask_replace_blank_ei.mask] = self.values[ei][mask_replace_blank_ei.mask] +mask_replace_blank_ei = masked_equal(self.missing, 1.0) +self.back_calc[mask_replace_blank_ei.mask] = self.values[mask_replace_blank_ei.mask] # Calculate and return the chi-squared value. chi2_sum += chi2_rankN(self.values[ei], self.back_calc[ei], self.errors[ei]) ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24022 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 12:20:12 2014 New Revision: 24022 URL: http://svn.gna.org/viewcvs/relax?rev=24022view=rev Log: Fix for structure cleaning and value replacing for model mmq CR72. System test: test_korzhnev_2005_all_data revealed how this should be done properly. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24022r1=24021r2=24022view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 12:20:12 2014 @@ -1279,9 +1279,6 @@ # Reshape R20 to per experiment, spin and frequency. self.r20_struct[:] = multiply.outer( R20.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) -# Initialise. -chi2_sum = 0.0 - # Loop over the experiment types. for ei in range(self.num_exp): @@ -1309,20 +1306,16 @@ # Back calculate the R2eff values. r2eff_mmq_cr72(r20=r20, pA=pA, pB=pB, dw=aliased_dw, dwH=aliased_dwH, kex=kex, k_AB=k_AB, k_BA=k_BA, cpmg_frqs=self.cpmg_frqs[ei], inv_tcpmg=self.inv_relax_times[ei], tcp=self.tau_cpmg[ei], back_calc=self.back_calc[ei]) -# Clean the data for all values, which is left over at the end of arrays. -self.back_calc[ei] = self.back_calc[ei]*self.disp_struct[ei] - -# 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. -if self.has_missing: -# Replace with values. -mask_replace_blank_ei = masked_equal(self.missing[ei], 1.0) -self.back_calc[ei][mask_replace_blank_ei.mask] = self.values[ei][mask_replace_blank_ei.mask] - -# Calculate and return the chi-squared value. -chi2_sum += chi2_rankN(self.values[ei], self.back_calc[ei], self.errors[ei]) - -# Return the total chi-squared value. -return chi2_sum +# Clean the data for all values, which is left over at the end of arrays. +self.back_calc = self.back_calc*self.disp_struct + +## 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. +if self.has_missing: +# Replace with values. +self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] + +## Calculate the chi-squared statistic. +return chi2_rankN(self.values, self.back_calc, self.errors) def func_NOREX(self, params): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24023 - /branches/disp_spin_speed/test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Tue Jun 17 12:20:15 2014 New Revision: 24023 URL: http://svn.gna.org/viewcvs/relax?rev=24023view=rev Log: Fix for systemtest test_korzhnev_2005_all_data_disp_speed_bug. The precision is lowered, and now matches the original systemtest. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24023r1=24022r2=24023view=diff == --- branches/disp_spin_speed/test_suite/system_tests/relax_disp.py (original) +++ branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Tue Jun 17 12:20:15 2014 @@ -3618,9 +3618,8 @@ spin.dwH = -0.27258970590969 spin.kex = 360.516132791038 -# Low precision optimisation. -#self.interpreter.grid_search(lower=None, upper=None, inc=10, constraints=True, verbosity=1) -self.interpreter.minimise(min_algor='simplex', func_tol=1e-05, max_iter=1) +# Calc the chi2 values at these parameters. +self.interpreter.calc(verbosity=1) # Printout. print(\n\nOptimised parameters:\n) @@ -3650,7 +3649,7 @@ print(%-20s %20.15g\n % (chi2, spin.chi2)) # Checks for residue :9. -self.assertAlmostEqual(spin.chi2, 162.511988511609, 3) +self.assertAlmostEqual(spin.chi2/1000, 162.511988511609/1000, 3) def test_kteilum_fmpoulsen_makke_cpmg_data_048m_guhcl_to_cr72(self): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24024 - /trunk/test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Tue Jun 17 12:32:34 2014 New Revision: 24024 URL: http://svn.gna.org/viewcvs/relax?rev=24024view=rev Log: Removed systemtest test_hansen_cpmg_data_to_lm63_3site. This was a temporary implementation and has been replaced with systemtest: Relax_disp.test_lm63_3site_synthetic Modified: trunk/test_suite/system_tests/relax_disp.py Modified: trunk/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=24024r1=24023r2=24024view=diff == --- trunk/test_suite/system_tests/relax_disp.py (original) +++ trunk/test_suite/system_tests/relax_disp.py Tue Jun 17 12:32:34 2014 @@ -2493,69 +2493,6 @@ self.assertAlmostEqual(spin71.kex/1000, 2781.72293906248/1000) self.assertAlmostEqual(spin71.chi2, 17.0776399916287) - -def test_hansen_cpmg_data_to_lm63_3site(self): -Optimisation of Dr. Flemming Hansen's CPMG data to the LM63 dispersion model. - -This uses the data from Dr. Flemming Hansen's paper at http://dx.doi.org/10.1021/jp074793o. This is CPMG data with a fixed relaxation time period. - - -# Base data setup. -self.setup_hansen_cpmg_data(model='LM63 3-site') - -# Alias the spins. -spin70 = return_spin(:70) -spin71 = return_spin(:71) - -# The R20 keys. -r20_key1 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, frq=500e6) -r20_key2 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, frq=800e6) - -## Set the initial parameter values. -spin70.r2 = {r20_key1: 7.570370921220954, r20_key2: 8.694446951909107} -spin70.phi_ex_B = 0.14872003058250227 -spin70.phi_ex_C = 0.1319419923472704 -spin70.kB = 4103.672910444741 -spin70.kC = 7029.001690726248 -spin71.r2 = {r20_key1: 5.1347793381636, r20_key2: 7.156573986051575} -spin71.phi_ex_B = 0.04013553485505605 -spin71.phi_ex_C = 0.020050748406928887 -spin71.kB = 4045.3007136121364 -spin71.kC = 3586.38798270774 - -#self.interpreter.relax_disp.r20_from_min_r2eff(force=False) -#self.interpreter.grid_search(lower=None, upper=None, inc=41, constraints=True, verbosity=1) - -# Low precision optimisation. -self.interpreter.minimise(min_algor='simplex', line_search=None, hessian_mod=None, hessian_type=None, func_tol=1e-25, grad_tol=None, max_iter=1000, constraints=True, scaling=True, verbosity=1) - -# Printout. -print(\n\nOptimised parameters:\n) -print(%-20s %-20s %-20s % (Parameter, Value (:70), Value (:71))) -print(%-20s %20.15g %20.15g % (R2 (500 MHz), spin70.r2[r20_key1], spin71.r2[r20_key1])) -print(%-20s %20.15g %20.15g % (R2 (800 MHz), spin70.r2[r20_key2], spin71.r2[r20_key2])) -print(%-20s %20.15g %20.15g % (phi_ex_B, spin70.phi_ex_B, spin71.phi_ex_B)) -print(%-20s %20.15g %20.15g % (phi_ex_C, spin70.phi_ex_C, spin71.phi_ex_C)) -print(%-20s %20.15g %20.15g % (kB, spin70.kB, spin71.kB)) -print(%-20s %20.15g %20.15g % (kC, spin70.kC, spin71.kC)) -print(%-20s %20.15g %20.15g\n % (chi2, spin70.chi2, spin71.chi2)) - -# Checks for residue :70. -#self.assertAlmostEqual(spin70.r2[r20_key1], 6.74362294539099) -#self.assertAlmostEqual(spin70.r2[r20_key2], 6.57406797067481, 6) -self.assertAlmostEqual(spin70.phi_ex_B, 0.148720030582502) -self.assertAlmostEqual(spin70.phi_ex_C, 0.13194199234727) -self.assertAlmostEqual(spin70.kB/1000, 4103.67291044474/1000, 6) -self.assertAlmostEqual(spin70.kC/1000, 7029.00169072625/1000, 6) -#self.assertAlmostEqual(spin70.chi2, 363.534044873483) - -# Checks for residue :71. -#self.assertAlmostEqual(spin71.r2[r20_key1], 5.00776657712558) -self.assertAlmostEqual(spin71.phi_ex_B, 0.040135534855056) -self.assertAlmostEqual(spin71.phi_ex_C, 0.0200507484069289) -self.assertAlmostEqual(spin71.kB/1000, 4045.30071361214/1000) -self.assertAlmostEqual(spin71.kC/1000, 3586.38798270774/1000) -#self.assertAlmostEqual(spin71.chi2, 17.0776399916287) def test_hansen_cpmg_data_to_ns_cpmg_2site_3D(self): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24025 - in /branches/disp_spin_speed: ./ test_suite/shared_data/dispersion/lm63_3site/ test_suite/system_tests/
Author: tlinnet Date: Tue Jun 17 12:33:27 2014 New Revision: 24025 URL: http://svn.gna.org/viewcvs/relax?rev=24025view=rev Log: Merged revisions 24020-24021,24024 via svnmerge from svn+ssh://tlin...@svn.gna.org/svn/relax/trunk r24020 | bugman | 2014-06-17 12:07:35 +0200 (Tue, 17 Jun 2014) | 7 lines Created an initial Relax_disp.test_lm63_3site_synthetic system test. This should have been set up a long time ago. It uses the synthetic noise-free data in the test_suite/shared_data/dispersion/lm63_3site directory which was created for a system test but never converted into one. The test still needs modifications to allow it to pass. r24021 | bugman | 2014-06-17 12:15:31 +0200 (Tue, 17 Jun 2014) | 7 lines Modifications for the Relax_disp.test_lm63_3site_synthetic system test. The r2eff_values.bz2 saved state file has been updated, as it was too old to use in the test. The test has also had a typo bug fixed and the data pipe name updated. The test now also checks all of the optimised values. r24024 | tlinnet | 2014-06-17 12:32:34 +0200 (Tue, 17 Jun 2014) | 4 lines Removed systemtest test_hansen_cpmg_data_to_lm63_3site. This was a temporary implementation and has been replaced with systemtest: Relax_disp.test_lm63_3site_synthetic Modified: branches/disp_spin_speed/ (props changed) branches/disp_spin_speed/test_suite/shared_data/dispersion/lm63_3site/r2eff_calc.log branches/disp_spin_speed/test_suite/shared_data/dispersion/lm63_3site/r2eff_values.bz2 branches/disp_spin_speed/test_suite/system_tests/relax_disp.py [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/lm63_3site/r2eff_calc.log URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/lm63_3site/r2eff_calc.log?rev=24025r1=24024r2=24025view=diff Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/lm63_3site/r2eff_values.bz2 URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/lm63_3site/r2eff_values.bz2?rev=24025r1=24024r2=24025view=diff Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24025r1=24024r2=24025view=diff ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24026 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 13:07:40 2014 New Revision: 24026 URL: http://svn.gna.org/viewcvs/relax?rev=24026view=rev Log: Replaced index to numpy array from example [0][si][mi][oi] to [0, si, mi, oi]. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24026r1=24025r2=24026view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 13:07:40 2014 @@ -263,39 +263,39 @@ for mi in range(self.NM): # Fill the frequency. frq = frqs[ei][si][mi] -self.frqs[ei][si][mi][:] = frq -self.frqs_squared[ei][si][mi][:] = frq**2 +self.frqs[ei, si, mi][:] = frq +self.frqs_squared[ei, si, mi][:] = frq**2 frq_H = frqs_H[ei][si][mi] -self.frqs_H[ei][si][mi][:] = frq_H +self.frqs_H[ei, si, mi][:] = frq_H # Fill the relaxation time. -relax_time = relax_times[ei][mi] -self.relax_times[ei][si][mi][:] = relax_time +relax_time = relax_times[ei, mi] +self.relax_times[ei, si, mi][:] = relax_time # Fill r1. r1_l = r1[si][mi] -self.r1[ei][si][mi][:] = r1_l +self.r1[ei, si, mi][:] = r1_l # Fill chemical shift. chemical_shift = chemical_shifts[ei][si][mi] -self.chemical_shifts[ei][si][mi][:] = chemical_shift +self.chemical_shifts[ei, si, mi][:] = chemical_shift # The inverted relaxation delay. if model in [MODEL_B14, MODEL_B14_FULL, MODEL_MMQ_CR72, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_STAR_FULL, MODEL_NS_MMQ_2SITE, MODEL_NS_MMQ_3SITE, MODEL_NS_MMQ_3SITE_LINEAR, MODEL_NS_R1RHO_2SITE, MODEL_NS_R1RHO_3SITE, MODEL_NS_R1RHO_3SITE_LINEAR]: -self.inv_relax_times[ei][si][mi][:] = 1.0 / relax_time +self.inv_relax_times[ei, si, mi][:] = 1.0 / relax_time # The number of offset data points. if len(offset[ei][si][mi]): -self.num_offsets[ei][si][mi] = len(self.offset[ei][si][mi]) +self.num_offsets[ei, si, mi] = len(self.offset[ei, si, mi]) else: -self.num_offsets[ei][si][mi] = 0 +self.num_offsets[ei, si, mi] = 0 # Loop over offsets. for oi in range(self.NO): if cpmg_frqs != None and len(cpmg_frqs[ei][mi][oi]): cpmg_frqs_list = cpmg_frqs[ei][mi][oi] num_disp_points = len(cpmg_frqs_list) -self.cpmg_frqs[ei][si][mi][oi][:num_disp_points] = cpmg_frqs_list +self.cpmg_frqs[ei, si, mi, oi][:num_disp_points] = cpmg_frqs_list for di in range(num_disp_points): cpmg_frq = cpmg_frqs[ei][mi][oi][di] @@ -305,42 +305,42 @@ # Normal value. else: power = int(round(cpmg_frq * relax_time)) -self.power[ei][si][mi][oi][di] = power +self.power[ei, si, mi, oi, di] = power # Recalculate the tau_cpmg times to avoid any user induced truncation in the input files. if recalc_tau: tau_cpmg = 0.25 * relax_time / power else: tau_cpmg = 0.25 / frq -self.tau_cpmg[ei][si][mi][oi][di] = tau_cpmg +self.tau_cpmg[ei, si, mi, oi, di] = tau_cpmg elif spin_lock_nu1 != None and len(spin_lock_nu1[ei][mi][oi]): num_disp_points = len( spin_lock_nu1[ei][mi][oi] ) else: num_disp_points = 0 -self.num_disp_points[ei][si][mi][oi] = num_disp_points +self.num_disp_points[ei, si, mi, oi] = num_disp_points
r24027 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 13:07:42 2014 New Revision: 24027 URL: http://svn.gna.org/viewcvs/relax?rev=24027view=rev Log: More replacing of numpy index. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24027r1=24026r2=24027view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 13:07:42 2014 @@ -263,26 +263,26 @@ for mi in range(self.NM): # Fill the frequency. frq = frqs[ei][si][mi] -self.frqs[ei, si, mi][:] = frq -self.frqs_squared[ei, si, mi][:] = frq**2 +self.frqs[ei, si, mi, :] = frq +self.frqs_squared[ei, si, mi, :] = frq**2 frq_H = frqs_H[ei][si][mi] -self.frqs_H[ei, si, mi][:] = frq_H +self.frqs_H[ei, si, mi, :] = frq_H # Fill the relaxation time. relax_time = relax_times[ei, mi] -self.relax_times[ei, si, mi][:] = relax_time +self.relax_times[ei, si, mi, :] = relax_time # Fill r1. r1_l = r1[si][mi] -self.r1[ei, si, mi][:] = r1_l +self.r1[ei, si, mi, :] = r1_l # Fill chemical shift. chemical_shift = chemical_shifts[ei][si][mi] -self.chemical_shifts[ei, si, mi][:] = chemical_shift +self.chemical_shifts[ei, si, mi, :] = chemical_shift # The inverted relaxation delay. if model in [MODEL_B14, MODEL_B14_FULL, MODEL_MMQ_CR72, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_STAR_FULL, MODEL_NS_MMQ_2SITE, MODEL_NS_MMQ_3SITE, MODEL_NS_MMQ_3SITE_LINEAR, MODEL_NS_R1RHO_2SITE, MODEL_NS_R1RHO_3SITE, MODEL_NS_R1RHO_3SITE_LINEAR]: -self.inv_relax_times[ei, si, mi][:] = 1.0 / relax_time +self.inv_relax_times[ei, si, mi, :] = 1.0 / relax_time # The number of offset data points. if len(offset[ei][si][mi]): @@ -295,7 +295,7 @@ if cpmg_frqs != None and len(cpmg_frqs[ei][mi][oi]): cpmg_frqs_list = cpmg_frqs[ei][mi][oi] num_disp_points = len(cpmg_frqs_list) -self.cpmg_frqs[ei, si, mi, oi][:num_disp_points] = cpmg_frqs_list +self.cpmg_frqs[ei, si, mi, oi, :num_disp_points] = cpmg_frqs_list for di in range(num_disp_points): cpmg_frq = cpmg_frqs[ei][mi][oi][di] @@ -322,9 +322,9 @@ self.num_disp_points[ei, si, mi, oi] = num_disp_points # Get the values and errors. -self.values[ei, si, mi, oi][:num_disp_points] = values[ei][si][mi][oi] -self.errors[ei, si, mi, oi][:num_disp_points] = errors[ei][si][mi][oi] -self.disp_struct[ei, si, mi, oi][:num_disp_points] = ones(num_disp_points) +self.values[ei, si, mi, oi, :num_disp_points] = values[ei][si][mi][oi] +self.errors[ei, si, mi, oi, :num_disp_points] = errors[ei][si][mi][oi] +self.disp_struct[ei, si, mi, oi, :num_disp_points] = ones(num_disp_points) # Loop over dispersion points. for di in range(num_disp_points): @@ -790,7 +790,7 @@ dw_AC_frq = dw_AC[si] * self.frqs[0, si, mi, 0, 0] # Loop over the offsets. -for oi in range(self.num_offsets[0][si, mi]): +for oi in range(self.num_offsets[0, si, mi]): # Back calculate the R2eff values for each experiment type. ns_r1rho_3site(M0=self.M0, matrix=self.matrix, r1rho_prime=r1rho_prime[r20_index], omega=self.chemical_shifts[0, si, mi, oi, 0], offset=self.offset[0, si, mi, oi, 0], r1=self.r1[0, si, mi, oi, 0], pA=pA, pB=pB, pC=pC, dw_AB=dw_AB_frq, dw_AC=dw_AC_frq, k_AB=k_AB, k_BA=k_BA, k_BC=k_BC, k_CB=k_CB, k_AC=k_AC, k_CA=k_CA, spin_lock_fields=self.spin_lock_omega1[0, si, mi, oi], relax_time=self.relax_times[0, si, mi, oi], inv_relax_time=self.inv_relax_times[0, si, mi, oi], back_calc=self.back_calc[0, si, mi, oi], num_points
r24032 - /branches/disp_spin_speed/lib/dispersion/
Author: tlinnet Date: Tue Jun 17 14:53:47 2014 New Revision: 24032 URL: http://svn.gna.org/viewcvs/relax?rev=24032view=rev Log: Documentation fix, where a double bracket [[ has been copied into all lib functions. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/lib/dispersion/b14.py branches/disp_spin_speed/lib/dispersion/cr72.py branches/disp_spin_speed/lib/dispersion/dpl94.py branches/disp_spin_speed/lib/dispersion/it99.py branches/disp_spin_speed/lib/dispersion/lm63.py branches/disp_spin_speed/lib/dispersion/m61.py branches/disp_spin_speed/lib/dispersion/m61b.py branches/disp_spin_speed/lib/dispersion/mmq_cr72.py branches/disp_spin_speed/lib/dispersion/mp05.py branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_expanded.py branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py branches/disp_spin_speed/lib/dispersion/tap03.py branches/disp_spin_speed/lib/dispersion/tp02.py branches/disp_spin_speed/lib/dispersion/tsmfk01.py [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/disp_spin_speed/lib/dispersion/b14.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/b14.py?rev=24032r1=24031r2=24032view=diff 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=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/dpl94.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/dpl94.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/it99.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/it99.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/lm63.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/lm63.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/m61.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/m61.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/m61b.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/m61b.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/mmq_cr72.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/mmq_cr72.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/mp05.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/mp05.py?rev=24032r1=24031r2=24032view=diff 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=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_expanded.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_expanded.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/tap03.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/tap03.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/tp02.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/tp02.py?rev=24032r1=24031r2=24032view=diff Modified: branches/disp_spin_speed/lib/dispersion/tsmfk01.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/tsmfk01.py?rev=24032r1=24031r2=24032view=diff ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24035 - /branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py
Author: tlinnet Date: Tue Jun 17 14:53:52 2014 New Revision: 24035 URL: http://svn.gna.org/viewcvs/relax?rev=24035view=rev Log: Reorded the lib function for ns mmq 3site to use higher dimensional data. 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_mmq_3site.py [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py?rev=24035r1=24034r2=24035view=diff ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24036 - /branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py
Author: tlinnet Date: Tue Jun 17 14:53:54 2014 New Revision: 24036 URL: http://svn.gna.org/viewcvs/relax?rev=24036view=rev Log: Documentation fix for which dimensionality number of points have. 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_mmq_2site.py Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py?rev=24036r1=24035r2=24036view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py Tue Jun 17 14:53:54 2014 @@ -127,7 +127,7 @@ @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. @type back_calc:numpy float array of rank [NS][NM][NO][ND] @keyword num_points:The number of points on the dispersion curve, equal to the length of the tcp and back_calc arguments. -@type num_points: numpy int array of rank [NS][NM][NO][ND] +@type num_points: numpy int array of rank [NS][NM][NO] @keyword power: The matrix exponential power array. @type power:numpy int array of rank [NS][NM][NO][ND] ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24033 - in /branches/disp_spin_speed/lib/dispersion: ns_cpmg_2site_3d.py ns_cpmg_2site_star.py ns_mmq_2site.py
Author: tlinnet Date: Tue Jun 17 14:53:49 2014 New Revision: 24033 URL: http://svn.gna.org/viewcvs/relax?rev=24033view=rev Log: More fixes for numpy index in lib functions. 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 branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.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=24033r1=24032r2=24033view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py Tue Jun 17 14:53:49 2014 @@ -133,10 +133,10 @@ for mi in range(NM): # Extract the values from the higher dimensional arrays. -R2A_si_mi=r20a[0][si][mi][0][0] -R2B_si_mi=r20b[0][si][mi][0][0] -dw_si_mi = dw[0][si][mi][0][0] -num_points_si_mi = int(num_points[0][si][mi][0]) +R2A_si_mi=r20a[0, si, mi, 0, 0] +R2B_si_mi=r20b[0, si, mi, 0, 0] +dw_si_mi = dw[0, si, mi, 0, 0] +num_points_si_mi = int(num_points[0, si, mi, 0]) # The matrix R that contains all the contributions to the evolution, i.e. relaxation, exchange and chemical shift evolution. R = rcpmg_3d(R1A=r10a, R1B=r10b, R2A=R2A_si_mi, R2B=R2B_si_mi, pA=pA, pB=pB, dw=dw_si_mi, k_AB=k_AB, k_BA=k_BA) @@ -144,10 +144,10 @@ # Loop over the time points, back calculating the R2eff values. for di in range(num_points_si_mi): # Extract the values from the higher dimensional arrays. -tcp_si_mi_di = tcp[0][si][mi][0][di] -inv_tcpmg_si_mi_di = inv_tcpmg[0][si][mi][0][di] -power_si_mi_di = int(power[0][si][mi][0][di]) -r20a_si_mi_di = r20a[0][si][mi][0][di] +tcp_si_mi_di = tcp[0, si, mi, 0, di] +inv_tcpmg_si_mi_di = inv_tcpmg[0, si, mi, 0, di] +power_si_mi_di = int(power[0, si, mi, 0, di]) +r20a_si_mi_di = r20a[0, si, mi, 0, di] # Initial magnetisation. Mint = M0 @@ -169,9 +169,9 @@ # The next lines calculate the R2eff using a two-point approximation, i.e. assuming that the decay is mono-exponential. Mx = Mint[1] / pA if Mx = 0.0 or isNaN(Mx): -back_calc[0][si][mi][0][di] = r20a_si_mi_di +back_calc[0, si, mi, 0, di] = r20a_si_mi_di else: -back_calc[0][si][mi][0][di] = - inv_tcpmg_si_mi_di * log(Mx) +back_calc[0, si, mi, 0, di] = - inv_tcpmg_si_mi_di * log(Mx) # Replace data in array. # If dw is zero. Modified: branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py?rev=24033r1=24032r2=24033view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py Tue Jun 17 14:53:49 2014 @@ -142,10 +142,10 @@ for mi in range(NM): # Extract the values from the higher dimensional arrays. -R2A_si_mi=r20a[0][si][mi][0][0] -R2B_si_mi=r20b[0][si][mi][0][0] -dw_si_mi = dw[0][si][mi][0][0] -num_points_si_mi = int(num_points[0][si][mi][0]) +R2A_si_mi=r20a[0, si, mi, 0, 0] +R2B_si_mi=r20b[0, si, mi, 0, 0] +dw_si_mi = dw[0, si, mi, 0, 0] +num_points_si_mi = int(num_points[0, si, mi, 0]) # The matrix that contains only the R2 relaxation terms (Redfield relaxation, i.e. non-exchange broadening). Rr[0, 0] = -R2A_si_mi @@ -164,10 +164,10 @@ # Loop over the time points, back calculating the R2eff values. for di in range(num_points_si_mi): # Extract the values from the higher dimensional arrays. -tcp_si_mi_di = tcp[0][si][mi][0][di] -inv_tcpmg_si_mi_di = inv_tcpmg[0][si][mi][0][di] -power_si_mi_di = int(power[0][si][mi][0][di]) -r20a_si_mi_di = r20a[0][si][mi][0][di] +tcp_si_mi_di = tcp[0, si, mi, 0, di] +inv_tcpmg_si_mi_di = inv_tcpmg[0, si, mi, 0, di] +power_si_mi_di = int(power[0, si, mi, 0, di]) +r20a_si_mi_di = r20a[0, si, mi, 0, di] # This matrix is a propagator
r24034 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 14:53:50 2014 New Revision: 24034 URL: http://svn.gna.org/viewcvs/relax?rev=24034view=rev Log: Restructured target function for ns mmq 3site to the new API structure of higher dimensional data. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24034r1=24033r2=24034view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 14:53:50 2014 @@ -225,9 +225,14 @@ self.r20_struct = deepcopy(numpy_array_zeros) self.r20a_struct = deepcopy(numpy_array_zeros) self.r20b_struct = deepcopy(numpy_array_zeros) +self.r20c_struct = deepcopy(numpy_array_zeros) # Structure of dw. The full and the outer dimensions structures. self.dw_struct = deepcopy(numpy_array_zeros) self.dwH_struct = deepcopy(numpy_array_zeros) +self.dw_AB_struct = deepcopy(numpy_array_zeros) +self.dw_AC_struct = deepcopy(numpy_array_zeros) +self.dwH_AB_struct = deepcopy(numpy_array_zeros) +self.dwH_AC_struct = deepcopy(numpy_array_zeros) self.phi_ex_struct = deepcopy(numpy_array_zeros) # Structure of values, errors and missing. @@ -682,63 +687,67 @@ self.M0[1] = pB self.M0[2] = pC -# Initialise. -chi2_sum = 0.0 +# Convert dw from ppm to rad/s. Use the out argument, to pass directly to structure. +multiply( multiply.outer( dw_AB.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs, out=self.dw_AB_struct ) +multiply( multiply.outer( dw_AC.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs, out=self.dw_AC_struct ) +multiply( multiply.outer( dwH_AB.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs_H, out=self.dwH_AB_struct ) +multiply( multiply.outer( dwH_AC.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs_H, out=self.dwH_AC_struct ) + +# Reshape R20A and R20B to per experiment, spin and frequency. +self.r20a_struct[:] = multiply.outer( R20A.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) +self.r20b_struct[:] = multiply.outer( R20B.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) +self.r20c_struct[:] = multiply.outer( R20C.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) # Loop over the experiment types. for ei in range(self.num_exp): -# Loop over the spins. -for si in range(self.num_spins): -# Loop over the spectrometer frequencies. -for mi in range(self.num_frq): -# The R20 index. -r20_index = mi + ei*self.num_frq + si*self.num_frq*self.num_exp - -# Convert dw from ppm to rad/s. -dw_AB_frq = dw_AB[si] * self.frqs[ei, si, mi, 0, 0] -dw_AC_frq = dw_AC[si] * self.frqs[ei, si, mi, 0, 0] -dwH_AB_frq = dwH_AB[si] * self.frqs_H[ei, si, mi, 0, 0] -dwH_AC_frq = dwH_AC[si] * self.frqs_H[ei, si, mi, 0, 0] - -# Alias the dw frequency combinations. -aliased_dwH_AB = 0.0 -aliased_dwH_AC = 0.0 -if self.exp_types[ei] == EXP_TYPE_CPMG_SQ: -aliased_dw_AB = dw_AB_frq -aliased_dw_AC = dw_AC_frq -elif self.exp_types[ei] == EXP_TYPE_CPMG_PROTON_SQ: -aliased_dw_AB = dwH_AB_frq -aliased_dw_AC = dwH_AC_frq -elif self.exp_types[ei] == EXP_TYPE_CPMG_DQ: -aliased_dw_AB = dw_AB_frq + dwH_AB_frq -aliased_dw_AC = dw_AC_frq + dwH_AC_frq -elif self.exp_types[ei] == EXP_TYPE_CPMG_ZQ: -aliased_dw_AB = dw_AB_frq - dwH_AB_frq -aliased_dw_AC = dw_AC_frq - dwH_AC_frq -elif self.exp_types[ei] == EXP_TYPE_CPMG_MQ: -aliased_dw_AB = dw_AB_frq -aliased_dw_AC = dw_AC_frq -aliased_dwH_AB = dwH_AB_frq -aliased_dwH_AC = dwH_AC_frq -elif self.exp_types[ei] == EXP_TYPE_CPMG_PROTON_MQ: -aliased_dw_AB = dwH_AB_frq -aliased_dw_AC = dwH_AC_frq -aliased_dwH_AB = dw_AB_frq -aliased_dwH_AC = dw_AC_frq - -# Back calculate the R2eff values for each experiment type
r24037 - in /branches/disp_spin_speed: ./ lib/dispersion/lm63_3site.py
Author: tlinnet Date: Tue Jun 17 14:57:33 2014 New Revision: 24037 URL: http://svn.gna.org/viewcvs/relax?rev=24037view=rev Log: Merged revisions 24028 via svnmerge from svn+ssh://tlin...@svn.gna.org/svn/relax/trunk r24028 | bugman | 2014-06-17 14:03:14 +0200 (Tue, 17 Jun 2014) | 6 lines Fix for bug #22210 (https://gna.org/bugs/?22210), the failure of the 'LM63 3-site' dispersion model. The problem is described in the bug report - the multiplication in the tanh() function is a mistake, it must be a division. Modified: branches/disp_spin_speed/ (props changed) branches/disp_spin_speed/lib/dispersion/lm63_3site.py Propchange: branches/disp_spin_speed/ -- --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Jun 17 14:57:33 2014 @@ -1 +1 @@ -/trunk:1-24024 +/trunk:1-24036 Modified: branches/disp_spin_speed/lib/dispersion/lm63_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/lm63_3site.py?rev=24037r1=24036r2=24037view=diff == --- branches/disp_spin_speed/lib/dispersion/lm63_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/lm63_3site.py Tue Jun 17 14:57:33 2014 @@ -104,5 +104,5 @@ # The full formula. else: back_calc[i] = r20 -back_calc[i] += rex_B * (1.0 - cpmg_frqs[i] * tanh(quart_kB * cpmg_frqs[i]) / quart_kB) -back_calc[i] += rex_C * (1.0 - cpmg_frqs[i] * tanh(quart_kC * cpmg_frqs[i]) / quart_kC) +back_calc[i] += rex_B * (1.0 - cpmg_frqs[i] * tanh(quart_kB / cpmg_frqs[i]) / quart_kB) +back_calc[i] += rex_C * (1.0 - cpmg_frqs[i] * tanh(quart_kC / cpmg_frqs[i]) / quart_kC) ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24038 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 15:08:26 2014 New Revision: 24038 URL: http://svn.gna.org/viewcvs/relax?rev=24038view=rev Log: Documentation fix for the initial data structure of cpmg_frqs, spin_lock_nu1, r1. They were incorrect. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24038r1=24037r2=24038view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 15:08:26 2014 @@ -130,18 +130,18 @@ @type frqs: rank-3 list of floats @keyword frqs_H:The proton spin Larmor frequencies for the MMQ-type models (in MHz*2pi to speed up the ppm to rad/s conversion). The dimensions are {Ei, Si, Mi}. @type frqs_H: rank-3 list of floats -@keyword cpmg_frqs: The CPMG frequencies in Hertz. This will be ignored for R1rho experiments. The dimensions are {Ei, Mi}. -@type cpmg_frqs:rank-2 list of floats -@keyword spin_lock_nu1: The spin-lock field strengths in Hertz. This will be ignored for CPMG experiments. The dimensions are {Ei, Mi}. -@type spin_lock_nu1:rank-2 list of floats +@keyword cpmg_frqs: The CPMG frequencies in Hertz. This will be ignored for R1rho experiments. The dimensions are {Ei, Mi, Oi}. +@type cpmg_frqs:rank-3 list of floats +@keyword spin_lock_nu1: The spin-lock field strengths in Hertz. This will be ignored for CPMG experiments. The dimensions are {Ei, Mi, Oi}. +@type spin_lock_nu1:rank-3 list of floats @keyword chemical_shifts: The chemical shifts in rad/s. This is only used for off-resonance R1rho models. The ppm values are not used to save computation time, therefore they must be converted to rad/s by the calling code. The dimensions are {Ei, Si, Mi}. @type chemical_shifts: rank-3 list of floats @keyword offset:The structure of spin-lock or hard pulse offsets in rad/s. This is only currently used for off-resonance R1rho models. The dimensions are {Ei, Si, Mi, Oi}. @type offset: rank-4 list of floats @keyword tilt_angles: The spin-lock rotating frame tilt angle. This is only used for off-resonance R1rho models. The dimensions are {Ei, Si, Mi, Oi, Di}. @type tilt_angles: rank-5 list of floats -@keyword r1:The R1 relaxation rates. This is only used for off-resonance R1rho models. The dimensions are {Ei, Si, Mi}. -@type r1: rank-3 list of floats +@keyword r1:The R1 relaxation rates. This is only used for off-resonance R1rho models. The dimensions are {Si, Mi}. +@type r1: rank-2 list of floats @keyword relax_times: The experiment specific fixed time period for relaxation (in seconds). The dimensions are {Ei, Mi}. @type relax_times: rank-2 list of floats @keyword scaling_matrix:The square and diagonal scaling matrix. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24039 - in /branches/disp_spin_speed/lib/dispersion: ns_mmq_2site.py ns_mmq_3site.py
Author: tlinnet Date: Tue Jun 17 15:49:54 2014 New Revision: 24039 URL: http://svn.gna.org/viewcvs/relax?rev=24039view=rev Log: Fix for shortening the variables names. 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_mmq_2site.py branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py?rev=24039r1=24038r2=24039view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py Tue Jun 17 15:49:54 2014 @@ -142,18 +142,18 @@ # Loop over offsets: for oi in range(NO): -r20a_si_mi_oi = R20A[si, mi, oi, 0] -r20b_si_mi_oi = R20B[si, mi, oi, 0] -dw_si_mi_oi = dw[si, mi, oi, 0] -dwH_si_mi_oi = dwH[si, mi, oi, 0] -num_points_si_mi_oi = num_points[si, mi, oi] +r20a_i = R20A[si, mi, oi, 0] +r20b_i = R20B[si, mi, oi, 0] +dw_i = dw[si, mi, oi, 0] +dwH_i = dwH[si, mi, oi, 0] +num_points_i = num_points[si, mi, oi] # Populate the m1 and m2 matrices (only once per function call for speed). -populate_matrix(matrix=m1, R20A=r20a_si_mi_oi, R20B=r20b_si_mi_oi, dw=-dw_si_mi_oi - dwH_si_mi_oi, k_AB=k_AB, k_BA=k_BA) # D+ matrix component. -populate_matrix(matrix=m2, R20A=r20a_si_mi_oi, R20B=r20b_si_mi_oi, dw=dw_si_mi_oi - dwH_si_mi_oi, k_AB=k_AB, k_BA=k_BA)# Z- matrix component. +populate_matrix(matrix=m1, R20A=r20a_i, R20B=r20b_i, dw=-dw_i - dwH_i, k_AB=k_AB, k_BA=k_BA) # D+ matrix component. +populate_matrix(matrix=m2, R20A=r20a_i, R20B=r20b_i, dw=dw_i - dwH_i, k_AB=k_AB, k_BA=k_BA)# Z- matrix component. # Loop over the time points, back calculating the R2eff values. -for i in range(num_points_si_mi_oi): +for i in range(num_points_i): # The M1 and M2 matrices. M1 = matrix_exponential(m1*tcp[si, mi, oi, i])# Equivalent to D+. M2 = matrix_exponential(m2*tcp[si, mi, oi, i])# Equivalent to Z-. @@ -292,17 +292,17 @@ # Loop over offsets: for oi in range(NO): -r20a_si_mi_oi = R20A[si, mi, oi, 0] -r20b_si_mi_oi = R20B[si, mi, oi, 0] -dw_si_mi_oi = dw[si, mi, oi, 0] -num_points_si_mi_oi = num_points[si, mi, oi] +r20a_i = R20A[si, mi, oi, 0] +r20b_i = R20B[si, mi, oi, 0] +dw_i = dw[si, mi, oi, 0] +num_points_i = num_points[si, mi, oi] # Populate the m1 and m2 matrices (only once per function call for speed). -populate_matrix(matrix=m1, R20A=r20a_si_mi_oi , R20B=r20b_si_mi_oi, dw=dw_si_mi_oi, k_AB=k_AB, k_BA=k_BA) -populate_matrix(matrix=m2, R20A=r20a_si_mi_oi , R20B=r20b_si_mi_oi, dw=-dw_si_mi_oi, k_AB=k_AB, k_BA=k_BA) +populate_matrix(matrix=m1, R20A=r20a_i , R20B=r20b_i, dw=dw_i, k_AB=k_AB, k_BA=k_BA) +populate_matrix(matrix=m2, R20A=r20a_i , R20B=r20b_i, dw=-dw_i, k_AB=k_AB, k_BA=k_BA) # Loop over the time points, back calculating the R2eff values. -for i in range(num_points_si_mi_oi): +for i in range(num_points_i): # The A+/- matrices. A_pos = matrix_exponential(m1*tcp[si, mi, oi, i]) A_neg = matrix_exponential(m2*tcp[si, mi, oi, i]) Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py?rev=24039r1=24038r2=24039view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py Tue Jun 17 15:49:54 2014 @@ -185,22 +185,22 @@ # Loop over offsets: for oi in range(NO): -r20a_si_mi_oi = R20A[si, mi, oi, 0] -r20b_si_mi_oi = R20B[si, mi, oi, 0] -r20c_si_mi_oi = R20C[si, mi, oi, 0] - -dw_AB_si_mi_oi=dw_AB[si, mi, oi, 0] -dw_AC_si_mi_oi=dw_AC[si, mi, oi, 0] -dwH_AB_si_mi_oi=dwH_AB[si, mi, oi, 0] -dwH_AC_si_mi_oi=dwH_AC[si, mi, oi, 0] -num_points_si_mi_oi = num_points[si, mi, oi] +r20a_i = R20A[si, mi, oi, 0
r24042 - /branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py
Author: tlinnet Date: Tue Jun 17 16:51:47 2014 New Revision: 24042 URL: http://svn.gna.org/viewcvs/relax?rev=24042view=rev Log: First attempt to implement lib function for ns r1rho 2site. But it does not work yet. 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_r1rho_2site.py Modified: branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py?rev=24042r1=24041r2=24042view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py Tue Jun 17 16:51:47 2014 @@ -58,7 +58,7 @@ from lib.linear_algebra.matrix_exponential import matrix_exponential -def ns_r1rho_2site(M0=None, matrix=None, r1rho_prime=None, omega=None, offset=None, r1=0.0, pA=None, pB=None, dw=None, k_AB=None, k_BA=None, spin_lock_fields=None, relax_time=None, inv_relax_time=None, back_calc=None, num_points=None): +def ns_r1rho_2site(M0=None, matrix=None, r1rho_prime=None, omega=None, offset=None, r1=0.0, pA=None, pB=None, dw=None, k_AB=None, k_BA=None, spin_lock_fields=None, relax_time=None, inv_relax_time=None, back_calc=None, num_points=None, num_offsets=None): The 2-site numerical solution to the Bloch-McConnell equation for R1rho data. This function calculates and stores the R1rho values. @@ -98,34 +98,54 @@ @type num_points: int -# Repetitive calculations (to speed up calculations). -Wa = omega # Larmor frequency [s^-1]. -Wb = omega + dw # Larmor frequency [s^-1]. -W = pA*Wa + pB*Wb # Population-averaged Larmor frequency [s^-1]. -dA = Wa - offset# Offset of spin-lock from A. -dB = Wb - offset# Offset of spin-lock from B. -d = W - offset # Offset of spin-lock from population-average. +# Extract shape of experiment. +NE, NS, NM, NO = num_points.shape -# Loop over the time points, back calculating the R2eff values. -for i in range(num_points): -# The matrix that contains all the contributions to the evolution, i.e. relaxation, exchange and chemical shift evolution. -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) +# Loop over spins. +for si in range(NS): +# Loop over the spectrometer frequencies. +for mi in range(NM): +# Loop over offsets: +for oi in range(num_offsets[0, si, mi]): -# The following lines rotate the magnetization previous to spin-lock into the weff frame. -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. +omega_i = omega[0, si, mi, oi, 0] +offset_i = offset[0, si, mi, oi, 0] +r1_i = r1[0, si, mi, oi, 0] +dw_i = dw[0, si, mi, oi, 0] -# This matrix is a propagator that will evolve the magnetization with the matrix R. -Rexpo = matrix_exponential(matrix*relax_time[i]) +r1rho_prime_i = r1rho_prime[0, si, mi, oi] +spin_lock_fields_i = spin_lock_fields[0, si, mi, oi] +relax_time_i = relax_time[0, si, mi, oi] +inv_relax_time_i = relax_time[0, si, mi, oi] +back_calc_i = back_calc[0, si, mi, oi] +num_points_i = num_points[0, si, mi, oi] -# Magnetization evolution. -MA = dot(M0, dot(Rexpo, M0)) +# Repetitive calculations (to speed up calculations). +Wa = omega_i # Larmor frequency [s^-1]. +Wb = omega_i + dw_i # Larmor frequency [s^-1]. +W = pA*Wa + pB*Wb # Population-averaged Larmor frequency [s^-1]. +dA = Wa - offset_i# Offset of spin-lock from A. +dB = Wb - offset_i# Offset of spin-lock from B. +d = W - offset_i # Offset of spin-lock from population-average. -# The next lines calculate the R1rho using a two-point approximation, i.e. assuming that the decay is mono-exponential. -if MA = 0.0 or isNaN(MA): -back_calc[i] = 1e99 -else: -back_calc[i]= -inv_relax_time[i] * log(MA) +# Loop over the time points, back calculating the R2eff values. +for j in range(num_points_i): +# The matrix that contains all the contributions to the evolution, i.e. relaxation, exchange and chemical shift evolution. +rr1rho_3d
r24041 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 16:51:45 2014 New Revision: 24041 URL: http://svn.gna.org/viewcvs/relax?rev=24041view=rev Log: First attempt to implement target function for ns_r1rho_2site. But it does not work yet. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24041r1=24040r2=24041view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 16:51:45 2014 @@ -1655,34 +1655,25 @@ k_BA = pA * kex k_AB = pB * kex -# Chi-squared initialisation. -chi2_sum = 0.0 - -# Loop over the spins. -for si in range(self.num_spins): -# Loop over the spectrometer frequencies. -for mi in range(self.num_frq): -# The R20 index. -r20_index = mi + si*self.num_frq - -# Convert dw from ppm to rad/s. -dw_frq = dw[si] * self.frqs[0, si, mi, 0, 0] - -# Loop over the offsets. -for oi in range(self.num_offsets[0, si, mi]): -# Back calculate the R2eff values. -ns_r1rho_2site(M0=self.M0, matrix=self.matrix, r1rho_prime=r1rho_prime[r20_index], omega=self.chemical_shifts[0, si, mi, oi, 0], offset=self.offset[0, si, mi, oi, 0], r1=self.r1[0, si, mi, oi, 0], pA=pA, pB=pB, dw=dw_frq, k_AB=k_AB, k_BA=k_BA, spin_lock_fields=self.spin_lock_omega1[0, si, mi, oi], relax_time=self.relax_times[0, si, mi, oi], inv_relax_time=self.inv_relax_times[0, si, mi, oi], back_calc=self.back_calc[0, si, mi, oi], num_points=self.num_disp_points[0, si, mi, oi]) - -# 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, oi]): -if self.missing[0, si, mi, oi, di]: -self.back_calc[0, si, mi, oi, di] = self.values[0, si, mi, oi, di] - -# Calculate and return the chi-squared value. -chi2_sum += chi2(self.values[0, si, mi, oi], self.back_calc[0, si, mi, oi], self.errors[0, si, mi, oi]) +# Convert dw from ppm to rad/s. Use the out argument, to pass directly to structure. +multiply( multiply.outer( dw.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs, out=self.dw_struct ) + +# Reshape R20 to per experiment, spin and frequency. +self.r20_struct[:] = multiply.outer( r1rho_prime.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) + +# Back calculate the R2eff values. +ns_r1rho_2site(M0=self.M0, matrix=self.matrix, r1rho_prime=self.r20_struct, omega=self.chemical_shifts, offset=self.offset, r1=self.r1, pA=pA, pB=pB, dw=self.dw_struct, k_AB=k_AB, k_BA=k_BA, spin_lock_fields=self.spin_lock_omega1, relax_time=self.relax_times, inv_relax_time=self.inv_relax_times, back_calc=self.back_calc, num_points=self.num_disp_points, num_offsets=self.num_offsets) + +# Clean the data for all values, which is left over at the end of arrays. +self.back_calc = self.back_calc*self.disp_struct + +## 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. +if self.has_missing: +# Replace with values. +self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] # Return the total chi-squared value. -return chi2_sum +return chi2_rankN(self.values, self.back_calc, self.errors) def func_ns_r1rho_3site(self, params): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24044 - in /branches/disp_spin_speed: ./ docs/Release_Checklist test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Tue Jun 17 17:06:56 2014 New Revision: 24044 URL: http://svn.gna.org/viewcvs/relax?rev=24044view=rev Log: Merged revisions 24040,24043 via svnmerge from svn+ssh://tlin...@svn.gna.org/svn/relax/trunk r24040 | bugman | 2014-06-17 15:56:47 +0200 (Tue, 17 Jun 2014) | 9 lines Fixes for all of the relaxation dispersion system tests which were failing with the new minfx code. Due to the tuning of the log barrier constraint algorithm in minfx in the commit at http://article.gmane.org/gmane.science.mathematics.minfx.scm/25, many system tests needed to be slightly adjusted. Two of the Relax_disp.test_tp02_data_to_* system tests were also failing as the optimisation can no longer move out of the minimum at pA = 0.5 for one spin (due to the low quality grid search in the auto-analysis). r24043 | bugman | 2014-06-17 17:02:17 +0200 (Tue, 17 Jun 2014) | 3 lines Updated the release checklist document for the new 1.0.7 release of minfx. Modified: branches/disp_spin_speed/ (props changed) branches/disp_spin_speed/docs/Release_Checklist branches/disp_spin_speed/test_suite/system_tests/relax_disp.py [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/disp_spin_speed/docs/Release_Checklist URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/docs/Release_Checklist?rev=24044r1=24043r2=24044view=diff Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24044r1=24043r2=24044view=diff ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24050 - in /branches/disp_spin_speed: ./ specific_analyses/relax_disp/sherekhan.py test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Tue Jun 17 18:24:27 2014 New Revision: 24050 URL: http://svn.gna.org/viewcvs/relax?rev=24050view=rev Log: Merged revisions 24047-24049 via svnmerge from svn+ssh://tlin...@svn.gna.org/svn/relax/trunk r24047 | bugman | 2014-06-17 17:57:06 +0200 (Tue, 17 Jun 2014) | 7 lines Fixes for the Relax_disp.test_hansen_cpmg_data_missing_auto_analysis system test. The pA parameter is no longer tested for one spin as it moves to random values on different operating systems and 32 vs. 64-bit systems. This is because this spin experiences no exchange, both dw and kex are zero. r24048 | bugman | 2014-06-17 18:05:23 +0200 (Tue, 17 Jun 2014) | 5 lines Decreased the value checking precision in the Relax_disp.test_hansen_cpmg_data_to_lm63 system test. This is to allow the test to pass on certain operating systems and 32-bit systems. r24049 | bugman | 2014-06-17 18:22:38 +0200 (Tue, 17 Jun 2014) | 7 lines Modified the precision of the output from the relax_disp.sherekhan_input user function. This is simply to allow the Relax_disp.test_sod1wt_t25_to_sherekhan_input system test to pass on certain 32-bit systems, as the float output to 15 decimal places is not always the same. This system test has been updated for the change. Modified: branches/disp_spin_speed/ (props changed) branches/disp_spin_speed/specific_analyses/relax_disp/sherekhan.py branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Propchange: branches/disp_spin_speed/ -- --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Jun 17 18:24:27 2014 @@ -1 +1 @@ -/trunk:1-24043 +/trunk:1-24049 Modified: branches/disp_spin_speed/specific_analyses/relax_disp/sherekhan.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/specific_analyses/relax_disp/sherekhan.py?rev=24050r1=24049r2=24050view=diff == --- branches/disp_spin_speed/specific_analyses/relax_disp/sherekhan.py (original) +++ branches/disp_spin_speed/specific_analyses/relax_disp/sherekhan.py Tue Jun 17 18:24:27 2014 @@ -130,7 +130,7 @@ continue # Store the data. -lines.append(%20.15g %20.15g %20.15g\n % (point, spins[i].r2eff[param_key], spins[i].r2eff_err[param_key])) +lines.append(%20.15g %20.13g %20.13g\n % (point, spins[i].r2eff[param_key], spins[i].r2eff_err[param_key])) # No data. if len(lines) == 1: Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24050r1=24049r2=24050view=diff == --- branches/disp_spin_speed/test_suite/system_tests/relax_disp.py (original) +++ branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Tue Jun 17 18:24:27 2014 @@ -2234,9 +2234,9 @@ print(%-20s %20.15g %20.15g %20.15g\n % (chi2, spin4.chi2, spin70.chi2, spin71.chi2)) self.assertAlmostEqual(spin4.r2[r20_key1], 1.60463650370664, 2) self.assertAlmostEqual(spin4.r2[r20_key2], 1.63221675941434, 3) -self.assertAlmostEqual(spin4.pA, 0.818979078699935, 3) -self.assertAlmostEqual(spin4.dw, 5.07483389476542e-14, 3) -self.assertAlmostEqual(spin4.kex/1, 2.29004732365492e-12/1, 3) +#self.assertAlmostEqual(spin4.pA, 0.818979078699935, 3)# As dw (and kex) is zero, this parameter is not stable. +self.assertAlmostEqual(spin4.dw, 0.0, 6) +self.assertAlmostEqual(spin4.kex/1, 0.0, 3) self.assertAlmostEqual(spin4.chi2, 26.7356711142038, 3) self.assertAlmostEqual(spin70.r2[r20_key1], 6.97268077496405, 3) self.assertAlmostEqual(spin70.r2[r20_key2], 9.41028133407727, 3) @@ -2481,17 +2481,17 @@ print(%-20s %20.15g %20.15g\n % (chi2, spin70.chi2, spin71.chi2)) # Checks for residue :70. -self.assertAlmostEqual(spin70.r2[r20_key1], 6.7436229263957) -self.assertAlmostEqual(spin70.r2[r20_key2], 6.57406788826655) -self.assertAlmostEqual(spin70.phi_ex, 0.31273301746411) -self.assertAlmostEqual(spin70.kex/1000, 4723.09901154387/1000) -self.assertAlmostEqual(spin70.chi2, 363.534044873483) +self.assertAlmostEqual(spin70.r2[r20_key1], 6.7436229263957, 5) +self.assertAlmostEqual(spin70.r2[r20_key2], 6.57406788826655, 5) +self.assertAlmostEqual(spin70.phi_ex, 0.31273301746411, 5) +self.assertAlmostEqual(spin70.kex/1000, 4723.09901154387/1000, 5) +self.assertAlmostEqual(spin70.chi2, 363.534044873483, 5) # Checks for residue :71. -self.assertAlmostEqual(spin71.r2[r20_key1
r24052 - in /branches/disp_spin_speed: ./ test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Tue Jun 17 18:46:01 2014 New Revision: 24052 URL: http://svn.gna.org/viewcvs/relax?rev=24052view=rev Log: Merged revisions 24051 via svnmerge from svn+ssh://tlin...@svn.gna.org/svn/relax/trunk r24051 | bugman | 2014-06-17 18:27:39 +0200 (Tue, 17 Jun 2014) | 6 lines Modified the Relax_disp.test_sprangers_data_to_mmq_cr72 system test to pass on certain systems. This test fails on 32-bit Linux (and probably other systems as well). To fix the test, the kex values are all divided by 100 before checking them to 4 decimal places of accuracy. Modified: branches/disp_spin_speed/ (props changed) branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Propchange: branches/disp_spin_speed/ -- --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Jun 17 18:46:01 2014 @@ -1 +1 @@ -/trunk:1-24049 +/trunk:1-24051 Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24052r1=24051r2=24052view=diff == --- branches/disp_spin_speed/test_suite/system_tests/relax_disp.py (original) +++ branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Tue Jun 17 18:46:01 2014 @@ -5434,7 +5434,7 @@ self.assertAlmostEqual(spin135S.pA, 0.836591714049569, 4) self.assertAlmostEqual(spin135S.dw, 0.583003004605869, 4) self.assertAlmostEqual(spin135S.dwH, 0.0361441894065963, 4) -self.assertAlmostEqual(spin135S.kex, 241.806464344233, 4) +self.assertAlmostEqual(spin135S.kex/100, 241.806464344233/100, 4) self.assertAlmostEqual(spin135S.chi2, 12.4224060116473, 4) # Checks for residue :135F. @@ -5443,7 +5443,7 @@ self.assertAlmostEqual(spin135F.pA, 0.836591714049569, 4) self.assertAlmostEqual(spin135F.dw, 0.805849748711916, 4) self.assertAlmostEqual(spin135F.dwH, 0.0215791669142752, 4) -self.assertAlmostEqual(spin135F.kex, 241.806464344233, 4) +self.assertAlmostEqual(spin135F.kex/100, 241.806464344233/100, 4) self.assertAlmostEqual(spin135F.chi2, 12.4224060116473, 4) # Checks for residue :137S. @@ -5452,7 +5452,7 @@ self.assertAlmostEqual(spin137S.pA, 0.836591714049569, 4) self.assertAlmostEqual(spin137S.dw, 0.688107406812537, 4) self.assertAlmostEqual(spin137S.dwH, 0.034446357344577, 4) -self.assertAlmostEqual(spin137S.kex, 241.806464344233, 4) +self.assertAlmostEqual(spin137S.kex/100, 241.806464344233/100, 4) self.assertAlmostEqual(spin137S.chi2, 12.4224060116473, 4) # Checks for residue :137F. @@ -5461,7 +5461,7 @@ self.assertAlmostEqual(spin137F.pA, 0.836591714049569, 4) self.assertAlmostEqual(spin137F.dw, 0.94978325541294, 4) self.assertAlmostEqual(spin137F.dwH, 1.5189362257653e-07, 4) -self.assertAlmostEqual(spin137F.kex, 241.806464344233, 4) +self.assertAlmostEqual(spin137F.kex/100, 241.806464344233/100, 4) self.assertAlmostEqual(spin137F.chi2, 12.4224060116473, 4) ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24053 - /branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py
Author: tlinnet Date: Tue Jun 17 19:04:51 2014 New Revision: 24053 URL: http://svn.gna.org/viewcvs/relax?rev=24053view=rev Log: Fatal fix for calling inv_relax_time from relax_time variable. 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_r1rho_2site.py Modified: branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py?rev=24053r1=24052r2=24053view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py Tue Jun 17 19:04:51 2014 @@ -116,7 +116,7 @@ r1rho_prime_i = r1rho_prime[0, si, mi, oi] spin_lock_fields_i = spin_lock_fields[0, si, mi, oi] relax_time_i = relax_time[0, si, mi, oi] -inv_relax_time_i = relax_time[0, si, mi, oi] +inv_relax_time_i = inv_relax_time[0, si, mi, oi] back_calc_i = back_calc[0, si, mi, oi] num_points_i = num_points[0, si, mi, oi] ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24054 - in /branches/disp_spin_speed: lib/dispersion/ns_r1rho_2site.py target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 19:08:19 2014 New Revision: 24054 URL: http://svn.gna.org/viewcvs/relax?rev=24054view=rev Log: Removal of the temporary offset argument. 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_r1rho_2site.py branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py?rev=24054r1=24053r2=24054view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py Tue Jun 17 19:08:19 2014 @@ -58,7 +58,7 @@ from lib.linear_algebra.matrix_exponential import matrix_exponential -def ns_r1rho_2site(M0=None, matrix=None, r1rho_prime=None, omega=None, offset=None, r1=0.0, pA=None, pB=None, dw=None, k_AB=None, k_BA=None, spin_lock_fields=None, relax_time=None, inv_relax_time=None, back_calc=None, num_points=None, num_offsets=None): +def ns_r1rho_2site(M0=None, matrix=None, r1rho_prime=None, omega=None, offset=None, r1=0.0, pA=None, pB=None, dw=None, k_AB=None, k_BA=None, spin_lock_fields=None, relax_time=None, inv_relax_time=None, back_calc=None, num_points=None): The 2-site numerical solution to the Bloch-McConnell equation for R1rho data. This function calculates and stores the R1rho values. @@ -106,7 +106,7 @@ # Loop over the spectrometer frequencies. for mi in range(NM): # Loop over offsets: -for oi in range(num_offsets[0, si, mi]): +for oi in range(NO): omega_i = omega[0, si, mi, oi, 0] offset_i = offset[0, si, mi, oi, 0] Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24054r1=24053r2=24054view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 19:08:19 2014 @@ -1662,7 +1662,7 @@ self.r20_struct[:] = multiply.outer( r1rho_prime.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) # Back calculate the R2eff values. -ns_r1rho_2site(M0=self.M0, matrix=self.matrix, r1rho_prime=self.r20_struct, omega=self.chemical_shifts, offset=self.offset, r1=self.r1, pA=pA, pB=pB, dw=self.dw_struct, k_AB=k_AB, k_BA=k_BA, spin_lock_fields=self.spin_lock_omega1, relax_time=self.relax_times, inv_relax_time=self.inv_relax_times, back_calc=self.back_calc, num_points=self.num_disp_points, num_offsets=self.num_offsets) +ns_r1rho_2site(M0=self.M0, matrix=self.matrix, r1rho_prime=self.r20_struct, omega=self.chemical_shifts, offset=self.offset, r1=self.r1, pA=pA, pB=pB, dw=self.dw_struct, k_AB=k_AB, k_BA=k_BA, spin_lock_fields=self.spin_lock_omega1, relax_time=self.relax_times, inv_relax_time=self.inv_relax_times, back_calc=self.back_calc, num_points=self.num_disp_points) # Clean the data for all values, which is left over at the end of arrays. self.back_calc = self.back_calc*self.disp_struct ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24055 - /branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py
Author: tlinnet Date: Tue Jun 17 19:11:07 2014 New Revision: 24055 URL: http://svn.gna.org/viewcvs/relax?rev=24055view=rev Log: Documentation fix for the dimensionality of the input arrays. 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_r1rho_2site.py Modified: branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py?rev=24055r1=24054r2=24055view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py Tue Jun 17 19:11:07 2014 @@ -69,33 +69,33 @@ @keyword matrix:A numpy array to be populated to create the evolution matrix. @type matrix: numpy rank-2, 6D float64 array @keyword r1rho_prime: The R1rho_prime parameter value (R1rho with no exchange). -@type r1rho_prime: float +@type r1rho_prime: numpy float array of rank [NS][NM][NO][ND] @keyword omega: The chemical shift for the spin in rad/s. -@type omega:float +@type omega:numpy float array of rank [NS][NM][NO][ND] @keyword offset:The spin-lock offsets for the data. -@type offset: numpy rank-1 float array +@type offset: numpy float array of rank [NS][NM][NO][ND] @keyword r1:The R1 relaxation rate. -@type r1: float +@type r1: numpy float array of rank [NS][NM][NO][ND] @keyword pA:The population of state A. @type pA: float @keyword pB:The population of state B. @type pB: float @keyword dw:The chemical exchange difference between states A and B in rad/s. -@type dw: float +@type dw: numpy float array of rank [NS][NM][NO][ND] @keyword k_AB: The rate of exchange from site A to B (rad/s). @type k_AB: float @keyword k_BA: The rate of exchange from site B to A (rad/s). @type k_BA: float @keyword spin_lock_fields: The R1rho spin-lock field strengths (in rad.s^-1). -@type spin_lock_fields: numpy rank-1 float array +@type spin_lock_fields: numpy float array of rank [NS][NM][NO][ND] @keyword relax_time:The total relaxation time period for each spin-lock field strength (in seconds). -@type relax_time: float +@type relax_time: numpy float array of rank [NS][NM][NO][ND] @keyword inv_relax_time:The inverse of the relaxation time period for each spin-lock field strength (in inverse seconds). This is used for faster calculations. -@type inv_relax_time: float +@type inv_relax_time: numpy float array of rank [NS][NM][NO][ND] @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. -@type back_calc:numpy rank-1 float array +@type back_calc:numpy float array of rank [NS][NM][NO][ND] @keyword num_points:The number of points on the dispersion curve, equal to the length of the tcp and back_calc arguments. -@type num_points: int +@type num_points: numpy int array of rank [NS][NM][NO] # Extract shape of experiment. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24056 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 19:27:10 2014 New Revision: 24056 URL: http://svn.gna.org/viewcvs/relax?rev=24056view=rev Log: Implemented the target function for ns r1rho 3site. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24056r1=24055r2=24056view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 19:27:10 2014 @@ -784,35 +784,26 @@ k_AC = pC * kex_AC / pA_pC dw_AC = dw_AB + dw_BC -# Initialise. -chi2_sum = 0.0 - -# Loop over the spins. -for si in range(self.num_spins): -# Loop over the spectrometer frequencies. -for mi in range(self.num_frq): -# The R20 index. -r20_index = mi + si*self.num_frq - -# Convert dw from ppm to rad/s. -dw_AB_frq = dw_AB[si] * self.frqs[0, si, mi, 0, 0] -dw_AC_frq = dw_AC[si] * self.frqs[0, si, mi, 0, 0] - -# Loop over the offsets. -for oi in range(self.num_offsets[0, si, mi]): -# Back calculate the R2eff values for each experiment type. -ns_r1rho_3site(M0=self.M0, matrix=self.matrix, r1rho_prime=r1rho_prime[r20_index], omega=self.chemical_shifts[0, si, mi, oi, 0], offset=self.offset[0, si, mi, oi, 0], r1=self.r1[0, si, mi, oi, 0], pA=pA, pB=pB, pC=pC, dw_AB=dw_AB_frq, dw_AC=dw_AC_frq, k_AB=k_AB, k_BA=k_BA, k_BC=k_BC, k_CB=k_CB, k_AC=k_AC, k_CA=k_CA, spin_lock_fields=self.spin_lock_omega1[0, si, mi, oi], relax_time=self.relax_times[0, si, mi, oi], inv_relax_time=self.inv_relax_times[0, si, mi, oi], back_calc=self.back_calc[0, si, mi, oi], num_points=self.num_disp_points[0, si, mi, oi]) - -# 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, oi]): -if self.missing[0, si, mi, oi, di]: -self.back_calc[0, si, mi, oi, di] = self.values[0, si, mi, oi, di] - -# Calculate and return the chi-squared value. -chi2_sum += chi2(self.values[0, si, mi, oi], self.back_calc[0, si, mi, oi], self.errors[0, si, mi, oi]) +# Convert dw from ppm to rad/s. Use the out argument, to pass directly to structure. +multiply( multiply.outer( dw_AB.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs, out=self.dw_AB_struct ) +multiply( multiply.outer( dw_AC.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs, out=self.dw_AC_struct ) + +# Reshape R20 to per experiment, spin and frequency. +self.r20_struct[:] = multiply.outer( r1rho_prime.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) + +# Back calculate the R2eff values for each experiment type. +ns_r1rho_3site(M0=self.M0, matrix=self.matrix, r1rho_prime=self.r20_struct, omega=self.chemical_shifts, offset=self.offset, r1=self.r1, pA=pA, pB=pB, pC=pC, dw_AB=self.dw_AB_struct, dw_AC=self.dw_AC_struct, k_AB=k_AB, k_BA=k_BA, k_BC=k_BC, k_CB=k_CB, k_AC=k_AC, k_CA=k_CA, spin_lock_fields=self.spin_lock_omega1, relax_time=self.relax_times, inv_relax_time=self.inv_relax_times, back_calc=self.back_calc, num_points=self.num_disp_points) + +# Clean the data for all values, which is left over at the end of arrays. +self.back_calc = self.back_calc*self.disp_struct + +## 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. +if self.has_missing: +# Replace with values. +self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] # Return the total chi-squared value. -return chi2_sum +return chi2_rankN(self.values, self.back_calc, self.errors) def experiment_type_setup(self): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24057 - /branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py
Author: tlinnet Date: Tue Jun 17 19:27:12 2014 New Revision: 24057 URL: http://svn.gna.org/viewcvs/relax?rev=24057view=rev Log: Implemented the lib function for ns r1rho 3site. 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_r1rho_3site.py Modified: branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py?rev=24057r1=24056r2=24057view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py Tue Jun 17 19:27:12 2014 @@ -75,13 +75,13 @@ @keyword matrix:A numpy array to be populated to create the evolution matrix. @type matrix: numpy rank-2, 9D float64 array @keyword r1rho_prime: The R1rho_prime parameter value (R1rho with no exchange). -@type r1rho_prime: float +@type r1rho_prime: numpy float array of rank [NS][NM][NO][ND] @keyword omega: The chemical shift for the spin in rad/s. -@type omega:float +@type omega:numpy float array of rank [NS][NM][NO][ND] @keyword offset:The spin-lock offsets for the data. -@type offset: numpy rank-1 float array +@type offset: numpy float array of rank [NS][NM][NO][ND] @keyword r1:The R1 relaxation rate. -@type r1: float +@type r1: numpy float array of rank [NS][NM][NO][ND] @keyword pA:The population of state A. @type pA: float @keyword pB:The population of state B. @@ -89,9 +89,9 @@ @keyword pC:The population of state C. @type pC: float @keyword dw_AB: The chemical exchange difference between states A and B in rad/s. -@type dw_AB:float +@type dw_AB:numpy float array of rank [NS][NM][NO][ND] @keyword dw_AC: The chemical exchange difference between states A and C in rad/s. -@type dw_AC:float +@type dw_AC:numpy float array of rank [NS][NM][NO][ND] @keyword k_AB: The rate of exchange from site A to B (rad/s). @type k_AB: float @keyword k_BA: The rate of exchange from site B to A (rad/s). @@ -105,45 +105,68 @@ @keyword k_CA: The rate of exchange from site C to A (rad/s). @type k_CA: float @keyword spin_lock_fields: The R1rho spin-lock field strengths (in rad.s^-1). -@type spin_lock_fields: numpy rank-1 float array +@type spin_lock_fields: numpy float array of rank [NS][NM][NO][ND] @keyword relax_time:The total relaxation time period for each spin-lock field strength (in seconds). -@type relax_time: float +@type relax_time: numpy float array of rank [NS][NM][NO][ND] @keyword inv_relax_time:The inverse of the relaxation time period for each spin-lock field strength (in inverse seconds). This is used for faster calculations. -@type inv_relax_time: float +@type inv_relax_time: numpy float array of rank [NS][NM][NO][ND] @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. -@type back_calc:numpy rank-1 float array +@type back_calc:numpy float array of rank [NS][NM][NO][ND] @keyword num_points:The number of points on the dispersion curve, equal to the length of the tcp and back_calc arguments. -@type num_points: int +@type num_points: numpy int array of rank [NS][NM][NO] -# Repetitive calculations (to speed up calculations). -Wa = omega # Larmor frequency for state A [s^-1]. -Wb = omega + dw_AB # Larmor frequency for state B [s^-1]. -Wc = omega + dw_AC # Larmor frequency for state C [s^-1]. -W = pA*Wa + pB*Wb + pC*Wc # Population-averaged Larmor frequency [s^-1]. -dA = Wa - offset# Offset of spin-lock from A. -dB = Wb - offset# Offset of spin-lock from B. -dC = Wc - offset# Offset of spin-lock from C. -d = W - offset # Offset of spin-lock from population-average. +# Extract shape of experiment. +NE, NS, NM, NO = num_points.shape -# Loop over the time points, back calculating the R2eff values. -for i in range(num_points): -# The matrix that contains all the contributions to the evolution, i.e. relaxation, exchange and chemical shift
r24059 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 20:26:37 2014 New Revision: 24059 URL: http://svn.gna.org/viewcvs/relax?rev=24059view=rev Log: Implemented target function for LM63 3site. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24059r1=24058r2=24059view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 20:26:37 2014 @@ -234,6 +234,8 @@ self.dwH_AB_struct = deepcopy(numpy_array_zeros) self.dwH_AC_struct = deepcopy(numpy_array_zeros) self.phi_ex_struct = deepcopy(numpy_array_zeros) +self.phi_ex_B_struct = deepcopy(numpy_array_zeros) +self.phi_ex_C_struct = deepcopy(numpy_array_zeros) # Structure of values, errors and missing. self.values = deepcopy(numpy_array_zeros) @@ -1060,34 +1062,26 @@ quart_kB = kB / 4.0 quart_kC = kC / 4.0 -# Initialise. -chi2_sum = 0.0 - -# Loop over the spins. -for si in range(self.num_spins): -# Loop over the spectrometer frequencies. -for mi in range(self.num_frq): -# The R20 index. -r20_index = mi + si*self.num_frq - -# Convert phi_ex (or rex) from ppm^2 to (rad/s)^2. -rex_B_scaled = rex_B[si] * self.frqs_squared[0, si, mi, 0, 0] -rex_C_scaled = rex_C[si] * self.frqs_squared[0, si, mi, 0, 0] - -# Back calculate the R2eff values. -r2eff_LM63_3site(r20=R20[r20_index], rex_B=rex_B_scaled, rex_C=rex_C_scaled, quart_kB=quart_kB, quart_kC=quart_kC, cpmg_frqs=self.cpmg_frqs[0, si, mi, 0], 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]): -if self.missing[0, si, mi, 0, di]: -self.back_calc[0, si, mi, 0, di] = self.values[0, si, mi, 0, di] - -# Calculate and return the chi-squared value. -chi2_sum += chi2(self.values[0, si, mi, 0], self.back_calc[0, si, mi, 0], self.errors[0, si, mi, 0]) +# Convert phi_ex (or rex) from ppm^2 to (rad/s)^2. +multiply( multiply.outer( rex_B.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs_squared, out=self.phi_ex_B_struct ) +multiply( multiply.outer( rex_C.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs_squared, out=self.phi_ex_C_struct ) + +# Reshape R20 to per experiment, spin and frequency. +self.r20_struct[:] = multiply.outer( R20.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) + +# Back calculate the R2eff values. +r2eff_LM63_3site(r20=self.r20_struct, rex_B=self.phi_ex_B_struct, rex_C=self.phi_ex_C_struct, quart_kB=quart_kB, quart_kC=quart_kC, cpmg_frqs=self.cpmg_frqs, back_calc=self.back_calc, num_points=self.num_disp_points) + +# Clean the data for all values, which is left over at the end of arrays. +self.back_calc = self.back_calc*self.disp_struct + +## 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. +if self.has_missing: +# Replace with values. +self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] # Return the total chi-squared value. -return chi2_sum - +return chi2_rankN(self.values, self.back_calc, self.errors) def func_LM63(self, params): Target function for the Luz and Meiboom (1963) fast 2-site exchange model. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24061 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Tue Jun 17 20:26:41 2014 New Revision: 24061 URL: http://svn.gna.org/viewcvs/relax?rev=24061view=rev Log: Removed the number of disp points in target function for LM63 3site, since it is no Ãlonger used, but have been replaced with mask replacements. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24061r1=24060r2=24061view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Tue Jun 17 20:26:41 2014 @@ -1070,7 +1070,7 @@ self.r20_struct[:] = multiply.outer( R20.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) # Back calculate the R2eff values. -r2eff_LM63_3site(r20=self.r20_struct, rex_B=self.phi_ex_B_struct, rex_C=self.phi_ex_C_struct, quart_kB=quart_kB, quart_kC=quart_kC, cpmg_frqs=self.cpmg_frqs, back_calc=self.back_calc, num_points=self.num_disp_points) +r2eff_LM63_3site(r20=self.r20_struct, rex_B=self.phi_ex_B_struct, rex_C=self.phi_ex_C_struct, quart_kB=quart_kB, quart_kC=quart_kC, cpmg_frqs=self.cpmg_frqs, back_calc=self.back_calc) # Clean the data for all values, which is left over at the end of arrays. self.back_calc = self.back_calc*self.disp_struct ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24060 - /branches/disp_spin_speed/lib/dispersion/lm63_3site.py
Author: tlinnet Date: Tue Jun 17 20:26:39 2014 New Revision: 24060 URL: http://svn.gna.org/viewcvs/relax?rev=24060view=rev Log: Implemented the lib function for LM63 3site, for higher dimensional data. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/lib/dispersion/lm63_3site.py Modified: branches/disp_spin_speed/lib/dispersion/lm63_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/lm63_3site.py?rev=24060r1=24059r2=24060view=diff == --- branches/disp_spin_speed/lib/dispersion/lm63_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/lm63_3site.py Tue Jun 17 20:26:39 2014 @@ -64,45 +64,74 @@ # Python module imports. -from math import tanh +from numpy import any, fabs, min, tanh, isfinite, sum +from numpy.ma import fix_invalid, masked_where -def r2eff_LM63_3site(r20=None, rex_B=None, rex_C=None, quart_kB=None, quart_kC=None, cpmg_frqs=None, back_calc=None, num_points=None): +def r2eff_LM63_3site(r20=None, rex_B=None, rex_C=None, quart_kB=None, quart_kC=None, cpmg_frqs=None, back_calc=None): Calculate the R2eff values for the LM63 3-site model. See the module docstring for details. @keyword r20: The R20 parameter value (R2 with no exchange). -@type r20: float +@type r20: numpy float array of rank [NS][NM][NO][ND] @keyword rex_B: The phi_ex_B / kB parameter value. -@type rex_B:float +@type rex_B:numpy float array of rank [NS][NM][NO][ND] @keyword rex_C: The phi_ex_C / kC parameter value. -@type rex_C:float +@type rex_C:numpy float array of rank [NE][NS][NM][NO][ND] @keyword quart_kB: Approximate chemical exchange rate constant between sites A and B (the exchange rate in rad/s) divided by 4. @type quart_kB: float @keyword quart_kC: Approximate chemical exchange rate constant between sites A and C (the exchange rate in rad/s) divided by 4. @type quart_kC: float @keyword cpmg_frqs: The CPMG nu1 frequencies. -@type cpmg_frqs:numpy rank-1 float array +@type cpmg_frqs:numpy float array of rank [NE][NS][NM][NO][ND] @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. -@type back_calc:numpy rank-1 float array -@keyword num_points:The number of points on the dispersion curve, equal to the length of the cpmg_frqs and back_calc arguments. -@type num_points: int +@type back_calc:numpy float array of rank [NE][NS][NM][NO][ND] -# Loop over the time points, back calculating the R2eff values. -for i in range(num_points): -# Catch zeros. -if rex_B == 0.0 and rex_C == 0.0: -back_calc[i] = r20 +# Flag to tell if values should be replaced. +t_rex_zero = False +t_quart_kB_zero = False +t_quart_kC_zero = False +t_quart_kB_kC_zero = False -# Avoid divide by zero. -elif quart_kB == 0.0 or quart_kC == 0.0: -back_calc[i] = 1e100 +# Avoid divide by zero. +if quart_kB == 0.0: +t_quart_kB_zero = True -# The full formula. -else: -back_calc[i] = r20 -back_calc[i] += rex_B * (1.0 - cpmg_frqs[i] * tanh(quart_kB / cpmg_frqs[i]) / quart_kB) -back_calc[i] += rex_C * (1.0 - cpmg_frqs[i] * tanh(quart_kC / cpmg_frqs[i]) / quart_kC) +if quart_kC == 0.0: +t_quart_kC_zero = True + +# Test it both is zero. +if t_quart_kB_zero and t_quart_kC_zero: +t_quart_kB_kC_zero = True + +# Test if rex is zero. Wait for replacement, since this is spin specific. +if min(fabs(rex_B)) == 0.0 and min(fabs(rex_C)) == 0.0: +t_rex_zero = True +mask_rex_B_zero = masked_where(rex_B == 0.0, rex_B) +mask_rex_C_zero = masked_where(rex_C == 0.0, rex_C) + +# Replace data in array. +# If both quart_kB and quart_kC is zero. +if t_quart_kB_kC_zero: +back_calc[:] = r20 +elif t_quart_kB_zero: +back_calc[:] = r20 + rex_C * (1.0 - cpmg_frqs * tanh(quart_kC / cpmg_frqs) / quart_kC) +elif t_quart_kC_zero: +back_calc[:] = r20 + rex_B * (1.0 - cpmg_frqs * tanh(quart_kB / cpmg_frqs) / quart_kB) +else: +# Calc R2eff. +back_calc[:] = r20 + rex_B * (1.0 - cpmg_frqs * tanh(quart_kB / cpmg_frqs) / quart_kB) + rex_C * (1.0 - cpmg_frqs * tanh(quart_kC / cpmg_frqs) / quart_kC) + +# If rex is zero. +if t_rex_zero: +back_calc[mask_rex_B_zero.mask] = r20[mask_rex_B_zero.mask] +back_calc[mask_rex_C_zero.mask] = r20[mask_rex_C_zero.mask] + +# Catch errors, taking a sum over
r24064 - /branches/disp_spin_speed/specific_analyses/relax_disp/data.py
Author: tlinnet Date: Wed Jun 18 09:25:49 2014 New Revision: 24064 URL: http://svn.gna.org/viewcvs/relax?rev=24064view=rev Log: Removed superfluous check, after the returned data is now in right structure. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/specific_analyses/relax_disp/data.py Modified: branches/disp_spin_speed/specific_analyses/relax_disp/data.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/specific_analyses/relax_disp/data.py?rev=24064r1=24063r2=24064view=diff == --- branches/disp_spin_speed/specific_analyses/relax_disp/data.py (original) +++ branches/disp_spin_speed/specific_analyses/relax_disp/data.py Wed Jun 18 09:25:49 2014 @@ -1854,9 +1854,6 @@ # Loop over the dispersion points. for di in range(len(back_calc[ei][0][mi][oi])): -# Back calc can have more points in end of array. -if di len(cpmg_frqs_new[ei][mi][oi]) - 1: -continue # Skip invalid points (values of 1e100). if back_calc[ei][0][mi][oi][di] 1e50: continue ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24063 - /branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py
Author: tlinnet Date: Wed Jun 18 09:25:48 2014 New Revision: 24063 URL: http://svn.gna.org/viewcvs/relax?rev=24063view=rev Log: Used the new class function: get_back_calc(), to get the data in the right structures when interpolating for graphs. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py Modified: branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py?rev=24063r1=24062r2=24063view=diff == --- branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py (original) +++ branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py Wed Jun 18 09:25:48 2014 @@ -192,7 +192,7 @@ spin.chi2 = chi2 # Return the structure. -return model.back_calc +return model.get_back_calc() def calculate_r2eff(): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24062 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Wed Jun 18 09:25:45 2014 New Revision: 24062 URL: http://svn.gna.org/viewcvs/relax?rev=24062view=rev Log: Implemented class function in target class, to return back_calc values as list of lists. This is the back and forth conversion between the data structures implemented when gathering the data, and the data send to the library function of higher dimensionality. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24062r1=24061r2=24062view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Wed Jun 18 09:25:45 2014 @@ -55,7 +55,7 @@ from lib.errors import RelaxError from lib.float import isNaN from target_functions.chi2 import chi2, chi2_rankN -from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_DQ, EXP_TYPE_CPMG_MQ, EXP_TYPE_CPMG_PROTON_MQ, EXP_TYPE_CPMG_PROTON_SQ, EXP_TYPE_CPMG_SQ, EXP_TYPE_CPMG_ZQ, EXP_TYPE_R1RHO, MODEL_B14, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_LIST_CPMG, MODEL_LIST_CPMG_FULL, MODEL_LIST_FULL, MODEL_LIST_MMQ, MODEL_LIST_MQ_CPMG, MODEL_LIST_R1RHO, MODEL_LIST_R1RHO_FULL, MODEL_LM63, MODEL_LM63_3SITE, MODEL_M61, MODEL_M61B, MODEL_MP05, MODEL_MMQ_CR72, MODEL_NOREX, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_STAR_FULL, MODEL_NS_MMQ_2SITE, MODEL_NS_MMQ_3SITE, MODEL_NS_MMQ_3SITE_LINEAR, MODEL_NS_R1RHO_2SITE, MODEL_NS_R1RHO_3SITE, MODEL_NS_R1RHO_3SITE_LINEAR, MODEL_TAP03, MODEL_TP02, MODEL_TSMFK01 +from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_DQ, EXP_TYPE_CPMG_MQ, EXP_TYPE_CPMG_PROTON_MQ, EXP_TYPE_CPMG_PROTON_SQ, EXP_TYPE_CPMG_SQ, EXP_TYPE_CPMG_ZQ, EXP_TYPE_LIST_CPMG, EXP_TYPE_R1RHO, MODEL_B14, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_LIST_CPMG, MODEL_LIST_CPMG_FULL, MODEL_LIST_FULL, MODEL_LIST_MMQ, MODEL_LIST_MQ_CPMG, MODEL_LIST_R1RHO, MODEL_LIST_R1RHO_FULL, MODEL_LM63, MODEL_LM63_3SITE, MODEL_M61, MODEL_M61B, MODEL_MP05, MODEL_MMQ_CR72, MODEL_NOREX, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_STAR_FULL, MODEL_NS_MMQ_2SITE, MODEL_NS_MMQ_3SITE, MODEL_NS_MMQ_3SITE_LINEAR, MODEL_NS_R1RHO_2SITE, MODEL_NS_R1RHO_3SITE, MODEL_NS_R1RHO_3SITE_LINEAR, MODEL_TAP03, MODEL_TP02, MODEL_TSMFK01 class Dispersion: @@ -172,6 +172,9 @@ self.num_frq = num_frq self.exp_types = exp_types self.scaling_matrix = scaling_matrix +self.values_orig = values +self.cpmg_frqs_orig = cpmg_frqs +self.spin_lock_nu1_orig = spin_lock_nu1 ### Initialise higher order numpy structures. # Define the shape of all the numpy arrays. @@ -1831,3 +1834,28 @@ # Return the total chi-squared value. return chi2_rankN(self.values, self.back_calc, self.errors) + +def get_back_calc(self): +Class function to return back_calc as lists of lists. Number of values in should match number of dispersion points or spin_lock. + +@return:back_calc in structure of list of lists. +@rtype: float + + +back_calc_return = deepcopy(self.values_orig) + +# Loop over experiments +for ei in range(self.NE): +exp_type = self.exp_types[ei] +for si in range(self.NS): +for mi in range(self.NM): +for oi in range(self.NO): +back_calc_return[ei][si][mi].append([]) +if exp_type in EXP_TYPE_LIST_CPMG: +num = len(self.cpmg_frqs_orig[ei][mi][oi]) +else: +num = len(self.spin_lock_nu1_orig[ei][mi][oi]) +back_calc_return[ei][si][mi][oi][:] = self.back_calc[ei, si, mi, oi, :num] + +return back_calc_return + ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24065 - /branches/disp_spin_speed/test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Wed Jun 18 09:41:11 2014 New Revision: 24065 URL: http://svn.gna.org/viewcvs/relax?rev=24065view=rev Log: Made changes to the dir argument of systemtest Relax_disp.test_r1rho_kjaergaard. This is to prepare for: sr #3124 (https://gna.org/support/?3124): Grace graphs production for R1rho analysis with R2_eff as function of Omega_eff sr #3138 (https://gna.org/support/?3138): Interpolating theta through spin-lock offset [Omega], rather than spin-lock field strength [w1] This is also to test an expected bug, if R1 is not loaded. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24065r1=24064r2=24065view=diff ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24071 - /branches/disp_spin_speed/test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Wed Jun 18 10:30:02 2014 New Revision: 24071 URL: http://svn.gna.org/viewcvs/relax?rev=24071view=rev Log: Split systemtest test_r1rho_kjaergaard into test_r1rho_kjaergaard_auto and test_r1rho_kjaergaard_man. This is to test use of the manual way to analyse. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24071r1=24070r2=24071view=diff ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24070 - /branches/disp_spin_speed/test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Wed Jun 18 10:30:00 2014 New Revision: 24070 URL: http://svn.gna.org/viewcvs/relax?rev=24070view=rev Log: Renamed systemtes test_r1rho_kjaergaard to test_r1rho_kjaergaard_auto. This corresponds to the use of the automatic analysis method. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24070r1=24069r2=24070view=diff == --- branches/disp_spin_speed/test_suite/system_tests/relax_disp.py (original) +++ branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Wed Jun 18 10:30:00 2014 @@ -58,7 +58,7 @@ test_bug_21344_sparse_time_spinlock_acquired_r1rho_fail_relax_disp, test_exp_fit, test_m61_exp_data_to_m61, -test_r1rho_kjaergaard, +test_r1rho_kjaergaard_auto, test_value_write_calc_rotating_frame_params_auto_analysis ] @@ -4224,10 +4224,12 @@ self.assertAlmostEqual(cdp.mol[0].res[0].spin[0].chi2, 0.030959849811015544, 3) -def test_r1rho_kjaergaard(self): +def test_r1rho_kjaergaard_auto(self): Optimisation of the Kjaergaard et al., 2013 Off-resonance R1rho relaxation dispersion experiments using the 'DPL' model. This uses the data from Kjaergaard's paper at U{DOI: 10.1021/bi4001062http://dx.doi.org/10.1021/bi4001062}. + +This uses the automatic analysis. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24073 - /branches/disp_spin_speed/test_suite/system_tests/relax_disp.py
Author: tlinnet Date: Wed Jun 18 10:35:42 2014 New Revision: 24073 URL: http://svn.gna.org/viewcvs/relax?rev=24073view=rev Log: Implemented systemtest test_r1rho_kjaergaard_missing_r1, for safety check if R1 data is not loaded. The systemtest passes, so target function is safe. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=24073r1=24072r2=24073view=diff == --- branches/disp_spin_speed/test_suite/system_tests/relax_disp.py (original) +++ branches/disp_spin_speed/test_suite/system_tests/relax_disp.py Wed Jun 18 10:35:42 2014 @@ -60,6 +60,7 @@ test_m61_exp_data_to_m61, test_r1rho_kjaergaard_auto, test_r1rho_kjaergaard_man, +test_r1rho_kjaergaard_missing_r1, test_value_write_calc_rotating_frame_params_auto_analysis ] @@ -4587,6 +4588,80 @@ self.assert_(access(result_dir_name+sep+'resultsR1'+sep+'final'+sep+'theta.out', F_OK)) +def test_r1rho_kjaergaard_missing_r1(self): +Optimisation of the Kjaergaard et al., 2013 Off-resonance R1rho relaxation dispersion experiments using the 'DPL' model. + +This uses the data from Kjaergaard's paper at U{DOI: 10.1021/bi4001062http://dx.doi.org/10.1021/bi4001062}. + +This uses the automatic analysis, with missing loading R1. + + + +# Cluster residues +cluster_ids = [ +:13@N, +:15@N, +:16@N, +:25@N, +:26@N, +:28@N, +:39@N, +:40@N, +:41@N, +:43@N, +:44@N, +:45@N, +:49@N, +:52@N, +:53@N] + +# Load the data. +self.setup_r1rho_kjaergaard(cluster_ids=cluster_ids, read_R1=False) + +# The dispersion models. +MODELS = ['R2eff', 'DPL94'] + +# The grid search size (the number of increments per dimension). +GRID_INC = 4 + +# The number of Monte Carlo simulations to be used for error analysis at the end of the analysis. +MC_NUM = 3 + +# Model selection technique. +MODSEL = 'AIC' + +# Execute the auto-analysis (fast). +# Standard parameters are: func_tol=1e-25, grad_tol=None, max_iter=1000, +OPT_FUNC_TOL = 1e-1 +relax_disp.Relax_disp.opt_func_tol = OPT_FUNC_TOL +OPT_MAX_ITERATIONS = 1000 +relax_disp.Relax_disp.opt_max_iterations = OPT_MAX_ITERATIONS + +result_dir_name = ds.tmpdir + +# Make all spins free +for curspin in cluster_ids: +self.interpreter.relax_disp.cluster('free spins', curspin) +# Shut them down +self.interpreter.deselect.spin(spin_id=curspin, change_all=False) + +# Select only a subset of spins for global fitting +#self.interpreter.select.spin(spin_id=':41@N', change_all=False) +#self.interpreter.relax_disp.cluster('model_cluster', ':41@N') + +#self.interpreter.select.spin(spin_id=':40@N', change_all=False) +#self.interpreter.relax_disp.cluster('model_cluster', ':40@N') + +self.interpreter.select.spin(spin_id=':52@N', change_all=False) +#self.interpreter.relax_disp.cluster('model_cluster', ':52@N') + +# Run the analysis. +relax_disp.Relax_disp(pipe_name=ds.pipe_name, pipe_bundle=ds.pipe_bundle, results_dir=result_dir_name, models=MODELS, grid_inc=GRID_INC, mc_sim_num=MC_NUM, modsel=MODSEL) + +# Check the kex value of residue 52 +#self.assertAlmostEqual(cdp.mol[0].res[41].spin[0].kex, ds.ref[':52@N'][6]) + + def test_r2eff_read(self): Test the operation of the relax_disp.r2eff_read user function. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24075 - /branches/disp_spin_speed/target_functions/relax_disp.py
Author: tlinnet Date: Wed Jun 18 10:44:04 2014 New Revision: 24075 URL: http://svn.gna.org/viewcvs/relax?rev=24075view=rev Log: Replaced double or triple hash-tags ## with single hash-tags #. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24075r1=24074r2=24075view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Wed Jun 18 10:44:04 2014 @@ -176,7 +176,7 @@ self.cpmg_frqs_orig = cpmg_frqs self.spin_lock_nu1_orig = spin_lock_nu1 -### Initialise higher order numpy structures. +# Initialise higher order numpy structures. # Define the shape of all the numpy arrays. # The total numbers of experiments, number of spins, number of magnetic field strength, maximum number of offsets, maximum number of dispersion point. self.NE = len(self.exp_types) @@ -351,7 +351,7 @@ # Get the tilt angles. self.tilt_angles[ei, si, mi, oi, di] = tilt_angles[ei][si][mi][oi][di] self.offset[ei, si, mi, oi] = offset[ei][si][mi][oi] -## Convert the spin-lock data to rad.s^-1. +# Convert the spin-lock data to rad.s^-1. self.spin_lock_omega1[ei, si, mi, oi, di] = 2.0 * pi * spin_lock_nu1[ei][mi][oi][di] self.spin_lock_omega1_squared[ei, si, mi, oi, di] = self.spin_lock_omega1[ei, si, mi, oi, di] ** 2 @@ -521,7 +521,7 @@ # Clean the data for all values, which is left over at the end of arrays. self.back_calc = self.back_calc*self.disp_struct -## 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 all missing data points, set the back-calculated value to the measured values so that it has no effect on the chi-squared value. if self.has_missing: # Replace with values. self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] @@ -554,18 +554,18 @@ self.r20a_struct[:] = multiply.outer( R20A.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) self.r20b_struct[:] = multiply.outer( R20B.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) -## Back calculate the R2eff values. +# Back calculate the R2eff values. r2eff_CR72(r20a=self.r20a_struct, r20a_orig=R20A, r20b=self.r20b_struct, r20b_orig=R20B, pA=pA, dw=self.dw_struct, dw_orig=dw, kex=kex, cpmg_frqs=self.cpmg_frqs, back_calc=self.back_calc) # Clean the data for all values, which is left over at the end of arrays. self.back_calc = self.back_calc*self.disp_struct -## 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. -if self.has_missing: -# Replace with values. -self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] - -## Calculate the chi-squared statistic. +# 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. +if self.has_missing: +# Replace with values. +self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] + +# Calculate the chi-squared statistic. return chi2_rankN(self.values, self.back_calc, self.errors) @@ -599,12 +599,12 @@ # Clean the data for all values, which is left over at the end of arrays. self.back_calc = self.back_calc*self.disp_struct -## 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. -if self.has_missing: -# Replace with values. -self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] - -## Calculate the chi-squared statistic. +# 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. +if self.has_missing: +# Replace with values. +self.back_calc[self.mask_replace_blank.mask] = self.values[self.mask_replace_blank.mask] + +# Calculate the chi-squared statistic. return chi2_rankN(self.values
r24076 - /branches/disp_spin_speed/lib/dispersion/
Author: tlinnet Date: Wed Jun 18 10:49:10 2014 New Revision: 24076 URL: http://svn.gna.org/viewcvs/relax?rev=24076view=rev Log: Copyright fixes for all the models, where Troels E. Linnet have made changes to make them functional for higher dimensional data. 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 branches/disp_spin_speed/lib/dispersion/dpl94.py branches/disp_spin_speed/lib/dispersion/it99.py branches/disp_spin_speed/lib/dispersion/lm63.py branches/disp_spin_speed/lib/dispersion/lm63_3site.py branches/disp_spin_speed/lib/dispersion/m61.py branches/disp_spin_speed/lib/dispersion/m61b.py branches/disp_spin_speed/lib/dispersion/mmq_cr72.py branches/disp_spin_speed/lib/dispersion/mp05.py branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_3d.py branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_expanded.py branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py branches/disp_spin_speed/lib/dispersion/tap03.py branches/disp_spin_speed/lib/dispersion/tp02.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=24076r1=24075r2=24076view=diff == --- branches/disp_spin_speed/lib/dispersion/cr72.py (original) +++ branches/disp_spin_speed/lib/dispersion/cr72.py Wed Jun 18 10:49:10 2014 @@ -2,6 +2,7 @@ # # # Copyright (C) 2009 Sebastien Morin # # Copyright (C) 2013-2014 Edward d'Auvergne # +# Copyright (C) 2014 Troels E. Linnet # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # Modified: branches/disp_spin_speed/lib/dispersion/dpl94.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/dpl94.py?rev=24076r1=24075r2=24076view=diff == --- branches/disp_spin_speed/lib/dispersion/dpl94.py(original) +++ branches/disp_spin_speed/lib/dispersion/dpl94.pyWed Jun 18 10:49:10 2014 @@ -2,6 +2,7 @@ # # # Copyright (C) 2009 Sebastien Morin # # Copyright (C) 2013-2014 Edward d'Auvergne # +# Copyright (C) 2014 Troels E. Linnet # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # Modified: branches/disp_spin_speed/lib/dispersion/it99.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/it99.py?rev=24076r1=24075r2=24076view=diff == --- branches/disp_spin_speed/lib/dispersion/it99.py (original) +++ branches/disp_spin_speed/lib/dispersion/it99.py Wed Jun 18 10:49:10 2014 @@ -2,6 +2,7 @@ # # # Copyright (C) 2009 Sebastien Morin # # Copyright (C) 2013-2014 Edward d'Auvergne # +# Copyright (C) 2014 Troels E. Linnet # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # Modified: branches/disp_spin_speed/lib/dispersion/lm63.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/lm63.py?rev=24076r1=24075r2=24076view=diff == --- branches/disp_spin_speed/lib/dispersion/lm63.py (original) +++ branches/disp_spin_speed/lib/dispersion/lm63.py Wed Jun 18 10:49:10 2014 @@ -2,6 +2,7 @@ # # # Copyright (C) 2009 Sebastien Morin # # Copyright (C) 2013-2014 Edward
r24077 - /branches/disp_spin_speed/lib/dispersion/tsmfk01.py
Author: tlinnet Date: Wed Jun 18 10:50:36 2014 New Revision: 24077 URL: http://svn.gna.org/viewcvs/relax?rev=24077view=rev Log: Copyright fix for model TSMFK01. Sebastien Morin did not take part of implementing the TSMK01 modelÃ. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/lib/dispersion/tsmfk01.py Modified: branches/disp_spin_speed/lib/dispersion/tsmfk01.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/tsmfk01.py?rev=24077r1=24076r2=24077view=diff == --- branches/disp_spin_speed/lib/dispersion/tsmfk01.py (original) +++ branches/disp_spin_speed/lib/dispersion/tsmfk01.py Wed Jun 18 10:50:36 2014 @@ -1,6 +1,5 @@ ### # # -# Copyright (C) 2009 Sebastien Morin # # Copyright (C) 2013-2014 Edward d'Auvergne # # Copyright (C) 2013 Troels E. Linnet # # # ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24081 - /branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py
Author: tlinnet Date: Wed Jun 18 11:37:12 2014 New Revision: 24081 URL: http://svn.gna.org/viewcvs/relax?rev=24081view=rev Log: Made the processor.return_object get the back_calc structure in the expected order. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py Modified: branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py?rev=24081r1=24080r2=24081view=diff == --- branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py (original) +++ branches/disp_spin_speed/specific_analyses/relax_disp/optimisation.py Wed Jun 18 11:37:12 2014 @@ -770,7 +770,7 @@ print(Simulation %s, cluster %s % (self.sim_index+1, self.spin_ids)) # Create the result command object to send back to the master. -processor.return_object(Disp_result_command(processor=processor, memo_id=self.memo_id, param_vector=param_vector, chi2=chi2, iter_count=iter_count, f_count=f_count, g_count=g_count, h_count=h_count, warning=warning, missing=self.missing, back_calc=model.back_calc, completed=False)) +processor.return_object(Disp_result_command(processor=processor, memo_id=self.memo_id, param_vector=param_vector, chi2=chi2, iter_count=iter_count, f_count=f_count, g_count=g_count, h_count=h_count, warning=warning, missing=self.missing, back_calc=model.get_back_calc(), completed=False)) ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24083 - in /branches/disp_spin_speed: ./ test_suite/verification_tests/library.py
Author: tlinnet Date: Wed Jun 18 11:46:33 2014 New Revision: 24083 URL: http://svn.gna.org/viewcvs/relax?rev=24083view=rev Log: Merged revisions 24058 via svnmerge from svn+ssh://tlin...@svn.gna.org/svn/relax/trunk r24058 | bugman | 2014-06-17 19:46:10 +0200 (Tue, 17 Jun 2014) | 6 lines Fix for the Library.test_library_independence verification test on MS Windows. The tearDown() method now uses the error handling test_suite.clean_up.deletion() function to remove the copied version of the relax library. Modified: branches/disp_spin_speed/ (props changed) branches/disp_spin_speed/test_suite/verification_tests/library.py Propchange: branches/disp_spin_speed/ -- --- svnmerge-integrated (original) +++ svnmerge-integrated Wed Jun 18 11:46:33 2014 @@ -1 +1 @@ -/trunk:1-24051 +/trunk:1-24082 Modified: branches/disp_spin_speed/test_suite/verification_tests/library.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/verification_tests/library.py?rev=24083r1=24082r2=24083view=diff == --- branches/disp_spin_speed/test_suite/verification_tests/library.py (original) +++ branches/disp_spin_speed/test_suite/verification_tests/library.py Wed Jun 18 11:46:33 2014 @@ -32,6 +32,7 @@ # relax module imports. from status import Status; status = Status() +from test_suite.clean_up import deletion class Library(TestCase): @@ -48,7 +49,7 @@ Clean up after the library tests. # Remove the temporary directory and all its contents. -rmtree(self.tmpdir) +deletion(obj=self, name='tmpdir', dir=True) def test_library_independence(self): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24091 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_dpl94.py
Author: tlinnet Date: Wed Jun 18 15:44:58 2014 New Revision: 24091 URL: http://svn.gna.org/viewcvs/relax?rev=24091view=rev Log: Added DPL94 profiling script. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_dpl94.py [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_dpl94.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_dpl94.py?rev=24091r1=24090r2=24091view=diff ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24092 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tsmfk01.py
Author: tlinnet Date: Wed Jun 18 15:58:31 2014 New Revision: 24092 URL: http://svn.gna.org/viewcvs/relax?rev=24092view=rev Log: Modified profiling script for TSMK01, to use correct parameters k_AB and r20a. Or else, the lib functions is just calculating with zero? Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tsmfk01.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tsmfk01.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tsmfk01.py?rev=24092r1=24091r2=24092view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tsmfk01.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tsmfk01.py Wed Jun 18 15:58:31 2014 @@ -110,7 +110,7 @@ Class Profile inherits the Dispersion container class object. -def __init__(self, num_spins=1, model=None, r2=None, r2a=None, r2b=None, dw=None, pA=None, kex=None, spins_params=None): +def __init__(self, num_spins=1, model=None, r2=None, r2a=None, r2b=None, dw=None, pA=None, kex=None, k_AB=None, spins_params=None): Special method __init__() is called first (acts as Constructor). It brings in data from outside the class like the variable num_spins. @@ -136,6 +136,8 @@ @type pA: float @keyword kex: The rate of exchange. @type kex: float +@keyword k_AB: The exchange rate from state A to state B +@type k_AB: float @keyword spins_params: List of parameter strings used in dispersion model. @type spins_params: array of strings @@ -172,7 +174,7 @@ self.error.append([1.0]*len(cpmg_point)) # Assemble param vector. -self.params = self.assemble_param_vector(r2=r2, r2a=r2a, r2b=r2b, dw=dw, pA=pA, kex=kex, spins_params=spins_params) +self.params = self.assemble_param_vector(r2=r2, r2a=r2a, r2b=r2b, dw=dw, pA=pA, kex=kex, k_AB=k_AB, spins_params=spins_params) # Make nested list arrays of data. And return them. values, errors, cpmg_frqs, missing, frqs, exp_types, relax_times, offsets = self.return_r2eff_arrays() @@ -316,7 +318,7 @@ return values, errors, cpmg_frqs, missing, frqs, exp_types, relax_times, offsets -def assemble_param_vector(self, r2=None, r2a=None, r2b=None, dw=None, pA=None, kex=None, spins_params=None): +def assemble_param_vector(self, r2=None, r2a=None, r2b=None, dw=None, pA=None, kex=None, k_AB=None, spins_params=None): Assemble the dispersion relaxation dispersion curve fitting parameter vector. @keyword r2:The transversal relaxation rate. @@ -331,6 +333,8 @@ @type pA: float @keyword kex: The rate of exchange. @type kex: float +@keyword k_AB: The exchange rate from state A to state B +@type k_AB: float @keyword spins_params: List of parameter strings used in dispersion model. @type spins_params: array of strings @return:An array of the parameter values of the dispersion relaxation model. @@ -357,6 +361,8 @@ value = pA elif param_name == 'kex': value = kex +elif param_name == 'k_AB': +value = k_AB # Add to the vector. param_vector.append(value) @@ -411,6 +417,8 @@ yield 'pA', 0, 0 elif param == 'kex': yield 'kex', 0, 0 +elif param == 'k_AB': +yield 'k_AB', 0, 0 def calc(self, params): @@ -441,7 +449,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, dw=3.0, k_AB=10.0, spins_params=['r2a', 'dw', 'k_AB']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -465,7 +473,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, dw=3.0, k_AB=10.0, spins_params=['r2a', 'dw', 'k_AB']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): @@ -476,38 +484,3 @@ # Execute main function. if __name__
r24093 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py
Author: tlinnet Date: Wed Jun 18 16:03:46 2014 New Revision: 24093 URL: http://svn.gna.org/viewcvs/relax?rev=24093view=rev Log: Changes to profiling script of ns_cpmg_2site_expanded. The model does not have r20a and r20b, but only r2. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py?rev=24093r1=24092r2=24093view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py Wed Jun 18 16:03:46 2014 @@ -442,7 +442,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -466,7 +466,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): @@ -477,38 +477,3 @@ # Execute main function. if __name__ == __main__: main() - -def test_reshape(): -C1 = Profile(num_spins=1, model=MODEL_NS_CPMG_2SITE_EXPANDED, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) -end_index = C1.model.end_index -#print(end_index:, end_index) -num_spins = C1.model.num_spins -#print(num_spins:, num_spins) -num_frq = C1.model.num_frq -#print(num_frq:, num_frq) -params = C1.params -#print(params, params) - -R20 = params[:end_index[1]].reshape(num_spins*2, num_frq) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = params[end_index[1]:end_index[2]] -pA = params[end_index[2]] -kex = params[end_index[2]+1] -print(R20A, R20A, len(R20A)) -print(R20B, R20B, len(R20B)) -print(dw, dw, len(dw)) -print(dw, pA) -print(kex, kex) - -for si in range(num_spins): -for mi in range(num_frq): -r20_index = mi + si*num_frq -r20a=R20A[r20_index] -r20b=R20B[r20_index] -print(r20a, r20a, r20b, r20b) - -model = C1.calc(params) -print(model) - -#test_reshape() ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24094 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py
Author: tlinnet Date: Wed Jun 18 16:07:10 2014 New Revision: 24094 URL: http://svn.gna.org/viewcvs/relax?rev=24094view=rev Log: Made changes to the profiling script of NS_CPMG_2SITE_3D. Need to use the full model, when r2a and r2b is specified. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py?rev=24094r1=24093r2=24094view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py Wed Jun 18 16:07:10 2014 @@ -424,7 +424,7 @@ # Return chi2 value. -chi2 = self.model.func_ns_cpmg_2site_3D(params) +chi2 = self.model.func_ns_cpmg_2site_3D_full(params) return chi2 ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24095 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py
Author: tlinnet Date: Wed Jun 18 16:17:42 2014 New Revision: 24095 URL: http://svn.gna.org/viewcvs/relax?rev=24095view=rev Log: Changes to profiling script of ns expanded. The unpacking can be removed. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py?rev=24095r1=24094r2=24095view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_expanded.py Wed Jun 18 16:17:42 2014 @@ -184,23 +184,6 @@ @rtype: lists of numpy float arrays, lists of numpy float arrays, lists of numpy float arrays, numpy rank-2 int array -# Unpack the parameter values. -# Initialise the post spin parameter indices. -end_index = [] -# The spin and frequency dependent R2 parameters. -end_index.append(len(self.exp_type) * self.num_spins * len(self.fields)) -if self.model in [MODEL_B14_FULL, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL]: -end_index.append(2 * len(self.exp_type) * self.num_spins * len(self.fields)) -# The spin and dependent parameters (phi_ex, dw, padw2). -end_index.append(end_index[-1] + self.num_spins) - -# Unpack the parameter values. -R20 = self.params[:end_index[1]].reshape(self.num_spins*2, len(self.fields)) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = self.params[end_index[1]:end_index[2]] -pA = self.params[end_index[2]] -kex = self.params[end_index[2]+1] # Initialise the data structures for the target function. exp_types = [] @@ -273,12 +256,7 @@ cpmg_frqs[ei][mi][oi] = self.points[mi] # Calculate how the value should be, so chi2 gets zero. -# The R20 index. -r20_index = mi + si*len(self.fields) -# Convert dw from ppm to rad/s. -dw_frq = dw[si] * frqs[ei][si][mi] -r20a=R20A[r20_index] -r20b=R20B[r20_index] + back_calc = array([0.0]*len(cpmg_frqs[ei][mi][oi])) for oi in range(len(self.offset)): @@ -466,7 +444,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=5000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24096 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py
Author: tlinnet Date: Wed Jun 18 16:33:46 2014 New Revision: 24096 URL: http://svn.gna.org/viewcvs/relax?rev=24096view=rev Log: Fix for the profiling script of NS cpmg 3D. The model should also be speciffied to full. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py?rev=24096r1=24095r2=24096view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py Wed Jun 18 16:33:46 2014 @@ -183,24 +183,6 @@ @return:The numpy array structures of the R2eff/R1rho values, errors, missing data, and corresponding Larmor frequencies. For each structure, the first dimension corresponds to the experiment types, the second the spins of a spin block, the third to the spectrometer field strength, and the fourth is the dispersion points. For the Larmor frequency structure, the fourth dimension is omitted. For R1rho-type data, an offset dimension is inserted between the spectrometer field strength and the dispersion points. @rtype: lists of numpy float arrays, lists of numpy float arrays, lists of numpy float arrays, numpy rank-2 int array - -# Unpack the parameter values. -# Initialise the post spin parameter indices. -end_index = [] -# The spin and frequency dependent R2 parameters. -end_index.append(len(self.exp_type) * self.num_spins * len(self.fields)) -if self.model in [MODEL_B14_FULL, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL]: -end_index.append(2 * len(self.exp_type) * self.num_spins * len(self.fields)) -# The spin and dependent parameters (phi_ex, dw, padw2). -end_index.append(end_index[-1] + self.num_spins) - -# Unpack the parameter values. -R20 = self.params[:end_index[1]].reshape(self.num_spins*2, len(self.fields)) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = self.params[end_index[1]:end_index[2]] -pA = self.params[end_index[2]] -kex = self.params[end_index[2]+1] # Initialise the data structures for the target function. exp_types = [] @@ -273,12 +255,6 @@ cpmg_frqs[ei][mi][oi] = self.points[mi] # Calculate how the value should be, so chi2 gets zero. -# The R20 index. -r20_index = mi + si*len(self.fields) -# Convert dw from ppm to rad/s. -dw_frq = dw[si] * frqs[ei][si][mi] -r20a=R20A[r20_index] -r20b=R20B[r20_index] back_calc = array([0.0]*len(cpmg_frqs[ei][mi][oi])) for oi in range(len(self.offset)): @@ -428,7 +404,7 @@ return chi2 -def single(num_spins=1, model=MODEL_NS_CPMG_2SITE_3D, iter=None): +def single(num_spins=1, model=MODEL_NS_CPMG_2SITE_3D_FULL, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -452,7 +428,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_NS_CPMG_2SITE_3D, iter=None): +def cluster(num_spins=100, model=MODEL_NS_CPMG_2SITE_3D_FULL, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. @@ -476,39 +452,4 @@ # Execute main function. if __name__ == __main__: -main() - -def test_reshape(): -C1 = Profile(num_spins=1, model=MODEL_NS_CPMG_2SITE_3D, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) -end_index = C1.model.end_index -#print(end_index:, end_index) -num_spins = C1.model.num_spins -#print(num_spins:, num_spins) -num_frq = C1.model.num_frq -#print(num_frq:, num_frq) -params = C1.params -#print(params, params) - -R20 = params[:end_index[1]].reshape(num_spins*2, num_frq) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = params[end_index[1]:end_index[2]] -pA = params[end_index[2]] -kex = params[end_index[2]+1] -print(R20A, R20A, len(R20A)) -print(R20B, R20B, len(R20B)) -print(dw, dw, len(dw)) -print(dw, pA) -print(kex, kex) - -for si in range(num_spins): -for mi in range(num_frq): -r20_index = mi + si*num_frq -r20a=R20A
r24098 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_r1rho_2site.py
Author: tlinnet Date: Wed Jun 18 16:44:12 2014 New Revision: 24098 URL: http://svn.gna.org/viewcvs/relax?rev=24098view=rev Log: Copied profiling script of DPL94 to ns r1rho 2site. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_r1rho_2site.py - copied unchanged from r24097, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_dpl94.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24100 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_r1rho_2site.py
Author: tlinnet Date: Wed Jun 18 16:48:50 2014 New Revision: 24100 URL: http://svn.gna.org/viewcvs/relax?rev=24100view=rev Log: Added profiling script for 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/test_suite/shared_data/dispersion/profiling/profiling_ns_r1rho_2site.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_r1rho_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_r1rho_2site.py?rev=24100r1=24099r2=24100view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_r1rho_2site.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_r1rho_2site.py Wed Jun 18 16:48:50 2014 @@ -63,7 +63,7 @@ def main(): if True: # Nr of iterations. -nr_iter = 1000 +nr_iter = 10 # Print statistics. verbose = True @@ -523,11 +523,11 @@ # Return chi2 value. -chi2 = self.model.func_DPL94(params) +chi2 = self.model.func_ns_r1rho_2site(params) return chi2 -def single(num_spins=1, model=MODEL_DPL94, iter=None): +def single(num_spins=1, model=MODEL_NS_R1RHO_2SITE, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -541,7 +541,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, phi_ex=1.0, kex=5000.0, spins_params=['r2', 'phi_ex', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=1.0, pA=0.9, kex=5000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -551,7 +551,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_DPL94, iter=None): +def cluster(num_spins=100, model=MODEL_NS_R1RHO_2SITE, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. @@ -565,7 +565,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, phi_ex=1.0, kex=5000.0, spins_params=['r2', 'phi_ex', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=1.0, pA=0.9, kex=5000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24103 - in /branches/disp_spin_speed: lib/dispersion/lm63_3site.py target_functions/relax_disp.py
Author: tlinnet Date: Wed Jun 18 17:11:24 2014 New Revision: 24103 URL: http://svn.gna.org/viewcvs/relax?rev=24103view=rev Log: Moved the Ãparter conversion in LM63 3site into the lib function. This cleans up the target api function. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/lib/dispersion/lm63_3site.py branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/lib/dispersion/lm63_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/lm63_3site.py?rev=24103r1=24102r2=24103view=diff == --- branches/disp_spin_speed/lib/dispersion/lm63_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/lm63_3site.py Wed Jun 18 17:11:24 2014 @@ -69,7 +69,7 @@ from numpy.ma import fix_invalid, masked_where -def r2eff_LM63_3site(r20=None, rex_B=None, rex_C=None, quart_kB=None, quart_kC=None, cpmg_frqs=None, back_calc=None): +def r2eff_LM63_3site(r20=None, phi_ex_B=None, phi_ex_C=None, kB=None, kC=None, cpmg_frqs=None, back_calc=None): Calculate the R2eff values for the LM63 3-site model. See the module docstring for details. @@ -77,19 +77,29 @@ @keyword r20: The R20 parameter value (R2 with no exchange). @type r20: numpy float array of rank [NS][NM][NO][ND] -@keyword rex_B: The phi_ex_B / kB parameter value. -@type rex_B:numpy float array of rank [NS][NM][NO][ND] -@keyword rex_C: The phi_ex_C / kC parameter value. -@type rex_C:numpy float array of rank [NE][NS][NM][NO][ND] -@keyword quart_kB: Approximate chemical exchange rate constant between sites A and B (the exchange rate in rad/s) divided by 4. -@type quart_kB: float -@keyword quart_kC: Approximate chemical exchange rate constant between sites A and C (the exchange rate in rad/s) divided by 4. -@type quart_kC: float +@keyword phi_ex_B: The fast exchange factor between sites A and B (ppm^2) +@type phi_ex_B: numpy float array of rank [NS][NM][NO][ND] +@keyword phi_ex_C: The fast exchange factor between sites A and C (ppm^2) +@type phi_ex_C: numpy float array of rank [NE][NS][NM][NO][ND] +@keyword kB:Approximate chemical exchange rate constant between sites A and B (the exchange rate in rad/s). +@type kB: float +@keyword kC:Approximate chemical exchange rate constant between sites A and C (the exchange rate in rad/s). +@type kC: float @keyword cpmg_frqs: The CPMG nu1 frequencies. @type cpmg_frqs:numpy float array of rank [NE][NS][NM][NO][ND] @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. @type back_calc:numpy float array of rank [NE][NS][NM][NO][ND] + +# Once off parameter conversions. +# The phi_ex_B / kB parameter value. +rex_B = phi_ex_B / kB +# The phi_ex_C / kC parameter value. +rex_C = phi_ex_C / kC +# Approximate chemical exchange rate constant between sites A and B (the exchange rate in rad/s) divided by 4. +quart_kB = kB / 4.0 +# Approximate chemical exchange rate constant between sites A and C (the exchange rate in rad/s) divided by 4. +quart_kC = kC / 4.0 # Flag to tell if values should be replaced. t_rex_zero = False Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24103r1=24102r2=24103view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Wed Jun 18 17:11:24 2014 @@ -1062,21 +1062,15 @@ kB = params[self.end_index[2]] kC = params[self.end_index[2]+1] -# Once off parameter conversions. -rex_B = phi_ex_B / kB -rex_C = phi_ex_C / kC -quart_kB = kB / 4.0 -quart_kC = kC / 4.0 - # Convert phi_ex (or rex) from ppm^2 to (rad/s)^2. -multiply( multiply.outer( rex_B.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs_squared, out=self.phi_ex_B_struct ) -multiply( multiply.outer( rex_C.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs_squared, out=self.phi_ex_C_struct ) +multiply( multiply.outer( phi_ex_B.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs_squared, out=self.phi_ex_B_struct ) +multiply( multiply.outer( phi_ex_C.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs_squared, out=self.phi_ex_C_struct ) # Reshape R20 to per experiment
r24104 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tap03.py
Author: tlinnet Date: Wed Jun 18 17:12:50 2014 New Revision: 24104 URL: http://svn.gna.org/viewcvs/relax?rev=24104view=rev Log: Copied profiling script for DPL94 to TAP03. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tap03.py - copied unchanged from r24097, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_dpl94.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24105 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tp02.py
Author: tlinnet Date: Wed Jun 18 17:13:47 2014 New Revision: 24105 URL: http://svn.gna.org/viewcvs/relax?rev=24105view=rev Log: Copied profiling script for DPL94 to TP02. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tp02.py - copied unchanged from r24097, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_dpl94.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24106 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_mp05.py
Author: tlinnet Date: Wed Jun 18 17:15:27 2014 New Revision: 24106 URL: http://svn.gna.org/viewcvs/relax?rev=24106view=rev Log: Copied profiling script for DPL94 to MP05. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_mp05.py - copied unchanged from r24097, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_dpl94.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24107 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_m61.py
Author: tlinnet Date: Wed Jun 18 17:16:24 2014 New Revision: 24107 URL: http://svn.gna.org/viewcvs/relax?rev=24107view=rev Log: Copied profiling script for DPL94 to M61. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_m61.py - copied unchanged from r24097, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_dpl94.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24108 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tap03.py
Author: tlinnet Date: Wed Jun 18 17:21:39 2014 New Revision: 24108 URL: http://svn.gna.org/viewcvs/relax?rev=24108view=rev Log: Modified profiling script for TAP03 to be used. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tap03.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tap03.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tap03.py?rev=24108r1=24107r2=24108view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tap03.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tap03.py Wed Jun 18 17:21:39 2014 @@ -63,7 +63,7 @@ def main(): if True: # Nr of iterations. -nr_iter = 1000 +nr_iter = 10 # Print statistics. verbose = True @@ -523,11 +523,11 @@ # Return chi2 value. -chi2 = self.model.func_DPL94(params) +chi2 = self.model.func_TAP03(params) return chi2 -def single(num_spins=1, model=MODEL_DPL94, iter=None): +def single(num_spins=1, model=MODEL_TAP03, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -541,7 +541,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, phi_ex=1.0, kex=5000.0, spins_params=['r2', 'phi_ex', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=1.0, pA=0.9, kex=5000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -551,7 +551,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_DPL94, iter=None): +def cluster(num_spins=100, model=MODEL_TAP03, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. @@ -565,7 +565,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, phi_ex=1.0, kex=5000.0, spins_params=['r2', 'phi_ex', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=1.0, pA=0.9, kex=5000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24109 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tp02.py
Author: tlinnet Date: Wed Jun 18 17:23:44 2014 New Revision: 24109 URL: http://svn.gna.org/viewcvs/relax?rev=24109view=rev Log: Modified profiling script for TP02, to be used. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tp02.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tp02.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tp02.py?rev=24109r1=24108r2=24109view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tp02.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_tp02.py Wed Jun 18 17:23:44 2014 @@ -63,7 +63,7 @@ def main(): if True: # Nr of iterations. -nr_iter = 1000 +nr_iter = 10 # Print statistics. verbose = True @@ -523,11 +523,11 @@ # Return chi2 value. -chi2 = self.model.func_DPL94(params) +chi2 = self.model.func_TP02(params) return chi2 -def single(num_spins=1, model=MODEL_DPL94, iter=None): +def single(num_spins=1, model=MODEL_TP02, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -541,7 +541,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, phi_ex=1.0, kex=5000.0, spins_params=['r2', 'phi_ex', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=1.0, pA=0.9, kex=5000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -551,7 +551,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_DPL94, iter=None): +def cluster(num_spins=100, model=MODEL_TP02, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. @@ -565,7 +565,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, phi_ex=1.0, kex=5000.0, spins_params=['r2', 'phi_ex', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=1.0, pA=0.9, kex=5000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24110 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_mp05.py
Author: tlinnet Date: Wed Jun 18 17:27:54 2014 New Revision: 24110 URL: http://svn.gna.org/viewcvs/relax?rev=24110view=rev Log: Modified profiling script for MP05. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_mp05.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_mp05.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_mp05.py?rev=24110r1=24109r2=24110view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_mp05.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_mp05.py Wed Jun 18 17:27:54 2014 @@ -63,7 +63,7 @@ def main(): if True: # Nr of iterations. -nr_iter = 1000 +nr_iter = 10 # Print statistics. verbose = True @@ -523,11 +523,11 @@ # Return chi2 value. -chi2 = self.model.func_DPL94(params) +chi2 = self.model.func_MP05(params) return chi2 -def single(num_spins=1, model=MODEL_DPL94, iter=None): +def single(num_spins=1, model=MODEL_MP05, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -541,7 +541,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, phi_ex=1.0, kex=5000.0, spins_params=['r2', 'phi_ex', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=1.0, pA=0.9, kex=5000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -551,7 +551,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_DPL94, iter=None): +def cluster(num_spins=100, model=MODEL_MP05, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. @@ -565,7 +565,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, phi_ex=1.0, kex=5000.0, spins_params=['r2', 'phi_ex', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=1.0, pA=0.9, kex=5000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24111 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_m61.py
Author: tlinnet Date: Wed Jun 18 17:31:55 2014 New Revision: 24111 URL: http://svn.gna.org/viewcvs/relax?rev=24111view=rev Log: Modified profiling script for M61. This is the last one. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_m61.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_m61.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_m61.py?rev=24111r1=24110r2=24111view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_m61.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_m61.py Wed Jun 18 17:31:55 2014 @@ -63,7 +63,7 @@ def main(): if True: # Nr of iterations. -nr_iter = 1000 +nr_iter = 100 # Print statistics. verbose = True @@ -523,11 +523,11 @@ # Return chi2 value. -chi2 = self.model.func_DPL94(params) +chi2 = self.model.func_M61(params) return chi2 -def single(num_spins=1, model=MODEL_DPL94, iter=None): +def single(num_spins=1, model=MODEL_M61, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -551,7 +551,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_DPL94, iter=None): +def cluster(num_spins=100, model=MODEL_M61, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24113 - in /branches/disp_spin_speed: lib/dispersion/mmq_cr72.py target_functions/relax_disp.py
Author: tlinnet Date: Wed Jun 18 17:39:08 2014 New Revision: 24113 URL: http://svn.gna.org/viewcvs/relax?rev=24113view=rev Log: Moved the parameter conversion of MMQ CR72 into lib function. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/lib/dispersion/mmq_cr72.py branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/lib/dispersion/mmq_cr72.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/mmq_cr72.py?rev=24113r1=24112r2=24113view=diff == --- branches/disp_spin_speed/lib/dispersion/mmq_cr72.py (original) +++ branches/disp_spin_speed/lib/dispersion/mmq_cr72.py Wed Jun 18 17:39:08 2014 @@ -52,7 +52,7 @@ from numpy.ma import fix_invalid, masked_greater_equal, masked_where -def r2eff_mmq_cr72(r20=None, pA=None, pB=None, dw=None, dwH=None, kex=None, k_AB=None, k_BA=None, cpmg_frqs=None, inv_tcpmg=None, tcp=None, back_calc=None): +def r2eff_mmq_cr72(r20=None, pA=None, dw=None, dwH=None, kex=None, cpmg_frqs=None, inv_tcpmg=None, tcp=None, back_calc=None): The CR72 model extended to MMQ CPMG data. This function calculates and stores the R2eff values. @@ -62,18 +62,12 @@ @type r20: numpy float array of rank [NS][NM][NO][ND] @keyword pA:The population of state A. @type pA: float -@keyword pB:The population of state B. -@type pB: float @keyword dw:The chemical exchange difference between states A and B in rad/s. @type dw: numpy float array of rank [NS][NM][NO][ND] @keyword dwH: The proton chemical exchange difference between states A and B in rad/s. @type dwH: numpy float array of rank [NS][NM][NO][ND] @keyword kex: The kex parameter value (the exchange rate in rad/s). @type kex: float -@keyword k_AB: The rate of exchange from site A to B (rad/s). -@type k_AB: float -@keyword k_BA: The rate of exchange from site B to A (rad/s). -@type k_BA: float @keyword cpmg_frqs: The CPMG nu1 frequencies. @type cpmg_frqs:numpy float array of rank [NS][NM][NO][ND] @keyword inv_tcpmg: The inverse of the total duration of the CPMG element (in inverse seconds). @@ -83,6 +77,11 @@ @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. @type back_calc:numpy float array of rank [NS][NM][NO][ND] + +# Once off parameter conversions. +pB = 1.0 - pA +k_BA = pA * kex +k_AB = pB * kex # Flag to tell if values should be replaced if max_etapos in cosh function is violated. t_dw_dw_H_zero = False Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24113r1=24112r2=24113view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Wed Jun 18 17:39:08 2014 @@ -1261,11 +1261,6 @@ pA = params[self.end_index[2]] kex = params[self.end_index[2]+1] -# Once off parameter conversions. -pB = 1.0 - pA -k_BA = pA * kex -k_AB = pB * kex - # Convert dw and dwH from ppm to rad/s. Use the out argument, to pass directly to structure. multiply( multiply.outer( dw.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs, out=self.dw_struct ) multiply( multiply.outer( dwH.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs_H, out=self.dwH_struct ) @@ -1298,7 +1293,7 @@ aliased_dwH = dw_frq # Back calculate the R2eff values. -r2eff_mmq_cr72(r20=r20, pA=pA, pB=pB, dw=aliased_dw, dwH=aliased_dwH, kex=kex, k_AB=k_AB, k_BA=k_BA, cpmg_frqs=self.cpmg_frqs[ei], inv_tcpmg=self.inv_relax_times[ei], tcp=self.tau_cpmg[ei], back_calc=self.back_calc[ei]) +r2eff_mmq_cr72(r20=r20, pA=pA, dw=aliased_dw, dwH=aliased_dwH, kex=kex, cpmg_frqs=self.cpmg_frqs[ei], inv_tcpmg=self.inv_relax_times[ei], tcp=self.tau_cpmg[ei], back_calc=self.back_calc[ei]) # Clean the data for all values, which is left over at the end of arrays. self.back_calc = self.back_calc*self.disp_struct ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax
r24114 - in /branches/disp_spin_speed: lib/dispersion/ns_mmq_2site.py target_functions/relax_disp.py
Author: tlinnet Date: Wed Jun 18 17:52:07 2014 New Revision: 24114 URL: http://svn.gna.org/viewcvs/relax?rev=24114view=rev Log: Moved the paramter conversions of k_AB, k_BA and pB into lib function of NS MMQ 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_mmq_2site.py branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py?rev=24114r1=24113r2=24114view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py Wed Jun 18 17:52:07 2014 @@ -83,7 +83,7 @@ matrix[1, 1] = -k_BA + 1.j*dw - R20B -def r2eff_ns_mmq_2site_mq(M0=None, F_vector=array([1, 0], float64), m1=None, m2=None, R20A=None, R20B=None, pA=None, pB=None, dw=None, dwH=None, k_AB=None, k_BA=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, power=None): +def r2eff_ns_mmq_2site_mq(M0=None, F_vector=array([1, 0], float64), m1=None, m2=None, R20A=None, R20B=None, pA=None, dw=None, dwH=None, kex=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, power=None): The 2-site numerical solution to the Bloch-McConnell equation for MQ data. The notation used here comes from: @@ -111,16 +111,12 @@ @type R20B: numpy float array of rank [NS][NM][NO][ND] @keyword pA:The population of state A. @type pA: float -@keyword pB:The population of state B. -@type pB: float @keyword dw:The chemical exchange difference between states A and B in rad/s. @type dw: numpy float array of rank [NS][NM][NO][ND] @keyword dwH: The proton chemical exchange difference between states A and B in rad/s. @type dwH: numpy float array of rank [NS][NM][NO][ND] -@keyword k_AB: The rate of exchange from site A to B (rad/s). -@type k_AB: float -@keyword k_BA: The rate of exchange from site B to A (rad/s). -@type k_BA: float +@keyword kex: The kex parameter value (the exchange rate in rad/s). +@type kex: float @keyword inv_tcpmg: The inverse of the total duration of the CPMG element (in inverse seconds). @type inv_tcpmg:numpy float array of rank [NS][NM][NO][ND] @keyword tcp: The tau_CPMG times (1 / 4.nu1). @@ -133,6 +129,15 @@ @type power:numpy int array of rank [NS][NM][NO][ND] +# Once off parameter conversions. +pB = 1.0 - pA +k_BA = pA * kex +k_AB = pB * kex + +# This is a vector that contains the initial magnetizations corresponding to the A and B state transverse magnetizations. +M0[0] = pA +M0[1] = pB + # Extract shape of experiment. NS, NM, NO = num_points.shape @@ -236,7 +241,7 @@ back_calc[si, mi, oi, i]= -inv_tcpmg[si, mi, oi, i] * log(Mx / pA) -def r2eff_ns_mmq_2site_sq_dq_zq(M0=None, F_vector=array([1, 0], float64), m1=None, m2=None, R20A=None, R20B=None, pA=None, pB=None, dw=None, dwH=None, k_AB=None, k_BA=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, power=None): +def r2eff_ns_mmq_2site_sq_dq_zq(M0=None, F_vector=array([1, 0], float64), m1=None, m2=None, R20A=None, R20B=None, pA=None, dw=None, dwH=None, kex=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, power=None): The 2-site numerical solution to the Bloch-McConnell equation for SQ, ZQ, and DQ data. The notation used here comes from: @@ -260,16 +265,12 @@ @type R20B: numpy float array of rank [NS][NM][NO][ND] @keyword pA:The population of state A. @type pA: float -@keyword pB:The population of state B. -@type pB: float @keyword dw:The combined chemical exchange difference between states A and B in rad/s. It should be set to dwH for 1H SQ data, dw for heteronuclear SQ data, dwH-dw for ZQ data, and dwH+dw for DQ data. @type dw: numpy float array of rank [NS][NM][NO][ND] @keyword dwH: Unused - this is simply to match the r2eff_ns_mmq_2site_mq() function arguments. @type dwH: numpy float array of rank [NS][NM][NO][ND] -@keyword k_AB: The rate of exchange from site A to B (rad/s). -@type k_AB: float -@keyword k_BA: The rate of exchange from site B to A (rad/s). -@type k_BA: float +@keyword kex: The kex parameter value (the exchange rate in rad/s). +@type kex
r24115 - in /branches/disp_spin_speed: lib/dispersion/ns_r1rho_2site.py target_functions/relax_disp.py
Author: tlinnet Date: Wed Jun 18 17:57:44 2014 New Revision: 24115 URL: http://svn.gna.org/viewcvs/relax?rev=24115view=rev Log: Moved the parameter conversion from target function to lib function for 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_r1rho_2site.py branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py?rev=24115r1=24114r2=24115view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py Wed Jun 18 17:57:44 2014 @@ -59,7 +59,7 @@ from lib.linear_algebra.matrix_exponential import matrix_exponential -def ns_r1rho_2site(M0=None, matrix=None, r1rho_prime=None, omega=None, offset=None, r1=0.0, pA=None, pB=None, dw=None, k_AB=None, k_BA=None, spin_lock_fields=None, relax_time=None, inv_relax_time=None, back_calc=None, num_points=None): +def ns_r1rho_2site(M0=None, matrix=None, r1rho_prime=None, omega=None, offset=None, r1=0.0, pA=None, dw=None, kex=None, spin_lock_fields=None, relax_time=None, inv_relax_time=None, back_calc=None, num_points=None): The 2-site numerical solution to the Bloch-McConnell equation for R1rho data. This function calculates and stores the R1rho values. @@ -79,14 +79,10 @@ @type r1: numpy float array of rank [NS][NM][NO][ND] @keyword pA:The population of state A. @type pA: float -@keyword pB:The population of state B. -@type pB: float @keyword dw:The chemical exchange difference between states A and B in rad/s. @type dw: numpy float array of rank [NS][NM][NO][ND] -@keyword k_AB: The rate of exchange from site A to B (rad/s). -@type k_AB: float -@keyword k_BA: The rate of exchange from site B to A (rad/s). -@type k_BA: float +@keyword kex: The kex parameter value (the exchange rate in rad/s). +@type kex: float @keyword spin_lock_fields: The R1rho spin-lock field strengths (in rad.s^-1). @type spin_lock_fields: numpy float array of rank [NS][NM][NO][ND] @keyword relax_time:The total relaxation time period for each spin-lock field strength (in seconds). @@ -98,6 +94,11 @@ @keyword num_points:The number of points on the dispersion curve, equal to the length of the tcp and back_calc arguments. @type num_points: numpy int array of rank [NS][NM][NO] + +# Once off parameter conversions. +pB = 1.0 - pA +k_BA = pA * kex +k_AB = pB * kex # Extract shape of experiment. NE, NS, NM, NO = num_points.shape Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24115r1=24114r2=24115view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Wed Jun 18 17:57:44 2014 @@ -1621,11 +1621,6 @@ pA = params[self.end_index[1]] kex = params[self.end_index[1]+1] -# Once off parameter conversions. -pB = 1.0 - pA -k_BA = pA * kex -k_AB = pB * kex - # Convert dw from ppm to rad/s. Use the out argument, to pass directly to structure. multiply( multiply.outer( dw.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs, out=self.dw_struct ) @@ -1633,7 +1628,7 @@ self.r20_struct[:] = multiply.outer( r1rho_prime.reshape(self.NE, self.NS, self.NM), self.no_nd_ones ) # Back calculate the R2eff values. -ns_r1rho_2site(M0=self.M0, matrix=self.matrix, r1rho_prime=self.r20_struct, omega=self.chemical_shifts, offset=self.offset, r1=self.r1, pA=pA, pB=pB, dw=self.dw_struct, k_AB=k_AB, k_BA=k_BA, spin_lock_fields=self.spin_lock_omega1, relax_time=self.relax_times, inv_relax_time=self.inv_relax_times, back_calc=self.back_calc, num_points=self.num_disp_points) +ns_r1rho_2site(M0=self.M0, matrix=self.matrix, r1rho_prime=self.r20_struct, omega=self.chemical_shifts, offset=self.offset, r1=self.r1, pA=pA, dw=self.dw_struct, kex=kex, spin_lock_fields=self.spin_lock_omega1, relax_time=self.relax_times, inv_relax_time=self.inv_relax_times, back_calc=self.back_calc, num_points=self.num_disp_points) # Clean the data for all values, which is left over at the end of arrays
r24119 - in /branches/disp_spin_speed: lib/dispersion/ns_mmq_3site.py target_functions/relax_disp.py
Author: tlinnet Date: Wed Jun 18 18:52:37 2014 New Revision: 24119 URL: http://svn.gna.org/viewcvs/relax?rev=24119view=rev Log: Moved the parameter conversion for ns mmq 3site into lib function. 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_mmq_3site.py branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py?rev=24119r1=24118r2=24119view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py Wed Jun 18 18:52:37 2014 @@ -110,7 +110,7 @@ matrix[2, 2] = -k_CB - k_CA + 1.j*dw_AC - R20C -def r2eff_ns_mmq_3site_mq(M0=None, F_vector=array([1, 0, 0], float64), m1=None, m2=None, R20A=None, R20B=None, R20C=None, pA=None, pB=None, pC=None, dw_AB=None, dw_AC=None, dwH_AB=None, dwH_AC=None, k_AB=None, k_BA=None, k_BC=None, k_CB=None, k_AC=None, k_CA=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, power=None): +def r2eff_ns_mmq_3site_mq(M0=None, F_vector=array([1, 0, 0], float64), m1=None, m2=None, R20A=None, R20B=None, R20C=None, pA=None, pB=None, dw_AB=None, dw_AC=None, dwH_AB=None, dwH_AC=None, kex_AB=None, kex_BC=None, kex_AC=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, power=None): The 3-site numerical solution to the Bloch-McConnell equation for MQ data. The notation used here comes from: @@ -142,8 +142,6 @@ @type pA: float @keyword pB:The population of state B. @type pB: float -@keyword pC:The population of state C. -@type pC: float @keyword dw_AB: The chemical exchange difference between states A and B in rad/s. @type dw_AB:numpy float array of rank [NS][NM][NO][ND] @keyword dw_AC: The chemical exchange difference between states A and C in rad/s. @@ -152,18 +150,12 @@ @type dwH_AB: numpy float array of rank [NS][NM][NO][ND] @keyword dwH_AC:The proton chemical exchange difference between states A and C in rad/s. @type dwH_AC: numpy float array of rank [NS][NM][NO][ND] -@keyword k_AB: The rate of exchange from site A to B (rad/s). -@type k_AB: float -@keyword k_BA: The rate of exchange from site B to A (rad/s). -@type k_BA: float -@keyword k_BC: The rate of exchange from site B to C (rad/s). -@type k_BC: float -@keyword k_CB: The rate of exchange from site C to B (rad/s). -@type k_CB: float -@keyword k_AC: The rate of exchange from site A to C (rad/s). -@type k_AC: float -@keyword k_CA: The rate of exchange from site C to A (rad/s). -@type k_CA: float +@keyword kex_AB:The exchange rate between sites A and B for 3-site exchange with kex_AB = k_AB + k_BA (rad.s^-1) +@type kex_AB: float +@keyword kex_BC:The exchange rate between sites A and C for 3-site exchange with kex_AC = k_AC + k_CA (rad.s^-1) +@type kex_BC: float +@keyword kex_AC:The exchange rate between sites B and C for 3-site exchange with kex_BC = k_BC + k_CB (rad.s^-1) +@type kex_AC: float @keyword inv_tcpmg: The inverse of the total duration of the CPMG element (in inverse seconds). @type inv_tcpmg:float @keyword tcp: The tau_CPMG times (1 / 4.nu1). @@ -176,6 +168,23 @@ @type power:numpy int array of rank [NS][NM][NO][ND] +# Once off parameter conversions. +pC = 1.0 - pA - pB +pA_pB = pA + pB +pA_pC = pA + pC +pB_pC = pB + pC +k_BA = pA * kex_AB / pA_pB +k_AB = pB * kex_AB / pA_pB +k_CB = pB * kex_BC / pB_pC +k_BC = pC * kex_BC / pB_pC +k_CA = pA * kex_AC / pA_pC +k_AC = pC * kex_AC / pA_pC + +# This is a vector that contains the initial magnetizations corresponding to the A and B state transverse magnetizations. +M0[0] = pA +M0[1] = pB +M0[2] = pC + # Extract shape of experiment. NS, NM, NO = num_points.shape @@ -283,7 +292,7 @@ back_calc[si, mi, oi, i]= -inv_tcpmg[si, mi, oi, i] * log(Mx / pA) -def r2eff_ns_mmq_3site_sq_dq_zq(M0=None, F_vector=array([1, 0, 0], float64), m1=None, m2=None, R20A=None, R20B=None, R20C=None, pA=None, pB=None, pC=None, dw_AB=None, dw_AC=None, dwH_AB=None, dwH_AC=None, k_AB=None, k_BA=None, k_BC=None, k_CB=None, k_AC=None, k_CA=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, power=None): +def
r24121 - in /branches/disp_spin_speed: lib/dispersion/ns_r1rho_3site.py target_functions/relax_disp.py
Author: tlinnet Date: Wed Jun 18 19:01:24 2014 New Revision: 24121 URL: http://svn.gna.org/viewcvs/relax?rev=24121view=rev Log: Moved the parameter conversion for r1rho 3site into lib function. 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_r1rho_3site.py branches/disp_spin_speed/target_functions/relax_disp.py Modified: branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py?rev=24121r1=24120r2=24121view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py Wed Jun 18 19:01:24 2014 @@ -65,7 +65,7 @@ from lib.linear_algebra.matrix_exponential import matrix_exponential -def ns_r1rho_3site(M0=None, matrix=None, r1rho_prime=None, omega=None, offset=None, r1=0.0, pA=None, pB=None, pC=None, dw_AB=None, dw_AC=None, k_AB=None, k_BA=None, k_BC=None, k_CB=None, k_AC=None, k_CA=None, spin_lock_fields=None, relax_time=None, inv_relax_time=None, back_calc=None, num_points=None): +def ns_r1rho_3site(M0=None, matrix=None, r1rho_prime=None, omega=None, offset=None, r1=0.0, pA=None, pB=None, dw_AB=None, dw_AC=None, kex_AB=None, kex_BC=None, kex_AC=None, spin_lock_fields=None, relax_time=None, inv_relax_time=None, back_calc=None, num_points=None): The 3-site numerical solution to the Bloch-McConnell equation for R1rho data. This function calculates and stores the R1rho values. @@ -87,24 +87,16 @@ @type pA: float @keyword pB:The population of state B. @type pB: float -@keyword pC:The population of state C. -@type pC: float @keyword dw_AB: The chemical exchange difference between states A and B in rad/s. @type dw_AB:numpy float array of rank [NS][NM][NO][ND] @keyword dw_AC: The chemical exchange difference between states A and C in rad/s. @type dw_AC:numpy float array of rank [NS][NM][NO][ND] -@keyword k_AB: The rate of exchange from site A to B (rad/s). -@type k_AB: float -@keyword k_BA: The rate of exchange from site B to A (rad/s). -@type k_BA: float -@keyword k_BC: The rate of exchange from site B to C (rad/s). -@type k_BC: float -@keyword k_CB: The rate of exchange from site C to B (rad/s). -@type k_CB: float -@keyword k_AC: The rate of exchange from site A to C (rad/s). -@type k_AC: float -@keyword k_CA: The rate of exchange from site C to A (rad/s). -@type k_CA: float +@keyword kex_AB:The exchange rate between sites A and B for 3-site exchange with kex_AB = k_AB + k_BA (rad.s^-1) +@type kex_AB: float +@keyword kex_BC:The exchange rate between sites A and C for 3-site exchange with kex_AC = k_AC + k_CA (rad.s^-1) +@type kex_BC: float +@keyword kex_AC:The exchange rate between sites B and C for 3-site exchange with kex_BC = k_BC + k_CB (rad.s^-1) +@type kex_AC: float @keyword spin_lock_fields: The R1rho spin-lock field strengths (in rad.s^-1). @type spin_lock_fields: numpy float array of rank [NS][NM][NO][ND] @keyword relax_time:The total relaxation time period for each spin-lock field strength (in seconds). @@ -116,6 +108,18 @@ @keyword num_points:The number of points on the dispersion curve, equal to the length of the tcp and back_calc arguments. @type num_points: numpy int array of rank [NS][NM][NO] + +# Once off parameter conversions. +pC = 1.0 - pA - pB +pA_pB = pA + pB +pA_pC = pA + pC +pB_pC = pB + pC +k_BA = pA * kex_AB / pA_pB +k_AB = pB * kex_AB / pA_pB +k_CB = pB * kex_BC / pB_pC +k_BC = pC * kex_BC / pB_pC +k_CA = pA * kex_AC / pA_pC +k_AC = pC * kex_AC / pA_pC # Extract shape of experiment. NE, NS, NM, NO = num_points.shape Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24121r1=24120r2=24121view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Wed Jun 18 19:01:24 2014 @@ -765,16 +765,6 @@ # Once off parameter conversions. -pC = 1.0 - pA - pB -pA_pB
r24122 - in /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling: profiling_cr72.py profiling_cr72_full.py
Author: tlinnet Date: Wed Jun 18 19:03:08 2014 New Revision: 24122 URL: http://svn.gna.org/viewcvs/relax?rev=24122view=rev Log: Copied profiling script for CR72, so there is now a normal and a full version. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py - copied unchanged from r24121, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72_full.py - copied unchanged from r24121, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24123 - in /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling: profiling_b14.py profiling_b14_full.py
Author: tlinnet Date: Wed Jun 18 19:04:01 2014 New Revision: 24123 URL: http://svn.gna.org/viewcvs/relax?rev=24123view=rev Log: Copied profiling for b14 to normal and full model. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py - copied unchanged from r24121, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14_full.py - copied unchanged from r24121, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24125 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/
Author: tlinnet Date: Wed Jun 18 19:10:13 2014 New Revision: 24125 URL: http://svn.gna.org/viewcvs/relax?rev=24125view=rev Log: Copied profiling script for cpmg 3D. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py - copied unchanged from r24121, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D_full.py - copied unchanged from r24121, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24126 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/
Author: tlinnet Date: Wed Jun 18 19:11:10 2014 New Revision: 24126 URL: http://svn.gna.org/viewcvs/relax?rev=24126view=rev Log: Copied profiling script for ns cpmg star. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star.py - copied unchanged from r24125, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star_full.py - copied unchanged from r24125, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D_full.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24127 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_norex.py
Author: tlinnet Date: Wed Jun 18 19:12:12 2014 New Revision: 24127 URL: http://svn.gna.org/viewcvs/relax?rev=24127view=rev Log: copied profiling script for no rex. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_norex.py - copied unchanged from r24122, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24128 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py
Author: tlinnet Date: Wed Jun 18 19:15:19 2014 New Revision: 24128 URL: http://svn.gna.org/viewcvs/relax?rev=24128view=rev Log: Modified profiling script for B14, to R20A=R20B. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py?rev=24128r1=24127r2=24128view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py Wed Jun 18 19:15:19 2014 @@ -436,7 +436,7 @@ return chi2 -def single(num_spins=1, model=MODEL_B14_FULL, iter=None): +def single(num_spins=1, model=MODEL_B14, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -450,7 +450,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -460,7 +460,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_B14_FULL, iter=None): +def cluster(num_spins=100, model=MODEL_B14, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24129 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py
Author: tlinnet Date: Wed Jun 18 19:20:19 2014 New Revision: 24129 URL: http://svn.gna.org/viewcvs/relax?rev=24129view=rev Log: Removal of junk, and replacing func. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py?rev=24129r1=24128r2=24129view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14.py Wed Jun 18 19:20:19 2014 @@ -55,7 +55,7 @@ from lib.physical_constants import g1H, g15N from target_functions.chi2 import chi2 from target_functions.relax_disp import Dispersion -from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_SQ, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL +from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_SQ, MODEL_B14, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL # Alter setup. @@ -188,27 +188,6 @@ @return:The numpy array structures of the R2eff/R1rho values, errors, missing data, and corresponding Larmor frequencies. For each structure, the first dimension corresponds to the experiment types, the second the spins of a spin block, the third to the spectrometer field strength, and the fourth is the dispersion points. For the Larmor frequency structure, the fourth dimension is omitted. For R1rho-type data, an offset dimension is inserted between the spectrometer field strength and the dispersion points. @rtype: lists of numpy float arrays, lists of numpy float arrays, lists of numpy float arrays, numpy rank-2 int array - -# Unpack the parameter values. -# Initialise the post spin parameter indices. -end_index = [] -# The spin and frequency dependent R2 parameters. -end_index.append(len(self.exp_type) * self.num_spins * len(self.fields)) -if self.model in [MODEL_B14_FULL, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL]: -end_index.append(2 * len(self.exp_type) * self.num_spins * len(self.fields)) -# The spin and dependent parameters (phi_ex, dw, padw2). -end_index.append(end_index[-1] + self.num_spins) - -# Unpack the parameter values. -R20 = self.params[:end_index[1]].reshape(self.num_spins*2, len(self.fields)) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = self.params[end_index[1]:end_index[2]] -pA = self.params[end_index[2]] -kex = self.params[end_index[2]+1] -pB = 1.0 - pA -k_BA = pA * kex -k_AB = pB * kex # Initialise the data structures for the target function. exp_types = [] @@ -280,13 +259,6 @@ # Get the cpmg frq. cpmg_frqs[ei][mi][oi] = self.points[mi] -# Calculate how the value should be, so chi2 gets zero. -# The R20 index. -r20_index = mi + si*len(self.fields) -# Convert dw from ppm to rad/s. -dw_frq = dw[si] * frqs[ei][si][mi] -r20a=R20A[r20_index] -r20b=R20B[r20_index] back_calc = array([0.0]*len(cpmg_frqs[ei][mi][oi])) for oi in range(len(self.offset)): @@ -432,7 +404,7 @@ # Return chi2 value. -chi2 = self.model.func_B14_full(params) +chi2 = self.model.func_B14(params) return chi2 @@ -474,7 +446,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): @@ -485,38 +457,3 @@ # Execute main function. if __name__ == __main__: main() - -def test_reshape(): -C1 = Profile(num_spins=1, model=MODEL_B14_FULL, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) -end_index = C1.model.end_index -#print(end_index:, end_index) -num_spins = C1.model.num_spins -#print(num_spins:, num_spins) -num_frq = C1.model.num_frq -#print(num_frq:, num_frq) -params = C1.params
r24130 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14_full.py
Author: tlinnet Date: Wed Jun 18 19:20:21 2014 New Revision: 24130 URL: http://svn.gna.org/viewcvs/relax?rev=24130view=rev Log: Removal of junk from profiling script. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14_full.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14_full.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14_full.py?rev=24130r1=24129r2=24130view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14_full.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_b14_full.py Wed Jun 18 19:20:21 2014 @@ -188,27 +188,6 @@ @return:The numpy array structures of the R2eff/R1rho values, errors, missing data, and corresponding Larmor frequencies. For each structure, the first dimension corresponds to the experiment types, the second the spins of a spin block, the third to the spectrometer field strength, and the fourth is the dispersion points. For the Larmor frequency structure, the fourth dimension is omitted. For R1rho-type data, an offset dimension is inserted between the spectrometer field strength and the dispersion points. @rtype: lists of numpy float arrays, lists of numpy float arrays, lists of numpy float arrays, numpy rank-2 int array - -# Unpack the parameter values. -# Initialise the post spin parameter indices. -end_index = [] -# The spin and frequency dependent R2 parameters. -end_index.append(len(self.exp_type) * self.num_spins * len(self.fields)) -if self.model in [MODEL_B14_FULL, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL]: -end_index.append(2 * len(self.exp_type) * self.num_spins * len(self.fields)) -# The spin and dependent parameters (phi_ex, dw, padw2). -end_index.append(end_index[-1] + self.num_spins) - -# Unpack the parameter values. -R20 = self.params[:end_index[1]].reshape(self.num_spins*2, len(self.fields)) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = self.params[end_index[1]:end_index[2]] -pA = self.params[end_index[2]] -kex = self.params[end_index[2]+1] -pB = 1.0 - pA -k_BA = pA * kex -k_AB = pB * kex # Initialise the data structures for the target function. exp_types = [] @@ -280,13 +259,6 @@ # Get the cpmg frq. cpmg_frqs[ei][mi][oi] = self.points[mi] -# Calculate how the value should be, so chi2 gets zero. -# The R20 index. -r20_index = mi + si*len(self.fields) -# Convert dw from ppm to rad/s. -dw_frq = dw[si] * frqs[ei][si][mi] -r20a=R20A[r20_index] -r20b=R20B[r20_index] back_calc = array([0.0]*len(cpmg_frqs[ei][mi][oi])) for oi in range(len(self.offset)): @@ -484,39 +456,4 @@ # Execute main function. if __name__ == __main__: -main() - -def test_reshape(): -C1 = Profile(num_spins=1, model=MODEL_B14_FULL, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) -end_index = C1.model.end_index -#print(end_index:, end_index) -num_spins = C1.model.num_spins -#print(num_spins:, num_spins) -num_frq = C1.model.num_frq -#print(num_frq:, num_frq) -params = C1.params -#print(params, params) - -R20 = params[:end_index[1]].reshape(num_spins*2, num_frq) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = params[end_index[1]:end_index[2]] -pA = params[end_index[2]] -kex = params[end_index[2]+1] -print(R20A, R20A, len(R20A)) -print(R20B, R20B, len(R20B)) -print(dw, dw, len(dw)) -print(dw, pA) -print(kex, kex) - -for si in range(num_spins): -for mi in range(num_frq): -r20_index = mi + si*num_frq -r20a=R20A[r20_index] -r20b=R20B[r20_index] -print(r20a, r20a, r20b, r20b) - -model = C1.calc(params) -print(model) - -#test_reshape() +main() ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24132 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py
Author: tlinnet Date: Wed Jun 18 19:25:31 2014 New Revision: 24132 URL: http://svn.gna.org/viewcvs/relax?rev=24132view=rev Log: Removal of junk from profiling script CR72 and making it work. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py?rev=24132r1=24131r2=24132view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py Wed Jun 18 19:25:31 2014 @@ -183,24 +183,6 @@ @return:The numpy array structures of the R2eff/R1rho values, errors, missing data, and corresponding Larmor frequencies. For each structure, the first dimension corresponds to the experiment types, the second the spins of a spin block, the third to the spectrometer field strength, and the fourth is the dispersion points. For the Larmor frequency structure, the fourth dimension is omitted. For R1rho-type data, an offset dimension is inserted between the spectrometer field strength and the dispersion points. @rtype: lists of numpy float arrays, lists of numpy float arrays, lists of numpy float arrays, numpy rank-2 int array - -# Unpack the parameter values. -# Initialise the post spin parameter indices. -end_index = [] -# The spin and frequency dependent R2 parameters. -end_index.append(len(self.exp_type) * self.num_spins * len(self.fields)) -if self.model in [MODEL_B14_FULL, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL]: -end_index.append(2 * len(self.exp_type) * self.num_spins * len(self.fields)) -# The spin and dependent parameters (phi_ex, dw, padw2). -end_index.append(end_index[-1] + self.num_spins) - -# Unpack the parameter values. -R20 = self.params[:end_index[1]].reshape(self.num_spins*2, len(self.fields)) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = self.params[end_index[1]:end_index[2]] -pA = self.params[end_index[2]] -kex = self.params[end_index[2]+1] # Initialise the data structures for the target function. exp_types = [] @@ -272,13 +254,6 @@ # Get the cpmg frq. cpmg_frqs[ei][mi][oi] = self.points[mi] -# Calculate how the value should be, so chi2 gets zero. -# The R20 index. -r20_index = mi + si*len(self.fields) -# Convert dw from ppm to rad/s. -dw_frq = dw[si] * frqs[ei][si][mi] -r20a=R20A[r20_index] -r20b=R20B[r20_index] back_calc = array([0.0]*len(cpmg_frqs[ei][mi][oi])) for oi in range(len(self.offset)): @@ -424,11 +399,11 @@ # Return chi2 value. -chi2 = self.model.func_CR72_full(params) +chi2 = self.model.func_CR72(params) return chi2 -def single(num_spins=1, model=MODEL_CR72_FULL, iter=None): +def single(num_spins=1, model=MODEL_CR72, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -442,7 +417,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -452,7 +427,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_CR72_FULL, iter=None): +def cluster(num_spins=100, model=MODEL_CR72, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. @@ -466,7 +441,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): @@ -476,39 +451,4 @@ # Execute main function. if __name__ == __main__: -main() - -def
r24131 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72_full.py
Author: tlinnet Date: Wed Jun 18 19:25:29 2014 New Revision: 24131 URL: http://svn.gna.org/viewcvs/relax?rev=24131view=rev Log: Removal of junk for profiling script CR72 full. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72_full.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72_full.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72_full.py?rev=24131r1=24130r2=24131view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72_full.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72_full.py Wed Jun 18 19:25:29 2014 @@ -183,24 +183,6 @@ @return:The numpy array structures of the R2eff/R1rho values, errors, missing data, and corresponding Larmor frequencies. For each structure, the first dimension corresponds to the experiment types, the second the spins of a spin block, the third to the spectrometer field strength, and the fourth is the dispersion points. For the Larmor frequency structure, the fourth dimension is omitted. For R1rho-type data, an offset dimension is inserted between the spectrometer field strength and the dispersion points. @rtype: lists of numpy float arrays, lists of numpy float arrays, lists of numpy float arrays, numpy rank-2 int array - -# Unpack the parameter values. -# Initialise the post spin parameter indices. -end_index = [] -# The spin and frequency dependent R2 parameters. -end_index.append(len(self.exp_type) * self.num_spins * len(self.fields)) -if self.model in [MODEL_B14_FULL, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL]: -end_index.append(2 * len(self.exp_type) * self.num_spins * len(self.fields)) -# The spin and dependent parameters (phi_ex, dw, padw2). -end_index.append(end_index[-1] + self.num_spins) - -# Unpack the parameter values. -R20 = self.params[:end_index[1]].reshape(self.num_spins*2, len(self.fields)) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = self.params[end_index[1]:end_index[2]] -pA = self.params[end_index[2]] -kex = self.params[end_index[2]+1] # Initialise the data structures for the target function. exp_types = [] @@ -272,13 +254,6 @@ # Get the cpmg frq. cpmg_frqs[ei][mi][oi] = self.points[mi] -# Calculate how the value should be, so chi2 gets zero. -# The R20 index. -r20_index = mi + si*len(self.fields) -# Convert dw from ppm to rad/s. -dw_frq = dw[si] * frqs[ei][si][mi] -r20a=R20A[r20_index] -r20b=R20B[r20_index] back_calc = array([0.0]*len(cpmg_frqs[ei][mi][oi])) for oi in range(len(self.offset)): @@ -476,39 +451,4 @@ # Execute main function. if __name__ == __main__: -main() - -def test_reshape(): -C1 = Profile(num_spins=1, model=MODEL_CR72_FULL, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) -end_index = C1.model.end_index -#print(end_index:, end_index) -num_spins = C1.model.num_spins -#print(num_spins:, num_spins) -num_frq = C1.model.num_frq -#print(num_frq:, num_frq) -params = C1.params -#print(params, params) - -R20 = params[:end_index[1]].reshape(num_spins*2, num_frq) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = params[end_index[1]:end_index[2]] -pA = params[end_index[2]] -kex = params[end_index[2]+1] -print(R20A, R20A, len(R20A)) -print(R20B, R20B, len(R20B)) -print(dw, dw, len(dw)) -print(dw, pA) -print(kex, kex) - -for si in range(num_spins): -for mi in range(num_frq): -r20_index = mi + si*num_frq -r20a=R20A[r20_index] -r20b=R20B[r20_index] -print(r20a, r20a, r20b, r20b) - -model = C1.calc(params) -print(model) - -#test_reshape() +main() ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24133 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_norex.py
Author: tlinnet Date: Wed Jun 18 19:29:28 2014 New Revision: 24133 URL: http://svn.gna.org/viewcvs/relax?rev=24133view=rev Log: Removal of junk, and implementing NO REX profiling script. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_norex.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_norex.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_norex.py?rev=24133r1=24132r2=24133view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_norex.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_norex.py Wed Jun 18 19:29:28 2014 @@ -55,7 +55,7 @@ from lib.physical_constants import g1H, g15N from target_functions.chi2 import chi2 from target_functions.relax_disp import Dispersion -from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_SQ, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL +from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_SQ, MODEL_NOREX, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL # Alter setup. @@ -183,24 +183,6 @@ @return:The numpy array structures of the R2eff/R1rho values, errors, missing data, and corresponding Larmor frequencies. For each structure, the first dimension corresponds to the experiment types, the second the spins of a spin block, the third to the spectrometer field strength, and the fourth is the dispersion points. For the Larmor frequency structure, the fourth dimension is omitted. For R1rho-type data, an offset dimension is inserted between the spectrometer field strength and the dispersion points. @rtype: lists of numpy float arrays, lists of numpy float arrays, lists of numpy float arrays, numpy rank-2 int array - -# Unpack the parameter values. -# Initialise the post spin parameter indices. -end_index = [] -# The spin and frequency dependent R2 parameters. -end_index.append(len(self.exp_type) * self.num_spins * len(self.fields)) -if self.model in [MODEL_B14_FULL, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL]: -end_index.append(2 * len(self.exp_type) * self.num_spins * len(self.fields)) -# The spin and dependent parameters (phi_ex, dw, padw2). -end_index.append(end_index[-1] + self.num_spins) - -# Unpack the parameter values. -R20 = self.params[:end_index[1]].reshape(self.num_spins*2, len(self.fields)) -R20A = R20[::2].flatten() -R20B = R20[1::2].flatten() -dw = self.params[end_index[1]:end_index[2]] -pA = self.params[end_index[2]] -kex = self.params[end_index[2]+1] # Initialise the data structures for the target function. exp_types = [] @@ -272,13 +254,6 @@ # Get the cpmg frq. cpmg_frqs[ei][mi][oi] = self.points[mi] -# Calculate how the value should be, so chi2 gets zero. -# The R20 index. -r20_index = mi + si*len(self.fields) -# Convert dw from ppm to rad/s. -dw_frq = dw[si] * frqs[ei][si][mi] -r20a=R20A[r20_index] -r20b=R20B[r20_index] back_calc = array([0.0]*len(cpmg_frqs[ei][mi][oi])) for oi in range(len(self.offset)): @@ -424,11 +399,11 @@ # Return chi2 value. -chi2 = self.model.func_CR72_full(params) +chi2 = self.model.func_NOREX(params) return chi2 -def single(num_spins=1, model=MODEL_CR72_FULL, iter=None): +def single(num_spins=1, model=MODEL_NOREX, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -442,7 +417,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, spins_params=['r2']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -452,7 +427,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_CR72_FULL, iter=None): +def cluster(num_spins=100, model=MODEL_NOREX, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. @@ -466,7 +441,7
r24134 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py
Author: tlinnet Date: Wed Jun 18 19:32:18 2014 New Revision: 24134 URL: http://svn.gna.org/viewcvs/relax?rev=24134view=rev Log: Implemented profiling script for NS CPMG 2site 3D. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py?rev=24134r1=24133r2=24134view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_3D.py Wed Jun 18 19:32:18 2014 @@ -400,11 +400,11 @@ # Return chi2 value. -chi2 = self.model.func_ns_cpmg_2site_3D_full(params) +chi2 = self.model.func_ns_cpmg_2site_3D(params) return chi2 -def single(num_spins=1, model=MODEL_NS_CPMG_2SITE_3D_FULL, iter=None): +def single(num_spins=1, model=MODEL_NS_CPMG_2SITE_3D, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -418,7 +418,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -428,7 +428,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_NS_CPMG_2SITE_3D_FULL, iter=None): +def cluster(num_spins=100, model=MODEL_NS_CPMG_2SITE_3D, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. @@ -442,7 +442,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24135 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/
Author: tlinnet Date: Wed Jun 18 19:36:48 2014 New Revision: 24135 URL: http://svn.gna.org/viewcvs/relax?rev=24135view=rev Log: Implemented profiling script for NS CPMG STAR and STAR FULL. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star.py branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star_full.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star.py?rev=24135r1=24134r2=24135view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star.py Wed Jun 18 19:36:48 2014 @@ -55,7 +55,7 @@ from lib.physical_constants import g1H, g15N from target_functions.chi2 import chi2 from target_functions.relax_disp import Dispersion -from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_SQ, MODEL_B14_FULL, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL +from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_SQ, MODEL_B14_FULL, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_STAR_FULL # Alter setup. @@ -400,11 +400,11 @@ # Return chi2 value. -chi2 = self.model.func_ns_cpmg_2site_3D_full(params) +chi2 = self.model.func_ns_cpmg_2site_star(params) return chi2 -def single(num_spins=1, model=MODEL_NS_CPMG_2SITE_3D_FULL, iter=None): +def single(num_spins=1, model=MODEL_NS_CPMG_2SITE_STAR, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -418,7 +418,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -428,7 +428,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_NS_CPMG_2SITE_3D_FULL, iter=None): +def cluster(num_spins=100, model=MODEL_NS_CPMG_2SITE_STAR, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. @@ -442,7 +442,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2a=5.0, r2b=10.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2a', 'r2b', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) # Repeat the function call, to simulate minimisation. for i in xrange(iter): Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star_full.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star_full.py?rev=24135r1=24134r2=24135view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star_full.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_ns_cpmg_2site_star_full.py Wed Jun 18 19:36:48 2014 @@ -400,11 +400,11 @@ # Return chi2 value. -chi2 = self.model.func_ns_cpmg_2site_3D_full(params) +chi2 = self.model.func_ns_cpmg_2site_star_full(params) return chi2 -def single(num_spins=1, model=MODEL_NS_CPMG_2SITE_3D_FULL, iter=None): +def single(num_spins=1, model=MODEL_NS_CPMG_2SITE_STAR_FULL, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -428,7 +428,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_NS_CPMG_2SITE_3D_FULL, iter=None): +def cluster(num_spins=100, model=MODEL_NS_CPMG_2SITE_STAR_FULL, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription
r24136 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_lm63.py
Author: tlinnet Date: Wed Jun 18 19:39:44 2014 New Revision: 24136 URL: http://svn.gna.org/viewcvs/relax?rev=24136view=rev Log: Copied profiling script to be used for LM63. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_lm63.py - copied unchanged from r24135, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24137 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_it99.py
Author: tlinnet Date: Wed Jun 18 19:41:27 2014 New Revision: 24137 URL: http://svn.gna.org/viewcvs/relax?rev=24137view=rev Log: Copied profiling script to model IT99. Added: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_it99.py - copied unchanged from r24135, branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24138 - /trunk/target_functions/relax_disp.py
Author: tlinnet Date: Wed Jun 18 20:02:00 2014 New Revision: 24138 URL: http://svn.gna.org/viewcvs/relax?rev=24138view=rev Log: Fixed the packing out of paramter tex for global analysis in model IT99. bug #0(https://gna.org/bugs/index.php?0): Unpacking of parameters for global analysis in model IT99, is performed wrong. Modified: trunk/target_functions/relax_disp.py Modified: trunk/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/trunk/target_functions/relax_disp.py?rev=24138r1=24137r2=24138view=diff == --- trunk/target_functions/relax_disp.py(original) +++ trunk/target_functions/relax_disp.pyWed Jun 18 20:02:00 2014 @@ -998,7 +998,7 @@ R20 = params[:self.end_index[0]] dw = params[self.end_index[0]:self.end_index[1]] pA = params[self.end_index[1]] -tex = params[self.end_index[2]] +tex = params[self.end_index[1]+1] # Once off parameter conversions. pB = 1.0 - pA ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24139 - in /branches/disp_spin_speed: ./ target_functions/relax_disp.py
Author: tlinnet Date: Wed Jun 18 20:03:09 2014 New Revision: 24139 URL: http://svn.gna.org/viewcvs/relax?rev=24139view=rev Log: Merged revisions 24138 via svnmerge from svn+ssh://tlin...@svn.gna.org/svn/relax/trunk r24138 | tlinnet | 2014-06-18 20:02:00 +0200 (Wed, 18 Jun 2014) | 3 lines Fixed the packing out of paramter tex for global analysis in model IT99. bug #0(https://gna.org/bugs/index.php?0): Unpacking of parameters for global analysis in model IT99, is performed wrong. Modified: branches/disp_spin_speed/ (props changed) branches/disp_spin_speed/target_functions/relax_disp.py Propchange: branches/disp_spin_speed/ -- --- svnmerge-integrated (original) +++ svnmerge-integrated Wed Jun 18 20:03:09 2014 @@ -1 +1 @@ -/trunk:1-24082 +/trunk:1-24138 Modified: branches/disp_spin_speed/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/target_functions/relax_disp.py?rev=24139r1=24138r2=24139view=diff == --- branches/disp_spin_speed/target_functions/relax_disp.py (original) +++ branches/disp_spin_speed/target_functions/relax_disp.py Wed Jun 18 20:03:09 2014 @@ -994,7 +994,7 @@ R20 = params[:self.end_index[0]] dw = params[self.end_index[0]:self.end_index[1]] pA = params[self.end_index[1]] -tex = params[self.end_index[2]] +tex = params[self.end_index[1]+1] # Convert dw from ppm to rad/s. Use the out argument, to pass directly to structure. multiply( multiply.outer( dw.reshape(1, self.NS), self.nm_no_nd_ones ), self.frqs, out=self.dw_struct ) ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24141 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_lm63.py
Author: tlinnet Date: Wed Jun 18 20:17:29 2014 New Revision: 24141 URL: http://svn.gna.org/viewcvs/relax?rev=24141view=rev Log: Implemented profiling script for LM63. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_lm63.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_lm63.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_lm63.py?rev=24141r1=24140r2=24141view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_lm63.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_lm63.py Wed Jun 18 20:17:29 2014 @@ -55,7 +55,7 @@ from lib.physical_constants import g1H, g15N from target_functions.chi2 import chi2 from target_functions.relax_disp import Dispersion -from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_SQ, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL +from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_SQ, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_LM63, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL # Alter setup. @@ -110,7 +110,7 @@ Class Profile inherits the Dispersion container class object. -def __init__(self, num_spins=1, model=None, r2=None, r2a=None, r2b=None, dw=None, pA=None, kex=None, spins_params=None): +def __init__(self, num_spins=1, model=None, r2=None, r2a=None, r2b=None, phi_ex=None, dw=None, pA=None, kex=None, spins_params=None): Special method __init__() is called first (acts as Constructor). It brings in data from outside the class like the variable num_spins. @@ -130,6 +130,8 @@ @type r2a: float @keyword r2b: The transversal relaxation rate for state B in the absence of exchange. @type r2b: float +@keyword phi_ex:The phi_ex = pA.pB.dw**2 value (ppm^2) +@type phi_ex: float @keyword dw:The chemical exchange difference between states A and B in ppm. @type dw: float @keyword pA:The population of state A. @@ -168,7 +170,7 @@ self.error.append([1.0]*len(cpmg_point)) # Assemble param vector. -self.params = self.assemble_param_vector(r2=r2, r2a=r2a, r2b=r2b, dw=dw, pA=pA, kex=kex, spins_params=spins_params) +self.params = self.assemble_param_vector(r2=r2, r2a=r2a, r2b=r2b, phi_ex=phi_ex, dw=dw, pA=pA, kex=kex, spins_params=spins_params) # Make nested list arrays of data. And return them. values, errors, cpmg_frqs, missing, frqs, exp_types, relax_times, offsets = self.return_r2eff_arrays() @@ -292,7 +294,7 @@ return values, errors, cpmg_frqs, missing, frqs, exp_types, relax_times, offsets -def assemble_param_vector(self, r2=None, r2a=None, r2b=None, dw=None, pA=None, kex=None, spins_params=None): +def assemble_param_vector(self, r2=None, r2a=None, r2b=None, phi_ex=None, dw=None, pA=None, kex=None, spins_params=None): Assemble the dispersion relaxation dispersion curve fitting parameter vector. @keyword r2:The transversal relaxation rate. @@ -301,6 +303,8 @@ @type r2a: float @keyword r2b: The transversal relaxation rate for state B in the absence of exchange. @type r2b: float +@keyword phi_ex:The phi_ex = pA.pB.dw**2 value (ppm^2) +@type phi_ex: float @keyword dw:The chemical exchange difference between states A and B in ppm. @type dw: float @keyword pA:The population of state A. @@ -327,6 +331,8 @@ elif param_name == 'r2b': value = r2b value = value + mi + spin_index*0.1 +elif param_name == 'phi_ex': +value = phi_ex + spin_index elif param_name == 'dw': value = dw + spin_index elif param_name == 'pA': @@ -377,6 +383,15 @@ # Then the chemical shift difference parameters 'phi_ex', 'phi_ex_B', 'phi_ex_C', 'padw2', 'dw', 'dw_AB', 'dw_BC', 'dw_AB' (one per spin). for spin_index in range(self.num_spins): +# Yield the data. +if 'phi_ex' in spins_params: +yield 'phi_ex', spin_index, 0 +if 'phi_ex_B' in spins_params: +yield 'phi_ex_B', spin_index, 0 +if 'phi_ex_C' in spins_params: +yield 'phi_ex_C', spin_index, 0
r24140 - /branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_it99.py
Author: tlinnet Date: Wed Jun 18 20:17:26 2014 New Revision: 24140 URL: http://svn.gna.org/viewcvs/relax?rev=24140view=rev Log: Added profiling script for IT99. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_it99.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_it99.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_it99.py?rev=24140r1=24139r2=24140view=diff == --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_it99.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_it99.py Wed Jun 18 20:17:26 2014 @@ -55,7 +55,7 @@ from lib.physical_constants import g1H, g15N from target_functions.chi2 import chi2 from target_functions.relax_disp import Dispersion -from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_SQ, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL +from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG_SQ, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_IT99, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL # Alter setup. @@ -110,7 +110,7 @@ Class Profile inherits the Dispersion container class object. -def __init__(self, num_spins=1, model=None, r2=None, r2a=None, r2b=None, dw=None, pA=None, kex=None, spins_params=None): +def __init__(self, num_spins=1, model=None, r2=None, r2a=None, r2b=None, dw=None, pA=None, kex=None, tex=None, spins_params=None): Special method __init__() is called first (acts as Constructor). It brings in data from outside the class like the variable num_spins. @@ -168,7 +168,7 @@ self.error.append([1.0]*len(cpmg_point)) # Assemble param vector. -self.params = self.assemble_param_vector(r2=r2, r2a=r2a, r2b=r2b, dw=dw, pA=pA, kex=kex, spins_params=spins_params) +self.params = self.assemble_param_vector(r2=r2, r2a=r2a, r2b=r2b, dw=dw, pA=pA, kex=kex, tex=tex, spins_params=spins_params) # Make nested list arrays of data. And return them. values, errors, cpmg_frqs, missing, frqs, exp_types, relax_times, offsets = self.return_r2eff_arrays() @@ -292,7 +292,7 @@ return values, errors, cpmg_frqs, missing, frqs, exp_types, relax_times, offsets -def assemble_param_vector(self, r2=None, r2a=None, r2b=None, dw=None, pA=None, kex=None, spins_params=None): +def assemble_param_vector(self, r2=None, r2a=None, r2b=None, dw=None, pA=None, kex=None, tex=None, spins_params=None): Assemble the dispersion relaxation dispersion curve fitting parameter vector. @keyword r2:The transversal relaxation rate. @@ -333,6 +333,8 @@ value = pA elif param_name == 'kex': value = kex +elif param_name == 'tex': +value = tex # Add to the vector. param_vector.append(value) @@ -387,6 +389,8 @@ yield 'pA', 0, 0 elif param == 'kex': yield 'kex', 0, 0 +elif param == 'tex': +yield 'tex', 0, 0 def calc(self, params): @@ -399,11 +403,11 @@ # Return chi2 value. -chi2 = self.model.func_CR72(params) +chi2 = self.model.func_IT99(params) return chi2 -def single(num_spins=1, model=MODEL_CR72, iter=None): +def single(num_spins=1, model=MODEL_IT99, iter=None): Calculate for a single spin. @keyword num_spins: Number of spins in the cluster. @@ -417,7 +421,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, tex=1/1000.0, spins_params=['r2', 'dw', 'pA', 'tex']) # Loop 100 times for each spin in the clustered analysis (to make the timing numbers equivalent). for spin_index in xrange(100): @@ -427,7 +431,7 @@ print(chi2 single:, chi2) -def cluster(num_spins=100, model=MODEL_CR72, iter=None): +def cluster(num_spins=2, model=MODEL_IT99, iter=None): Calculate for a number of clustered spins. @keyword num_spins: Number of spins in the cluster. @@ -441,7 +445,7 @@ # Instantiate class -C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, kex=1000.0, spins_params=['r2', 'dw', 'pA', 'kex']) +C1 = Profile(num_spins=num_spins, model=model, r2=5.0, dw=3.0, pA=0.9, tex=1/1000.0, spins_params=['r2', 'dw', 'pA', 'tex
r24142 - /branches/disp_spin_speed/lib/dispersion/mmq_cr72.py
Author: tlinnet Date: Wed Jun 18 20:22:02 2014 New Revision: 24142 URL: http://svn.gna.org/viewcvs/relax?rev=24142view=rev Log: Moved the eta_scale = 2.0**(-3.0/2.0) out of lib function for mmq cr72, since this is only needs to be computed once. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/lib/dispersion/mmq_cr72.py Modified: branches/disp_spin_speed/lib/dispersion/mmq_cr72.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/mmq_cr72.py?rev=24142r1=24141r2=24142view=diff == --- branches/disp_spin_speed/lib/dispersion/mmq_cr72.py (original) +++ branches/disp_spin_speed/lib/dispersion/mmq_cr72.py Wed Jun 18 20:22:02 2014 @@ -50,6 +50,9 @@ # Python module imports. from numpy import arccosh, cos, cosh, isfinite, fabs, log, min, max, sin, sqrt, sum from numpy.ma import fix_invalid, masked_greater_equal, masked_where + +# Repetitive calculations (to speed up calculations). +eta_scale = 2.0**(-3.0/2.0) def r2eff_mmq_cr72(r20=None, pA=None, dw=None, dwH=None, kex=None, cpmg_frqs=None, inv_tcpmg=None, tcp=None, back_calc=None): @@ -130,7 +133,6 @@ Dneg = 0.5 * (-1.0 + D_part) # Partial eta+/- values. -eta_scale = 2.0**(-3.0/2.0) etapos_part = eta_scale * sqrt(Psi + sqrt_psi2_zeta2) etaneg_part = eta_scale * sqrt(-Psi + sqrt_psi2_zeta2) ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24143 - /branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_expanded.py
Author: tlinnet Date: Wed Jun 18 20:23:51 2014 New Revision: 24143 URL: http://svn.gna.org/viewcvs/relax?rev=24143view=rev Log: Spell fix in code for ns cpmg 2site expanded. 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_expanded.py Modified: branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_expanded.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_expanded.py?rev=24143r1=24142r2=24143view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_expanded.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_expanded.py Wed Jun 18 20:23:51 2014 @@ -286,8 +286,7 @@ k_BA = pA * kex k_AB = pB * kex - -# Repeditive calculations. +# Repetitive calculations. half_tcp = 0.5 * tcp k_AB_plus_k_BA = k_AB + k_BA k_BA_minus_k_AB = k_BA - k_AB ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24144 - /branches/disp_spin_speed/lib/dispersion/
Author: tlinnet Date: Wed Jun 18 20:28:05 2014 New Revision: 24144 URL: http://svn.gna.org/viewcvs/relax?rev=24144view=rev Log: Fix for missing comments. 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_star.py branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py Modified: branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py?rev=24144r1=24143r2=24144view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py Wed Jun 18 20:28:05 2014 @@ -141,7 +141,6 @@ for si in range(NS): # Loop over the spectrometer frequencies. for mi in range(NM): - # Extract the values from the higher dimensional arrays. R2A_si_mi=r20a[0, si, mi, 0, 0] R2B_si_mi=r20b[0, si, mi, 0, 0] Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py?rev=24144r1=24143r2=24144view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_2site.py Wed Jun 18 20:28:05 2014 @@ -301,7 +301,7 @@ for mi in range(NM): # Loop over offsets: for oi in range(NO): - +# Extract parameters from array. r20a_i = R20A[si, mi, oi, 0] r20b_i = R20B[si, mi, oi, 0] dw_i = dw[si, mi, oi, 0] Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py?rev=24144r1=24143r2=24144view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py Wed Jun 18 20:28:05 2014 @@ -194,7 +194,7 @@ for mi in range(NM): # Loop over offsets: for oi in range(NO): - +# Extract parameters from array. r20a_i = R20A[si, mi, oi, 0] r20b_i = R20B[si, mi, oi, 0] r20c_i = R20C[si, mi, oi, 0] Modified: branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py?rev=24144r1=24143r2=24144view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_r1rho_2site.py Wed Jun 18 20:28:05 2014 @@ -109,7 +109,7 @@ for mi in range(NM): # Loop over offsets: for oi in range(NO): - +# Extract parameters from array. omega_i = omega[0, si, mi, oi, 0] offset_i = offset[0, si, mi, oi, 0] r1_i = r1[0, si, mi, oi, 0] Modified: branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py?rev=24144r1=24143r2=24144view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_r1rho_3site.py Wed Jun 18 20:28:05 2014 @@ -130,7 +130,7 @@ for mi in range(NM): # Loop over offsets: for oi in range(NO): - +# Extract parameters from array. omega_i = omega[0, si, mi, oi, 0] offset_i = offset[0, si, mi, oi, 0] r1_i = r1[0, si, mi, oi, 0] ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24145 - in /branches/disp_spin_speed/lib/dispersion: ns_cpmg_2site_3d.py ns_cpmg_2site_star.py ns_mmq_3site.py
Author: tlinnet Date: Wed Jun 18 20:32:40 2014 New Revision: 24145 URL: http://svn.gna.org/viewcvs/relax?rev=24145view=rev Log: Fix for spaces aroung = outside functions. 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 branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.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=24145r1=24144r2=24145view=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 18 20:32:40 2014 @@ -134,8 +134,8 @@ for mi in range(NM): # Extract the values from the higher dimensional arrays. -R2A_si_mi=r20a[0, si, mi, 0, 0] -R2B_si_mi=r20b[0, si, mi, 0, 0] +R2A_si_mi = r20a[0, si, mi, 0, 0] +R2B_si_mi = r20b[0, si, mi, 0, 0] dw_si_mi = dw[0, si, mi, 0, 0] num_points_si_mi = int(num_points[0, si, mi, 0]) Modified: branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py?rev=24145r1=24144r2=24145view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_cpmg_2site_star.py Wed Jun 18 20:32:40 2014 @@ -142,8 +142,8 @@ # Loop over the spectrometer frequencies. for mi in range(NM): # Extract the values from the higher dimensional arrays. -R2A_si_mi=r20a[0, si, mi, 0, 0] -R2B_si_mi=r20b[0, si, mi, 0, 0] +R2A_si_mi = r20a[0, si, mi, 0, 0] +R2B_si_mi = r20b[0, si, mi, 0, 0] dw_si_mi = dw[0, si, mi, 0, 0] num_points_si_mi = int(num_points[0, si, mi, 0]) Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py?rev=24145r1=24144r2=24145view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py Wed Jun 18 20:32:40 2014 @@ -199,10 +199,10 @@ r20b_i = R20B[si, mi, oi, 0] r20c_i = R20C[si, mi, oi, 0] -dw_AB_i=dw_AB[si, mi, oi, 0] -dw_AC_i=dw_AC[si, mi, oi, 0] -dwH_AB_i=dwH_AB[si, mi, oi, 0] -dwH_AC_i=dwH_AC[si, mi, oi, 0] +dw_AB_i = dw_AB[si, mi, oi, 0] +dw_AC_i = dw_AC[si, mi, oi, 0] +dwH_AB_i =d wH_AB[si, mi, oi, 0] +dwH_AC_i = dwH_AC[si, mi, oi, 0] num_points_i = num_points[si, mi, oi] # Populate the m1 and m2 matrices (only once per function call for speed). @@ -377,10 +377,10 @@ r20b_i = R20B[si, mi, oi, 0] r20c_i = R20C[si, mi, oi, 0] -dw_AB_i=dw_AB[si, mi, oi, 0] -dw_AC_i=dw_AC[si, mi, oi, 0] -dwH_AB_i=dwH_AB[si, mi, oi, 0] -dwH_AC_i=dwH_AC[si, mi, oi, 0] +dw_AB_i = dw_AB[si, mi, oi, 0] +dw_AC_i = dw_AC[si, mi, oi, 0] +dwH_AB_i = dwH_AB[si, mi, oi, 0] +dwH_AC_i = dwH_AC[si, mi, oi, 0] num_points_i = num_points[si, mi, oi] # Populate the m1 and m2 matrices (only once per function call for speed). ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24146 - /branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py
Author: tlinnet Date: Wed Jun 18 20:41:35 2014 New Revision: 24146 URL: http://svn.gna.org/viewcvs/relax?rev=24146view=rev Log: Critical fix for wrong space inserted in ns mmq 3site mq. 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_mmq_3site.py Modified: branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py?rev=24146r1=24145r2=24146view=diff == --- branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py (original) +++ branches/disp_spin_speed/lib/dispersion/ns_mmq_3site.py Wed Jun 18 20:41:35 2014 @@ -201,7 +201,7 @@ dw_AB_i = dw_AB[si, mi, oi, 0] dw_AC_i = dw_AC[si, mi, oi, 0] -dwH_AB_i =d wH_AB[si, mi, oi, 0] +dwH_AB_i = dwH_AB[si, mi, oi, 0] dwH_AC_i = dwH_AC[si, mi, oi, 0] num_points_i = num_points[si, mi, oi] ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24147 - /branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py
Author: tlinnet Date: Wed Jun 18 20:41:37 2014 New Revision: 24147 URL: http://svn.gna.org/viewcvs/relax?rev=24147view=rev Log: Fixed the input for unit test of mmq cr72. The number of input parameters has been lowered. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py Modified: branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py?rev=24147r1=24146r2=24147view=diff == --- branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py (original) +++ branches/disp_spin_speed/test_suite/unit_tests/_lib/_dispersion/test_mmq_cr72.py Wed Jun 18 20:41:37 2014 @@ -62,7 +62,7 @@ a = ones(self.ncyc.shape) # Calculate the R2eff values. -r2eff_mmq_cr72(r20=self.r20*a, pA=self.pA, pB=pB, dw=dw_frq*a, dwH=dwH_frq*a, kex=self.kex, k_AB=k_AB, k_BA=k_BA, cpmg_frqs=self.cpmg_frqs, inv_tcpmg=self.inv_relax_times, tcp=self.tau_cpmg, back_calc=self.R2eff) +r2eff_mmq_cr72(r20=self.r20*a, pA=self.pA, dw=dw_frq*a, dwH=dwH_frq*a, kex=self.kex, cpmg_frqs=self.cpmg_frqs, inv_tcpmg=self.inv_relax_times, tcp=self.tau_cpmg, back_calc=self.R2eff) # Check all R2eff values. for i in range(self.num_points): ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r24148 - /branches/disp_spin_speed/lib/dispersion/b14.py
Author: tlinnet Date: Wed Jun 18 20:50:32 2014 New Revision: 24148 URL: http://svn.gna.org/viewcvs/relax?rev=24148view=rev Log: Added additional math domain checking in B14. This is when v1c is less than 1.0. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/lib/dispersion/b14.py Modified: branches/disp_spin_speed/lib/dispersion/b14.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/b14.py?rev=24148r1=24147r2=24148view=diff == --- branches/disp_spin_speed/lib/dispersion/b14.py (original) +++ branches/disp_spin_speed/lib/dispersion/b14.py Wed Jun 18 20:50:32 2014 @@ -149,6 +149,7 @@ t_max_e = False t_v3_N_zero = False t_log_tog_neg = False +t_v1c_less_one = False # Catch parameter values that will result in no exchange, returning flat R2eff = R20 lines (when kex = 0.0, k_AB = 0.0). # Test if pA or kex is zero. @@ -241,6 +242,13 @@ # Real. The v_1c in paper. v1c = F0 * cosh(E0) - F2 * cos(E2) +# Catch math domain error of sqrt of negative. +# This is when v1c is less than 1. +mask_v1c_less_one = v1c 1.0 +if any(mask_v1c_less_one): +t_v1c_less_one = True +v1c[mask_v1c_less_one] = 1.0 + # Exact result for v2v3. v3 = sqrt(v1c**2 - 1.) @@ -286,6 +294,10 @@ if t_max_e: back_calc[mask_max_e.mask] = r20a[mask_max_e.mask] +# If v1c is less than 1. +if t_v1c_less_one: +back_calc[mask_v1c_less_one] = 1e100 + # If Tog_div is zero. if t_v3_N_zero: back_calc[mask_v3_N_zero] = 1e100 ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits