mailr25096 - /trunk/specific_analyses/relax_disp/model.py


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

Header


Content

Posted by tlinnet on August 20, 2014 - 16:01:
Author: tlinnet
Date: Wed Aug 20 16:01:39 2014
New Revision: 25096

URL: http://svn.gna.org/viewcvs/relax?rev=25096&view=rev
Log:
Inserted return of True/False flags from function which convert models.

The flag tells if:
- flag if 'No Rex' model for R1rho off-resonance was translated.
- flag if 'No Rex' model for R1rho off-resonance was inserted.
- flag if R1rho off-resonance was translated to 'R1 fit' models if no R1 data 
was found.

Modified:
    trunk/specific_analyses/relax_disp/model.py

Modified: trunk/specific_analyses/relax_disp/model.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/model.py?rev=25096&r1=25095&r2=25096&view=diff
==============================================================================
--- trunk/specific_analyses/relax_disp/model.py (original)
+++ trunk/specific_analyses/relax_disp/model.py Wed Aug 20 16:01:39 2014
@@ -109,9 +109,14 @@
 
     @keyword self_models:   The list of all models analysed.
     @type self_models:      list of str
-    @return:                The corrected all models list.
-    @rtype:                 list of str
-    """
+    @return:                The corrected all models list, flag if 'No Rex' 
model for R1rho off-resonance was translated, flag if 'No Rex' model for 
R1rho off-resonance was inserted, flag if R1rho off-resonance was translated 
to 'R1 fit' models if no R1 data was found.
+    @rtype:                 list of str, bool, bool, bool
+    """
+
+    # Flags to return.
+    no_rex_translated = False
+    no_rex_inserted = False
+    r1ho_translated = False
 
     # First check if 'No Rex' model should be converted to 'No Rex R1rho off 
res' for R1rho off-resonance.
     # First remove 'R2eff' model from the list.
@@ -146,6 +151,9 @@
             no_rex_index = self_models.index(MODEL_NOREX)
             self_models[no_rex_index] = MODEL_NOREX_R1RHO
 
+            # Change flag.
+            no_rex_translated = True
+
     # If some of the models are R1rho off-resonance, and MODEL_NOREX is 
present but MODEL_NOREX_R1RHO is not present.
     elif any_r1rho_off_res:
         # Then test if 'No Rex' is the only 'No Rex' model.
@@ -154,6 +162,9 @@
             no_rex_index = self_models.index(MODEL_NOREX)
             self_models.insert(no_rex_index + 1, MODEL_NOREX_R1RHO)
 
+            # Change flag.
+            no_rex_inserted = True
+
     # Loop through all models, to replace with 'R1 fit' model, if R1 is 
missing.
     for i, model in enumerate(self_models):
         # Check if R1 is missing.
@@ -171,8 +182,11 @@
             # Replace the model.
             self_models[i] = translated_model
 
+            # Flag if translated,
+            r1ho_translated = True
+
     # Return the model.
-    return self_models
+    return self_models, no_rex_translated, no_rex_inserted, r1ho_translated
 
 
 # Define function, to return model info.




Related Messages


Powered by MHonArc, Updated Wed Aug 20 16:20:02 2014