mailr25166 - /trunk/target_functions/relax_disp.py


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

Header


Content

Posted by edward on August 21, 2014 - 14:52:
Author: bugman
Date: Thu Aug 21 14:52:25 2014
New Revision: 25166

URL: http://svn.gna.org/viewcvs/relax?rev=25166&view=rev
Log:
Converted the relaxation dispersion target function class to the unified 'No 
Rex' model design.

On top of removing all references to MODEL_NOREX_R1RHO, the aliasing of 
self.func now checks the
experiment type list to determine which target function to use.  This is not 
an ideal solution and
will not handle mixed CPMG and R1rho experiment, however neither will the 
target functions yet.

The creation of the off-resonance data structures has also been modified so 
that they are now R1rho
independent.  This allows the structures to be properly created while at the 
same time enabling this
code to be compatible with off-resonance CPMG data in the future.

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=25166&r1=25165&r2=25166&view=diff
==============================================================================
--- trunk/target_functions/relax_disp.py        (original)
+++ trunk/target_functions/relax_disp.py        Thu Aug 21 14:52:25 2014
@@ -55,7 +55,7 @@
 from lib.errors import RelaxError
 from lib.float import isNaN
 from target_functions.chi2 import 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_LIST_CPMG, EXP_TYPE_R1RHO, 
MODEL_B14, MODEL_B14_FULL, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, 
MODEL_IT99, MODEL_LIST_CPMG, MODEL_LIST_FULL, MODEL_LIST_DW_MIX_DOUBLE, 
MODEL_LIST_DW_MIX_QUADRUPLE, MODEL_LIST_INV_RELAX_TIMES, MODEL_LIST_R20B, 
MODEL_LIST_MMQ, MODEL_LIST_MQ_CPMG, MODEL_LIST_NUMERIC, MODEL_LIST_R1RHO, 
MODEL_LIST_R1RHO_FULL, MODEL_LIST_R1RHO_OFF_RES, MODEL_LM63, 
MODEL_LM63_3SITE, MODEL_M61, MODEL_M61B, MODEL_MP05, MODEL_MMQ_CR72, 
MODEL_NOREX, MODEL_NOREX_R1RHO, 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_FULL, MODEL_LIST_DW_MIX_DOUBLE, 
MODEL_LIST_DW_MIX_QUADRUPLE, MODEL_LIST_INV_RELAX_TIMES, MODEL_LIST_R20B, 
MODEL_LIST_MMQ, MODEL_LIST_MQ_CPMG, MODEL_LIST_NUMERIC, MODEL_LIST_R1RHO, 
MODEL_LIST_R1RHO_FULL, MODEL_LIST_R1RHO_OFF_RES, 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:
@@ -359,21 +359,22 @@
                         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)
 
+                        # Store the offset data.
+                        if offset != None and len(offset[ei][si][mi]):
+                            self.offset[ei, si, mi, oi] = 
offset[ei][si][mi][oi]
+
                         # Loop over dispersion points.
                         for di in range(num_disp_points):
                             if missing[ei][si][mi][oi][di]:
                                 self.has_missing = True
                                 self.missing[ei, si, mi, oi, di] = 1.0
 
-                            # For R1rho data.
-                            if model in MODEL_LIST_R1RHO_FULL and model != 
MODEL_NOREX:
-                                self.disp_struct[ei, si, mi, oi, di] = 1.0
-
-                                # Get the tilt angles.
+                            # Get the tilt angles for off-resonance data.
+                            if tilt_angles != None and di < 
len(tilt_angles[ei][si][mi][oi]):
                                 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.
+                            if spin_lock_nu1 != None and 
len(spin_lock_nu1[ei][mi][oi]):
                                 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
 
@@ -483,12 +484,14 @@
 
         # Set up the model.
         if model == MODEL_NOREX:
-            self.func = self.func_NOREX
-        if model == MODEL_NOREX_R1RHO:
-            if r1_fit:
-                self.func = self.func_NOREX_R1RHO_FIT_R1
+            # FIXME: Handle mixed experiment types here - probably by 
merging target functions.
+            if self.exp_types[0] in EXP_TYPE_LIST_CPMG:
+                self.func = self.func_NOREX
             else:
-                self.func = self.func_NOREX_R1RHO
+                if r1_fit:
+                    self.func = self.func_NOREX_R1RHO_FIT_R1
+                else:
+                    self.func = self.func_NOREX_R1RHO
         if model == MODEL_LM63:
             self.func = self.func_LM63
         if model == MODEL_LM63_3SITE:




Related Messages


Powered by MHonArc, Updated Thu Aug 21 15:00:03 2014