mailr27736 - /trunk/pipe_control/rdc.py


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

Header


Content

Posted by edward on March 03, 2015 - 13:43:
Author: bugman
Date: Tue Mar  3 13:43:44 2015
New Revision: 27736

URL: http://svn.gna.org/viewcvs/relax?rev=27736&view=rev
Log:
Modified the rdc.copy user function to printout all copied RDC values and 
errors.


Modified:
    trunk/pipe_control/rdc.py

Modified: trunk/pipe_control/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/rdc.py?rev=27736&r1=27735&r2=27736&view=diff
==============================================================================
--- trunk/pipe_control/rdc.py   (original)
+++ trunk/pipe_control/rdc.py   Tue Mar  3 13:43:44 2015
@@ -345,7 +345,11 @@
         dp_to.rdc_ids = []
 
     # Loop over the align IDs.
+    data = []
     for align_id in align_ids:
+        # Printout.
+        print("Coping RDCs for the alignment ID '%s'." % align_id)
+
         # Copy the global data.
         if align_id not in dp_to.align_ids and align_id not in 
dp_to.align_ids:
             dp_to.align_ids.append(align_id)
@@ -382,10 +386,29 @@
                 interatom_to.rdc_err = {}
 
             # Copy the value and error from pipe_from.
+            value = None
+            error = None
             if hasattr(interatom_from, 'rdc'):
-                interatom_to.rdc[align_id] = interatom_from.rdc[align_id]
+                value = interatom_from.rdc[align_id]
+                interatom_to.rdc[align_id] = value
             if hasattr(interatom_from, 'rdc_err'):
-                interatom_to.rdc_err[align_id] = 
interatom_from.rdc_err[align_id]
+                error = interatom_from.rdc_err[align_id]
+                interatom_to.rdc_err[align_id] = error
+
+            # Append the data for printout.
+            data.append([interatom_from.spin_id1, interatom_from.spin_id2])
+            if is_float(value):
+                data[-1].append("%20.15f" % value)
+            else:
+                data[-1].append("%20s" % value)
+            if is_float(error):
+                data[-1].append("%20.15f" % error)
+            else:
+                data[-1].append("%20s" % error)
+
+    # Printout.
+    print("The following RDCs have been copied:\n")
+    write_data(out=sys.stdout, headings=["Spin_ID1", "Spin_ID2", "Value", 
"Error"], data=data)
 
 
 def corr_plot(format=None, title=None, subtitle=None, file=None, dir=None, 
force=False):




Related Messages


Powered by MHonArc, Updated Tue Mar 03 14:00:02 2015