mailr20189 - /branches/relax_disp/specific_analyses/relax_disp/api.py


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

Header


Content

Posted by edward on June 18, 2013 - 10:51:
Author: bugman
Date: Tue Jun 18 10:51:28 2013
New Revision: 20189

URL: http://svn.gna.org/viewcvs/relax?rev=20189&view=rev
Log:
Added support for calculating auxiliary parameter errors for the dispersion 
analysis.

This is via the monte_carlo.error_analysis user function.  The errors for the 
parameter pairs
kex-tex and pA-pB for the non-model parameter are now calculated as well.


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

Modified: branches/relax_disp/specific_analyses/relax_disp/api.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/api.py?rev=20189&r1=20188&r2=20189&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/api.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/api.py Tue Jun 18 
10:51:28 2013
@@ -1392,8 +1392,32 @@
         spin_ids = model_info
         spins = spin_ids_to_containers(spin_ids)
 
+        # The number of parameters.
+        total_param_num = param_num(spins=spins)
+
+        # No more model parameters.
+        model_param = True
+        if index >= total_param_num:
+            model_param = False
+
+        # The auxiliary cluster parameters.
+        aux_params = []
+        if 'pA' in spins[0].params:
+            aux_params.append('pB')
+        if 'pB' in spins[0].params:
+            aux_params.append('pA')
+        if 'kex' in spins[0].params:
+            aux_params.append('tex')
+        if 'tex' in spins[0].params:
+            aux_params.append('kex')
+
         # Convert the parameter index.
-        param_name, spin_index, frq_index = 
param_index_to_param_info(index=index, spins=spins)
+        if model_param:
+            param_name, spin_index, frq_index = 
param_index_to_param_info(index=index, spins=spins)
+        else:
+            param_name = aux_params[index - total_param_num]
+            spin_index = 0
+            frq_index = 0
 
         # The parameter error name.
         err_name = param_name + "_err"
@@ -1407,7 +1431,7 @@
             # Set the value.
             setattr(spins[spin_index], err_name, error)
 
-        # All other parameters.
+        # Model and auxiliary parameters.
         else:
             for spin in spins:
                 setattr(spin, err_name, error)
@@ -1584,12 +1608,36 @@
         # The number of parameters.
         total_param_num = param_num(spins=spins)
 
-        # No more parameters.
+        # No more model parameters.
+        model_param = True
         if index >= total_param_num:
+            model_param = False
+
+        # The auxiliary cluster parameters.
+        aux_params = []
+        if 'pA' in spins[0].params:
+            aux_params.append('pB')
+        if 'pB' in spins[0].params:
+            aux_params.append('pA')
+        if 'kex' in spins[0].params:
+            aux_params.append('tex')
+        if 'tex' in spins[0].params:
+            aux_params.append('kex')
+
+        # No more auxiliary parameters.
+        total_aux_num = total_param_num + len(aux_params)
+        if index >= total_aux_num:
             return
 
         # Convert the parameter index.
-        param_name, spin_index, frq_index = 
param_index_to_param_info(index=index, spins=spins)
+        if model_param:
+            param_name, spin_index, frq_index = 
param_index_to_param_info(index=index, spins=spins)
+            if not param_name in ['r2eff', 'i0']:
+                spin_index = 0
+        else:
+            param_name = aux_params[index - total_param_num]
+            spin_index = 0
+            frq_index = 0
 
         # The exponential curve parameters.
         sim_data = []
@@ -1600,9 +1648,9 @@
             for i in range(cdp.sim_number):
                 sim_data.append(spins[spin_index].i0_sim[i])
 
-        # All other parameters.
+        # Model and auxiliary parameters.
         else:
-            sim_data = getattr(spins[0], param_name + "_sim")
+            sim_data = getattr(spins[spin_index], param_name + "_sim")
 
         # Set the sim data to None if empty.
         if sim_data == []:




Related Messages


Powered by MHonArc, Updated Tue Jun 18 11:00:02 2013