mailr20846 - in /branches/relax_disp/specific_analyses/relax_disp: api.py cpmgfit.py nessy.py parameters.py sherekhan.py


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

Header


Content

Posted by edward on September 05, 2013 - 14:43:
Author: bugman
Date: Thu Sep  5 14:43:49 2013
New Revision: 20846

URL: http://svn.gna.org/viewcvs/relax?rev=20846&view=rev
Log:
More fixes due to the cdp.exp_type change.

This follows from http://thread.gmane.org/gmane.science.nmr.relax.devel/4530, 
the thread about
supporting multiple data types such as SQ+MQ data simultaneously.


Modified:
    branches/relax_disp/specific_analyses/relax_disp/api.py
    branches/relax_disp/specific_analyses/relax_disp/cpmgfit.py
    branches/relax_disp/specific_analyses/relax_disp/nessy.py
    branches/relax_disp/specific_analyses/relax_disp/parameters.py
    branches/relax_disp/specific_analyses/relax_disp/sherekhan.py

Modified: branches/relax_disp/specific_analyses/relax_disp/api.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/api.py?rev=20846&r1=20845&r2=20846&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/api.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/api.py Thu Sep  5 
14:43:49 2013
@@ -163,17 +163,19 @@
         return results
 
 
-    def _back_calc_peak_intensities(self, spin=None, frq=None, point=None):
+    def _back_calc_peak_intensities(self, spin=None, exp_type=None, 
frq=None, point=None):
         """Back-calculation of peak intensity for the given relaxation time.
 
-        @keyword spin:  The specific spin data container.
-        @type spin:     SpinContainer instance
-        @keyword frq:   The spectrometer frequency.
-        @type frq:      float
-        @keyword point: The dispersion point data (either the spin-lock 
field strength in Hz or the nu_CPMG frequency in Hz).
-        @type point:    float
-        @return:        The back-calculated peak intensities for the given 
exponential curve.
-        @rtype:         numpy rank-1 float array
+        @keyword spin:      The specific spin data container.
+        @type spin:         SpinContainer instance
+        @keyword exp_type:  The experiment type.
+        @type exp_type:     str
+        @keyword frq:       The spectrometer frequency.
+        @type frq:          float
+        @keyword point:     The dispersion point data (either the spin-lock 
field strength in Hz or the nu_CPMG frequency in Hz).
+        @type point:        float
+        @return:            The back-calculated peak intensities for the 
given exponential curve.
+        @rtype:             numpy rank-1 float array
         """
 
         # Check.
@@ -195,8 +197,8 @@
         times = []
         for time in cdp.relax_time_list:
             # The data.
-            values.append(average_intensity(spin=spin, frq=frq, point=point, 
time=time))
-            errors.append(average_intensity(spin=spin, frq=frq, point=point, 
time=time, error=True))
+            values.append(average_intensity(spin=spin, exp_type=exp_type, 
frq=frq, point=point, time=time))
+            errors.append(average_intensity(spin=spin, exp_type=exp_type, 
frq=frq, point=point, time=time, error=True))
             times.append(time)
 
         # The scaling matrix in a diagonalised list form.
@@ -487,8 +489,8 @@
                 errors = []
                 times = []
                 for time in cdp.relax_time_list:
-                    values.append(average_intensity(spin=spin, frq=frq, 
point=point, time=time, sim_index=sim_index))
-                    errors.append(average_intensity(spin=spin, frq=frq, 
point=point, time=time, error=True))
+                    values.append(average_intensity(spin=spin, 
exp_type=exp_type, frq=frq, point=point, time=time, sim_index=sim_index))
+                    errors.append(average_intensity(spin=spin, 
exp_type=exp_type, frq=frq, point=point, time=time, error=True))
                     times.append(time)
 
                 # The scaling matrix in a diagonalised list form.
@@ -621,14 +623,14 @@
         elif model == MODEL_NOREX:
             print("The model for no chemical exchange relaxation.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
 
         # LM63 model.
         elif model == MODEL_LM63:
             print("The Luz and Meiboom (1963) 2-site fast exchange model.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['phi_ex', 'kex']
 
@@ -636,7 +638,7 @@
         elif model == MODEL_LM63_3SITE:
             print("The Luz and Meiboom (1963) 3-site fast exchange model.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['phi_ex_B', 'phi_ex_C', 'kB', 'kC']
 
@@ -644,9 +646,9 @@
         elif model == MODEL_CR72_FULL:
             print("The full Carver and Richards (1972) 2-site model for all 
time scales.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2a')
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2b')
             params += ['pA', 'dw', 'kex']
 
@@ -654,7 +656,7 @@
         elif model == MODEL_CR72:
             print("The reduced Carver and Richards (1972) 2-site model for 
all time scales, whereby the simplification R20A = R20B is assumed.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['pA', 'dw', 'kex']
 
@@ -662,7 +664,7 @@
         elif model == MODEL_IT99:
             print("The Ishima and Torchia (1999) CPMG 2-site model for all 
time scales with pA >> pB.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['phi_ex', 'padw2', 'tex']
 
@@ -670,7 +672,7 @@
         elif model == MODEL_TSMFK01:
             print("The Tollinger, Kay et al. (2001) 2-site very-slow 
exchange model, range of microsecond to second time scale.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2a')
             params += ['dw', 'kA']
 
@@ -678,9 +680,9 @@
         elif model == MODEL_NS_CPMG_2SITE_3D_FULL:
             print("The full numerical solution for the 2-site 
Bloch-McConnell equations for CPMG data using 3D magnetisation vectors.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2a')
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2b')
             params += ['pA', 'dw', 'kex']
 
@@ -688,7 +690,7 @@
         elif model == MODEL_NS_CPMG_2SITE_3D:
             print("The reduced numerical solution for the 2-site 
Bloch-McConnell equations for CPMG data using 3D magnetisation vectors, 
whereby the simplification R20A = R20B is assumed.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['pA', 'dw', 'kex']
 
@@ -696,7 +698,7 @@
         elif model == MODEL_NS_CPMG_2SITE_EXPANDED:
             print("The numerical solution for the 2-site Bloch-McConnell 
equations for CPMG data expanded using Maple by Nikolai Skrynnikov.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['pA', 'dw', 'kex']
 
@@ -704,9 +706,9 @@
         elif model == MODEL_NS_CPMG_2SITE_STAR_FULL:
             print("The full numerical solution for the 2-site 
Bloch-McConnell equations for CPMG data using complex conjugate matrices.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2a')
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2b')
             params += ['pA', 'dw', 'kex']
 
@@ -714,7 +716,7 @@
         elif model == MODEL_NS_CPMG_2SITE_STAR:
             print("The numerical reduced solution for the 2-site 
Bloch-McConnell equations for CPMG data using complex conjugate matrices, 
whereby the simplification R20A = R20B is assumed.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['pA', 'dw', 'kex']
 
@@ -722,7 +724,7 @@
         elif model == MODEL_M61:
             print("The Meiboom (1961) 2-site fast exchange model for 
R1rho-type experiments.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['phi_ex', 'kex']
 
@@ -730,7 +732,7 @@
         elif model == MODEL_M61B:
             print("The Meiboom (1961) on-resonance 2-site model with skewed 
populations (pA >> pB) for R1rho-type experiments.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['pA', 'dw', 'kex']
 
@@ -738,7 +740,7 @@
         elif model == MODEL_DPL94:
             print("The Davis, Perlman and London (1994) 2-site fast exchange 
model for R1rho-type experiments.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['phi_ex', 'kex']
 
@@ -746,7 +748,7 @@
         elif model == MODEL_TP02:
             print("The Trott and Palmer (2002) off-resonance 2-site model 
for R1rho-type experiments.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['pA', 'dw', 'kex']
 
@@ -754,7 +756,7 @@
         elif model == MODEL_NS_R1RHO_2SITE:
             print("The reduced numerical solution for the 2-site 
Bloch-McConnell equations for R1rho data using 3D magnetisation vectors, 
whereby the simplification R20A = R20B is assumed.")
             params = []
-            for exp_type, frq in loop_exp_frq():
+            for frq in loop_frq():
                 params.append('r2')
             params += ['pA', 'dw', 'kex']
 

Modified: branches/relax_disp/specific_analyses/relax_disp/cpmgfit.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/cpmgfit.py?rev=20846&r1=20845&r2=20846&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/cpmgfit.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/cpmgfit.py Thu Sep  5 
14:43:49 2013
@@ -41,7 +41,7 @@
 from pipe_control import pipes
 from pipe_control.spectrometer import get_frequencies
 from pipe_control.mol_res_spin import exists_mol_res_spin_data, spin_loop
-from specific_analyses.relax_disp.disp_data import loop_frq_point, 
return_param_key_from_data
+from specific_analyses.relax_disp.disp_data import loop_exp_frq_point, 
return_param_key_from_data
 
 
 def cpmgfit_execute(dir=None, binary='cpmgfit', force=False):
@@ -259,7 +259,7 @@
 
     # The data.
     file.write("data\n")
-    for frq, point in loop_frq_point():
+    for exp_type, frq, point in loop_exp_frq_point():
         # The parameter key.
         param_key = return_param_key_from_data(frq=frq, point=point)
 

Modified: branches/relax_disp/specific_analyses/relax_disp/nessy.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/nessy.py?rev=20846&r1=20845&r2=20846&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/nessy.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/nessy.py Thu Sep  5 
14:43:49 2013
@@ -32,7 +32,7 @@
 from pipe_control import pipes
 from pipe_control.spectrometer import get_frequencies
 from pipe_control.mol_res_spin import exists_mol_res_spin_data, spin_loop
-from specific_analyses.relax_disp.disp_data import find_intensity_keys, 
loop_frq, loop_frq_point_time, loop_point, return_index_from_disp_point, 
return_index_from_frq
+from specific_analyses.relax_disp.disp_data import find_intensity_keys, 
loop_exp_frq, loop_exp_frq_point_time, loop_point, 
return_index_from_disp_point, return_index_from_frq
 
 
 def nessy_input(file='save.NESSY', dir=None, spin_id=None, force=False):
@@ -281,14 +281,14 @@
                 raise RelaxError("A residue number of greater than 700 is 
not supported in NESSY.")
 
             # Loop over all spectrometer frequencies.
-            for frq in loop_frq():
+            for exp_type, frq in loop_exp_frq():
                 # Loop over all dispersion points.
                 field_index = 0
-                for point in loop_point(skip_ref=False):
+                for point in loop_point(exp_type=exp_type, skip_ref=False):
                     # Indices and keys.
                     exp_index = return_index_from_frq(frq)
                     point_index = return_index_from_disp_point(point)
-                    keys = find_intensity_keys(frq=frq, point=point, 
time=cdp.relax_time_list[0])
+                    keys = find_intensity_keys(exp_type=exp_type, frq=frq, 
point=point, time=cdp.relax_time_list[0])
 
                     # Convert the reference point for NESSY input.
                     if point == None:
@@ -320,7 +320,7 @@
         frq_T = get_frequencies(units='T')
 
         # Loop over all data points.
-        for frq, point, time in loop_frq_point_time():
+        for exp_type, frq, point, time in loop_exp_frq_point_time():
             # The frequency index.
             frq_index = cdp.spectrometer_frq_list.index(frq)
 

Modified: branches/relax_disp/specific_analyses/relax_disp/parameters.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/parameters.py?rev=20846&r1=20845&r2=20846&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/parameters.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/parameters.py Thu Sep  5 
14:43:49 2013
@@ -35,7 +35,7 @@
 from lib.text.sectioning import subsection
 from pipe_control import pipes
 from pipe_control.mol_res_spin import exists_mol_res_spin_data, return_spin
-from specific_analyses.relax_disp.disp_data import count_frq, loop_cluster, 
loop_frq, loop_frq_point
+from specific_analyses.relax_disp.disp_data import count_frq, loop_cluster, 
loop_frq
 from specific_analyses.relax_disp.variables import EXP_TYPE_LIST_VAR_TIME, 
MODEL_R2EFF, MODEL_M61B
 
 
@@ -279,6 +279,7 @@
 
     # Switch back to the original data pipe.
     pipes.switch(pipe_orig)
+
 
 def disassemble_param_vector(param_vector=None, key=None, spins=None, 
sim_index=None):
     """Disassemble the parameter vector.

Modified: branches/relax_disp/specific_analyses/relax_disp/sherekhan.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/sherekhan.py?rev=20846&r1=20845&r2=20846&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/sherekhan.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/sherekhan.py Thu Sep  5 
14:43:49 2013
@@ -40,7 +40,7 @@
 from pipe_control import pipes
 from pipe_control.mol_res_spin import exists_mol_res_spin_data, 
return_residue, spin_loop
 from pipe_control.spectrometer import get_frequencies
-from specific_analyses.relax_disp.disp_data import loop_cluster, loop_frq, 
loop_point, return_param_key_from_data, spin_ids_to_containers
+from specific_analyses.relax_disp.disp_data import loop_cluster, 
loop_exp_frq, loop_point, return_param_key_from_data, spin_ids_to_containers
 
 
 def sherekhan_input(spin_id=None, force=False):
@@ -79,7 +79,7 @@
 
         # Loop over the magnetic fields.
         frq_index = 0
-        for frq in loop_frq():
+        for exp_type, frq in loop_exp_frq():
             # The ShereKhan input file for the spin cluster.
             file_name = 'sherekhan_frq%s.in' % (frq_index+1)
             dir_name = 'cluster%s' % (cluster_index+1)
@@ -111,7 +111,7 @@
                 lines.append("# %s%s\n" % (res_name, res.num))
 
                 # Loop over the dispersion points.
-                for point in loop_point(skip_ref=True):
+                for point in loop_point(exp_type=exp_type, skip_ref=True):
                     # The parameter key.
                     param_key = return_param_key_from_data(frq=frq, 
point=point)
 




Related Messages


Powered by MHonArc, Updated Thu Sep 05 15:00:01 2013