mailr6913 - /branches/rdc_analysis/specific_fns/n_state_model.py


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

Header


Content

Posted by edward on July 09, 2008 - 19:13:
Author: bugman
Date: Wed Jul  9 19:13:45 2008
New Revision: 6913

URL: http://svn.gna.org/viewcvs/relax?rev=6913&view=rev
Log:
Converted the RDC and unit vector lists in minimise_setup_rdcs() to numpy 
matrices.


Modified:
    branches/rdc_analysis/specific_fns/n_state_model.py

Modified: branches/rdc_analysis/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/specific_fns/n_state_model.py?rev=6913&r1=6912&r2=6913&view=diff
==============================================================================
--- branches/rdc_analysis/specific_fns/n_state_model.py (original)
+++ branches/rdc_analysis/specific_fns/n_state_model.py Wed Jul  9 19:13:45 
2008
@@ -784,8 +784,24 @@
             rdcs.append(spin.rdc)
             xh_vectors.append(spin.xh_vect)
 
+        # Initialise the numpy objects (the rdc matrix is transposed!).
+        rdcs_numpy = zeros((len(rdcs[0]), len(rdcs)), float64)
+        xh_vect_numpy = zeros((len(xh_vectors), len(xh_vectors[0]), 3), 
float64)
+
+        # Loop over the spins.
+        for i in xrange(len(rdcs)):
+            # Loop over the alignments.
+            for j in xrange(len(rdcs[i])):
+                # Transpose and store the RDC value.
+                rdcs_numpy[j, i] = rdcs[i][j]
+
+            # Loop over the N states.
+            for j in xrange(len(xh_vectors[i])):
+                # Store the unit vector.
+                xh_vect_numpy[i,j] = xh_vectors[i][j]
+
         # Set up the class instance containing the target function.
-        model = N_state_opt(model=cdp.model, N=cdp.N, 
init_params=param_vector, rdcs=rdcs, xh_vect=xh_vectors)
+        model = N_state_opt(model=cdp.model, N=cdp.N, 
init_params=param_vector, rdcs=rdcs_numpy, xh_vect=xh_vect_numpy)
 
         # Return the instantiated class.
         return model




Related Messages


Powered by MHonArc, Updated Wed Jul 09 19:20:15 2008