mailr11252 - /1.3/generic_fns/grace.py


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

Header


Content

Posted by edward on June 28, 2010 - 13:53:
Author: bugman
Date: Mon Jun 28 13:53:02 2010
New Revision: 11252

URL: http://svn.gna.org/viewcvs/relax?rev=11252&view=rev
Log:
Fix for the get_data() function - the returned data structure is dependent on 
the errors.

Instead of a list of x, y, error 1, error 2 with the errors set to None if 
non-existent, only the
required errors are returned.


Modified:
    1.3/generic_fns/grace.py

Modified: 1.3/generic_fns/grace.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/grace.py?rev=11252&r1=11251&r2=11252&view=diff
==============================================================================
--- 1.3/generic_fns/grace.py (original)
+++ 1.3/generic_fns/grace.py Mon Jun 28 13:53:02 2010
@@ -225,8 +225,28 @@
     if y_err_flag:
         graph_type = graph_type + 'dy'
 
+    # Remodel the data.
+    new_data = []
+    for i in range(len(data)):
+        new_data.append([])
+        for j in range(len(data[i])):
+            new_data[i].append([])
+            for k in range(len(data[i][j])):
+                # The xy data.
+                new_data[i][j].append([])
+                new_data[i][j][k].append(data[i][j][k][0])
+                new_data[i][j][k].append(data[i][j][k][1])
+
+                # First error set.
+                if graph_type in ['xydx', 'xydy', 'xydxdy']:
+                    new_data[i][j][k].append(data[i][j][k][2])
+
+                # Second error set.
+                if graph_type == 'xydxdy':
+                    new_data[i][j][k].append(data[i][j][k][3])
+
     # Return the data.
-    return data, set_labels, graph_type
+    return new_data, set_labels, graph_type
 
 
 def view(file=None, dir=None, grace_exe='xmgrace'):




Related Messages


Powered by MHonArc, Updated Mon Jun 28 18:00:02 2010