Author: bugman Date: Thu Jan 17 10:38:55 2008 New Revision: 4805 URL: http://svn.gna.org/viewcvs/relax?rev=4805&view=rev Log: Completed the assemble_param_vector() method. Modified: branches/N_state_model/specific_fns/n_state_model.py Modified: branches/N_state_model/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/N_state_model/specific_fns/n_state_model.py?rev=4805&r1=4804&r2=4805&view=diff ============================================================================== --- branches/N_state_model/specific_fns/n_state_model.py (original) +++ branches/N_state_model/specific_fns/n_state_model.py Thu Jan 17 10:38:55 2008 @@ -38,16 +38,40 @@ """Class containing functions for the N-state model.""" def assemble_param_vector(self, sim_index): - """Assemble all the parameters of the model into a single array.""" - - # Initialise. - param_vector = [] - - # Alias the current data pipe. - cdp = relax_data_store[relax_data_store.current_pipe] - - # The probabilities. - #for i in xrange(len(cdp.align + """Assemble all the parameters of the model into a single array. + + @param sim_index: The index of the simulation to optimise. This should be None if + normal optimisation is desired. + @type sim_index: None or int + @return: The parameter vector used for optimisation. + @rtype: numpy array + """ + + # Alias the current data pipe. + cdp = relax_data_store[relax_data_store.current_pipe] + + # Monte Carlo simulation data structures. + if sim_index != None: + probs = cdp.probs_sim[sim_index] + alpha = cdp.alpha_sim[sim_index] + beta = cdp.beta_sim[sim_index] + gamma = cdp.gamma_sim[sim_index] + + # Normal data structures. + else: + probs = cdp.probs + alpha = cdp.alpha + beta = cdp.beta + gamma = cdp.gamma + + # The probabilities (exclude that of state N). + param_vector = probs[0:-2] + + # The Euler angles. + for i in xrange(cdp.N): + param_vector.append(alpha[i]) + param_vector.append(beta[i]) + param_vector.append(gamma[i]) # Return a numpy arrary. return array(param_vector, float64)