mailr12524 - /branches/bmrb/generic_fns/relax_data.py


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

Header


Content

Posted by edward on February 15, 2011 - 09:13:
Author: bugman
Date: Tue Feb 15 09:13:40 2011
New Revision: 12524

URL: http://svn.gna.org/viewcvs/relax?rev=12524&view=rev
Log:
The values are now properly scaled and values and errors are inverted to go 
from Tx to Rx values.


Modified:
    branches/bmrb/generic_fns/relax_data.py

Modified: branches/bmrb/generic_fns/relax_data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/relax_data.py?rev=12524&r1=12523&r2=12524&view=diff
==============================================================================
--- branches/bmrb/generic_fns/relax_data.py (original)
+++ branches/bmrb/generic_fns/relax_data.py Tue Feb 15 09:13:40 2011
@@ -275,10 +275,22 @@
         vals = array(data['data'], float64)
         errors = array(data['errors'], float64)
 
-        # Scaling.
-        if 'units' in keys and data['units'] == 'ms':
-            vals = vals / 1000
-            vals = errors / 1000
+        # Data transformation.
+        if 'units' in keys:
+            # Scaling.
+            if data['units'] == 'ms':
+                vals = vals / 1000
+                errors = errors / 1000
+
+            # Invert.
+            if data['units'] in ['s', 'ms']:
+                # Loop over the data.
+                for i in range(len(vals)):
+                    # The value.
+                    vals[i] = 1.0 / vals[i]
+
+                    # The error.
+                    errors[i] = errors[i] * vals[i]**2
 
         # Pack the data.
         pack_data(ri_label, frq_label, frq, vals, errors, 
mol_names=mol_names, res_nums=data['res_nums'], res_names=data['res_names'], 
spin_nums=None, spin_names=data['atom_names'], gen_seq=True)




Related Messages


Powered by MHonArc, Updated Tue Feb 15 12:00:02 2011