Author: tlinnet
Date: Sun Nov 22 16:02:42 2015
New Revision: 28082
URL: http://svn.gna.org/viewcvs/relax?rev=28082&view=rev
Log:
In the function of r2eff_read, in data module of the dispersion, added the
possibilities to read
r2eff values which are replicated.
This is done first checking if the dispersion key exists in the r2eff
dictionary.
If it exists, continue add 0.001 to the frequency until a new possibility
exists.
This should help handle multiple R2eff points, as separate values and not
taking any decision to average them.
Modified:
trunk/specific_analyses/relax_disp/data.py
Modified: trunk/specific_analyses/relax_disp/data.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/data.py?rev=28082&r1=28081&r2=28082&view=diff
==============================================================================
--- trunk/specific_analyses/relax_disp/data.py (original)
+++ trunk/specific_analyses/relax_disp/data.py Sun Nov 22 16:02:42 2015
@@ -2383,14 +2383,35 @@
# The dispersion point key.
point_key = return_param_key_from_data(exp_type=exp_type, frq=frq,
offset=offset, point=disp_frq)
+ # Store the infinitesimal small change instead ?
+ store_infinitesimal = False
+
# Store the R2eff data.
if data_col:
# Initialise if necessary.
if not hasattr(spin, 'r2eff'):
spin.r2eff = {}
- # Store.
- spin.r2eff[point_key] = value
+ # First check that a replicate does not exists. And it if
exists, find a new id with infinitesimal small change.
+ if point_key in spin.r2eff:
+ warn(RelaxWarning("The r2eff value key: %s already exists.
\nAn infinitesimal small change to the dispersion frequency is performed,
until a new point can be stored."%(point_key)))
+
+ # Store the current values.
+ disp_frq_infinitesimal = disp_frq
+ point_key_infinitesimal = point_key
+
+ # Continue until found
+ while point_key_infinitesimal == point_key:
+ disp_frq_infinitesimal += 0.001
+ point_key_infinitesimal =
return_param_key_from_data(exp_type=exp_type, frq=frq, offset=offset,
point=disp_frq_infinitesimal)
+
+ warn(RelaxWarning("The dispersion point is changed from
%.3f to %.3f, and hhe new key: %s"%(disp_frq, disp_frq_infinitesimal,
point_key_infinitesimal)))
+ spin.r2eff[point_key_infinitesimal] = value
+ store_infinitesimal = True
+
+ # Else store.
+ else:
+ spin.r2eff[point_key] = value
# Store the R2eff error.
if error_col:
@@ -2398,8 +2419,26 @@
if not hasattr(spin, 'r2eff_err'):
spin.r2eff_err = {}
- # Store.
- spin.r2eff_err[point_key] = error
+ # First check that a replicate does not exists. And it if
exists, find a new id with infinitesimal small change.
+ if point_key in spin.r2eff_err:
+ warn(RelaxWarning("The r2eff error key: %s already exists.
\nAn infinitesimal small change to the dispersion frequency is performed,
until a new point can be stored."%(point_key)))
+
+ # Store the current values.
+ disp_frq_infinitesimal = disp_frq
+ point_key_infinitesimal = point_key
+
+ # Continue until found
+ while point_key_infinitesimal == point_key:
+ disp_frq_infinitesimal += 0.001
+ point_key_infinitesimal =
return_param_key_from_data(exp_type=exp_type, frq=frq, offset=offset,
point=disp_frq_infinitesimal)
+
+ warn(RelaxWarning("The dispersion point is changed from
%.3f to %.3f, and hhe new key: %s\n"%(disp_frq, disp_frq_infinitesimal,
point_key_infinitesimal)))
+ spin.r2eff_err[point_key_infinitesimal] = error
+ store_infinitesimal = True
+
+ # Else store.
+ else:
+ spin.r2eff_err[point_key] = error
# Data added.
data_flag = True
@@ -2420,9 +2459,15 @@
if data_flag:
# Set the dispersion point frequency.
if exp_type in EXP_TYPE_LIST_CPMG:
- cpmg_setup(spectrum_id=id, cpmg_frq=disp_frq)
+ if store_infinitesimal:
+ cpmg_setup(spectrum_id=id, cpmg_frq=disp_frq_infinitesimal)
+ else:
+ cpmg_setup(spectrum_id=id, cpmg_frq=disp_frq)
else:
- spin_lock_field(spectrum_id=id, field=disp_frq)
+ if store_infinitesimal:
+ spin_lock_field(spectrum_id=id,
field=disp_frq_infinitesimal)
+ else:
+ spin_lock_field(spectrum_id=id, field=disp_frq)