mailr21311 - /branches/relax_disp/specific_analyses/relax_disp/disp_data.py


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

Header


Content

Posted by edward on October 29, 2013 - 13:53:
Author: bugman
Date: Tue Oct 29 13:53:38 2013
New Revision: 21311

URL: http://svn.gna.org/viewcvs/relax?rev=21311&view=rev
Log:
The relax_disp.r2eff_read user function now prints out all the data which has 
been read.

This feedback is useful for the user to know what has or has not been read 
into relax.


Modified:
    branches/relax_disp/specific_analyses/relax_disp/disp_data.py

Modified: branches/relax_disp/specific_analyses/relax_disp/disp_data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/disp_data.py?rev=21311&r1=21310&r2=21311&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/disp_data.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/disp_data.py Tue Oct 29 
13:53:38 2013
@@ -36,10 +36,11 @@
 from math import atan, pi, sqrt
 from numpy import array, float64, int32, ones, zeros
 from random import gauss
+import sys
 
 # relax module imports.
 from lib.errors import RelaxError, RelaxNoSpectraError, RelaxSpinTypeError
-from lib.io import get_file_path, open_write_file, read_spin_data
+from lib.io import get_file_path, open_write_file, read_spin_data, 
write_spin_data
 from lib.physical_constants import g1H, return_gyromagnetic_ratio
 from lib.software.grace import write_xy_data, write_xy_header, 
script_grace2images
 from pipe_control import pipes
@@ -1091,6 +1092,13 @@
 
     # Loop over the data.
     data_flag = False
+    mol_names = []
+    res_nums = []
+    res_names = []
+    spin_nums = []
+    spin_names = []
+    values = []
+    errors = []
     for data in read_spin_data(file=file, dir=dir, spin_id_col=spin_id_col, 
mol_name_col=mol_name_col, res_num_col=res_num_col, 
res_name_col=res_name_col, spin_num_col=spin_num_col, 
spin_name_col=spin_name_col, data_col=data_col, error_col=error_col, sep=sep):
         # Unpack.
         if data_col and error_col:
@@ -1136,6 +1144,18 @@
 
         # Data added.
         data_flag = True
+
+        # Append the data for printout.
+        mol_names.append(mol_name)
+        res_nums.append(res_num)
+        res_names.append(res_name)
+        spin_nums.append(spin_num)
+        spin_names.append(spin_name)
+        values.append(value)
+        errors.append(error)
+
+    # Print out.
+    write_spin_data(file=sys.stdout, mol_names=mol_names, res_nums=res_nums, 
res_names=res_names, spin_nums=spin_nums, spin_names=spin_names, data=values, 
data_name='R2eff', error=errors, error_name='R2eff_error')
 
     # Update the global structures.
     if data_flag:




Related Messages


Powered by MHonArc, Updated Tue Oct 29 14:00:02 2013