mailr17187 - /branches/absolute_rdc/generic_fns/rdc.py


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

Header


Content

Posted by edward on July 04, 2012 - 11:18:
Author: bugman
Date: Wed Jul  4 11:18:32 2012
New Revision: 17187

URL: http://svn.gna.org/viewcvs/relax?rev=17187&view=rev
Log:
The rdc.read user function backend now accepts the 'absolute' argument.

This is used to signal that the RDCs are signless absolute values.


Modified:
    branches/absolute_rdc/generic_fns/rdc.py

Modified: branches/absolute_rdc/generic_fns/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/absolute_rdc/generic_fns/rdc.py?rev=17187&r1=17186&r2=17187&view=diff
==============================================================================
--- branches/absolute_rdc/generic_fns/rdc.py (original)
+++ branches/absolute_rdc/generic_fns/rdc.py Wed Jul  4 11:18:32 2012
@@ -405,7 +405,7 @@
     cdp.q_rdc_norm2 = sqrt(cdp.q_rdc_norm2 / len(cdp.q_factors_rdc_norm2))
 
 
-def read(align_id=None, file=None, dir=None, file_data=None, data_type='D', 
spin_id1_col=None, spin_id2_col=None, data_col=None, error_col=None, 
sep=None, neg_g_corr=False):
+def read(align_id=None, file=None, dir=None, file_data=None, data_type='D', 
spin_id1_col=None, spin_id2_col=None, data_col=None, error_col=None, 
sep=None, neg_g_corr=False, absolute=False):
     """Read the RDC data from file.
 
     @keyword align_id:      The alignment tensor ID string.
@@ -429,6 +429,8 @@
     @type sep:              str or None
     @keyword neg_g_corr:    A flag which is used to correct for the negative 
gyromagnetic ratio of 15N.  If True, a sign inversion will be applied to all 
RDC values to be loaded.
     @type neg_g_corr:       bool
+    @keyword absolute:      A flag which if True indicates that the RDCs to 
load are signless.  All RDCs will then be converted to positive values.
+    @type absolute:         bool
     """
 
     # Test if the current data pipe exists.
@@ -542,6 +544,11 @@
             # Correction for the negative gyromagnetic ratio of 15N.
             if neg_g_corr and value != None:
                 value = -value
+
+            # Absolute values.
+            if absolute:
+                # Force the value to be positive.
+                value = abs(value)
 
             # Initialise.
             if not hasattr(interatom, 'rdc'):




Related Messages


Powered by MHonArc, Updated Wed Jul 04 11:20:02 2012