mailr16864 - /branches/interatomic/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 June 11, 2012 - 21:01:
Author: bugman
Date: Mon Jun 11 21:01:22 2012
New Revision: 16864

URL: http://svn.gna.org/viewcvs/relax?rev=16864&view=rev
Log:
The rdc.read user function backend is now adding the RDCs to the interatomic 
data containers.


Modified:
    branches/interatomic/generic_fns/rdc.py

Modified: branches/interatomic/generic_fns/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/interatomic/generic_fns/rdc.py?rev=16864&r1=16863&r2=16864&view=diff
==============================================================================
--- branches/interatomic/generic_fns/rdc.py (original)
+++ branches/interatomic/generic_fns/rdc.py Mon Jun 11 21:01:22 2012
@@ -32,7 +32,6 @@
 from warnings import warn
 
 # relax module imports.
-from data.rdc import Rdc
 from float import nan
 from generic_fns import grace, pipes
 from generic_fns.align_tensor import get_tensor_index
@@ -41,7 +40,7 @@
 from physical_constants import dipolar_constant, return_gyromagnetic_ratio
 from relax_errors import RelaxError, RelaxNoRDCError, RelaxNoSequenceError, 
RelaxSpinTypeError
 from relax_io import extract_data, open_write_file, strip, write_data
-from relax_warnings import RelaxWarning, RelaxNoSpinWarning
+from relax_warnings import RelaxWarning
 
 
 def back_calc(align_id=None):
@@ -456,10 +455,6 @@
     # Spin specific data.
     #####################
 
-    # Initialise the RDC data store object.
-    if not hasattr(cdp, 'rdc'):
-        cdp.rdc = Rdc()
-
     # Extract the data from the file.
     file_data = extract_data(file, dir, sep=sep)
 
@@ -496,15 +491,14 @@
         if error == 0.0:
             raise RelaxError("An invalid error value of zero has been 
encountered.")
 
-        # Check the spin IDs.
-        spin = return_spin(spin_id1)
-        if spin == None:
-            raise RelaxNoSpinWarning(spin_id1)
-        spin = return_spin(spin_id2)
-        if spin == None:
-            raise RelaxNoSpinWarning(spin_id2)
-
-        # Convert the data.
+        # Get the interatomic data container.
+        interatom = interatomic.return_container(spin_id1, spin_id2)
+
+        # Create the container if needed.
+        if interatom == None:
+            interatom = interatomic.create_interatom(spin_id1=spin_id1, 
spin_id2=spin_id2)
+
+        # Convert and add the data.
         if data_col:
             # Data conversion.
             value = convert(value, align_id, to_intern=True)
@@ -513,13 +507,24 @@
             if neg_g_corr and value != None:
                 value = -value
 
-        # Convert the error.
+            # Initialise.
+            if not hasattr(interatom, 'rdc'):
+                interatom.rdc = {}
+
+            # Add the value.
+            interatom.rdc[align_id] = value
+
+        # Convert and add the error.
         if error_col:
             # Data conversion.
             error = convert(error, align_id, to_intern=True)
 
-        # Store the data.
-        cdp.rdc.add(align_id=align_id, spin_id1=spin_id1, spin_id2=spin_id2, 
rdc=value, error=error)
+            # Initialise.
+            if not hasattr(interatom, 'rdc_err'):
+                interatom.rdc_err = {}
+
+            # Append the error.
+            interatom.rdc_err[align_id] = error
 
         # Append the data for printout.
         data.append([spin_id1, spin_id2, repr(value), repr(error)])




Related Messages


Powered by MHonArc, Updated Mon Jun 11 21:20:02 2012