mailr19745 - /trunk/pipe_control/monte_carlo.py


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

Header


Content

Posted by edward on May 27, 2013 - 14:20:
Author: bugman
Date: Mon May 27 14:20:29 2013
New Revision: 19745

URL: http://svn.gna.org/viewcvs/relax?rev=19745&view=rev
Log:
The monte_carlo.error_analysis user function can now handle parameters which 
are lists.


Modified:
    trunk/pipe_control/monte_carlo.py

Modified: trunk/pipe_control/monte_carlo.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/monte_carlo.py?rev=19745&r1=19744&r2=19745&view=diff
==============================================================================
--- trunk/pipe_control/monte_carlo.py (original)
+++ trunk/pipe_control/monte_carlo.py Mon May 27 14:20:29 2013
@@ -171,6 +171,21 @@
                     # Calculate and store the SD.
                     sd[key] = statistics.std(values=data, skip=select_sim)
 
+            # Handle list type parameters.
+            elif isinstance(param_array[0], list):
+                # Initialise the standard deviation structure as a list.
+                sd = []
+
+                # Loop over each element.
+                for j in range(len(param_array[0])):
+                    # Create a list of the values for the current key.
+                    data = []
+                    for i in range(len(param_array)):
+                        data.append(param_array[i][j])
+
+                    # Calculate and store the SD.
+                    sd.append(statistics.std(values=data, skip=select_sim))
+
              # SD of simulation parameters with values (ie not None).
             elif param_array[0] != None:
                 sd = statistics.std(values=param_array, skip=select_sim)




Related Messages


Powered by MHonArc, Updated Mon May 27 14:40:02 2013