mailRe: r24927 - /branches/R1_fitting/specific_analyses/relax_disp/data.py


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

Header


Content

Posted by Edward d'Auvergne on August 18, 2014 - 10:09:
Hi,

The comment part "raise an error" is not correct here - this might
confuse future developers as to the intent of your code.  It is rather
setting a warning string.

Cheers,

Edward



On 4 August 2014 16:27,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Mon Aug  4 16:27:40 2014
New Revision: 24927

URL: http://svn.gna.org/viewcvs/relax?rev=24927&view=rev
Log:
Modified return_r1_data() function, to return numpy array of "None", if 
model is in list of "MODEL_LIST_R1RHO_FIT_R1".

sr #3135(https://gna.org/support/?3135): Optimisation of the R1 relaxation 
rate for the off-resonance R1rho relaxation dispersion models.

Modified:
    branches/R1_fitting/specific_analyses/relax_disp/data.py

Modified: branches/R1_fitting/specific_analyses/relax_disp/data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/R1_fitting/specific_analyses/relax_disp/data.py?rev=24927&r1=24926&r2=24927&view=diff
==============================================================================
--- branches/R1_fitting/specific_analyses/relax_disp/data.py    (original)
+++ branches/R1_fitting/specific_analyses/relax_disp/data.py    Mon Aug  4 
16:27:40 2014
@@ -79,7 +79,7 @@
 from pipe_control import value
 import specific_analyses
 from specific_analyses.relax_disp.checks import check_exp_type, 
check_interpolate_offset_cpmg_model, check_mixed_curve_types
-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_DESC_CPMG_DQ, 
EXP_TYPE_DESC_CPMG_MQ, EXP_TYPE_DESC_CPMG_PROTON_MQ, 
EXP_TYPE_DESC_CPMG_PROTON_SQ, EXP_TYPE_DESC_CPMG_SQ, EXP_TYPE_DESC_CPMG_ZQ, 
EXP_TYPE_DESC_R1RHO, EXP_TYPE_LIST, EXP_TYPE_LIST_CPMG, 
EXP_TYPE_LIST_R1RHO, EXP_TYPE_R1RHO, MODEL_B14, MODEL_B14_FULL, 
MODEL_DPL94, MODEL_LIST_MMQ, MODEL_LIST_NUMERIC_CPMG, MODEL_LIST_R1RHO, 
MODEL_LIST_R1RHO_FULL, MODEL_LIST_R1RHO_W_R1, MODEL_MP05, 
MODEL_NS_R1RHO_2SITE, MODEL_PARAMS, MODEL_R2EFF, MODEL_TAP03, MODEL_TP02, 
PARAMS_R20
+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_DESC_CPMG_DQ, 
EXP_TYPE_DESC_CPMG_MQ, EXP_TYPE_DESC_CPMG_PROTON_MQ, 
EXP_TYPE_DESC_CPMG_PROTON_SQ, EXP_TYPE_DESC_CPMG_SQ, EXP_TYPE_DESC_CPMG_ZQ, 
EXP_TYPE_DESC_R1RHO, EXP_TYPE_LIST, EXP_TYPE_LIST_CPMG, 
EXP_TYPE_LIST_R1RHO, EXP_TYPE_R1RHO, MODEL_B14, MODEL_B14_FULL, 
MODEL_DPL94, MODEL_LIST_MMQ, MODEL_LIST_NUMERIC_CPMG, MODEL_LIST_R1RHO, 
MODEL_LIST_R1RHO_FULL, MODEL_LIST_R1RHO_FIT_R1, MODEL_LIST_R1RHO_W_R1, 
MODEL_MP05, MODEL_NS_R1RHO_2SITE, MODEL_PARAMS, MODEL_R2EFF, MODEL_TAP03, 
MODEL_TP02, PARAMS_R20
 from stat import S_IRWXU, S_IRGRP, S_IROTH
 from os import chmod, sep

@@ -4044,6 +4044,12 @@
                 if spin.model in MODEL_LIST_R1RHO_W_R1:
                     raise RelaxError(error_text)

+                # For all R1rho models fitting R1, raise an error, set 
value to None.
+                elif spin.model in MODEL_LIST_R1RHO_FIT_R1:
+                    warn_text = "No R1 relaxation data has been loaded.  
Setting it to None.  This is essential for the proper handling of offsets 
in off-resonance R1rho experiments."
+                    for mi in range(field_count):
+                        r1[si, mi] = None
+
                 # For all models not listed in R1rho models, raise a 
warning, and set 0.0 as value.
                 else:
                     warn(RelaxWarning(warn_text))


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

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



Related Messages


Powered by MHonArc, Updated Mon Aug 18 10:40:12 2014