mailr20864 - /branches/relax_disp/specific_analyses/relax_disp/disp_data.py


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

Header


Content

Posted by edward on September 06, 2013 - 08:57:
Author: bugman
Date: Fri Sep  6 08:57:51 2013
New Revision: 20864

URL: http://svn.gna.org/viewcvs/relax?rev=20864&view=rev
Log:
Added two functions for determining if a spectrum ID corresponds to a CPMG or 
R1rho experiment.

These are functions in specific_analyses.relax_disp.disp_data and they are 
called is_cpmg_exp_type()
and is_r1rho_exp_type().


Modified:
    branches/relax_disp/specific_analyses/relax_disp/disp_data.py

Modified: branches/relax_disp/specific_analyses/relax_disp/disp_data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/disp_data.py?rev=20864&r1=20863&r2=20864&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/disp_data.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/disp_data.py Fri Sep  6 
08:57:51 2013
@@ -381,6 +381,48 @@
     return False
 
 
+def is_cpmg_exp_type(id=None):
+    """Determine if the given spectrum ID corresponds to a CPMG experiment 
type.
+
+    @keyword id:    The spectrum ID string.
+    @type id:       str
+    @return:        True if the spectrum ID corresponds to a CPMG experiment 
type, False otherwise.
+    @rtype:         bool
+    """
+
+    # No experiment type set.
+    if not hasattr(cdp, 'exp_type') or id not in cdp.exp_type:
+        return False
+
+    # CPMG experiment type.
+    if cdp.exp_type[id] in EXP_TYPE_LIST_CPMG:
+        return True
+
+    # Not a CPMG experiment type.
+    return False
+
+
+def is_r1rho_exp_type(id=None):
+    """Determine if the given spectrum ID corresponds to a R1rho experiment 
type.
+
+    @keyword id:    The spectrum ID string.
+    @type id:       str
+    @return:        True if the spectrum ID corresponds to a R1rho 
experiment type, False otherwise.
+    @rtype:         bool
+    """
+
+    # No experiment type set.
+    if not hasattr(cdp, 'exp_type') or id not in cdp.exp_type:
+        return False
+
+    # R1rho experiment type.
+    if cdp.exp_type[id] in EXP_TYPE_LIST_R1RHO:
+        return True
+
+    # Not a R1rho experiment type.
+    return False
+
+
 def loop_cluster():
     """Loop over the spin groupings for one model applied to multiple spins.
 




Related Messages


Powered by MHonArc, Updated Fri Sep 06 09:20:02 2013