Author: bugman Date: Wed Jul 9 17:40:12 2008 New Revision: 6901 URL: http://svn.gna.org/viewcvs/relax?rev=6901&view=rev Log: Fix for the func_population() method. The RDC errors are now set to 1.0 if no errors are supplied, converting the chi2 value to a SSE value. Modified: branches/rdc_analysis/maths_fns/n_state_model.py Modified: branches/rdc_analysis/maths_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/maths_fns/n_state_model.py?rev=6901&r1=6900&r2=6901&view=diff ============================================================================== --- branches/rdc_analysis/maths_fns/n_state_model.py (original) +++ branches/rdc_analysis/maths_fns/n_state_model.py Wed Jul 9 17:40:12 2008 @@ -21,7 +21,7 @@ ############################################################################### # Python module imports. -from numpy import array, dot, float64, transpose, zeros +from numpy import array, dot, float64, ones, transpose, zeros # relax module imports. from chi2 import chi2 @@ -32,7 +32,7 @@ class N_state_opt: """Class containing the target function of the optimisation of the N-state model.""" - def __init__(self, model=None, N=None, init_params=None, full_tensors=None, red_data=None, red_errors=None, full_in_ref_frame=None, rdcs=None, xh_vect=None): + def __init__(self, model=None, N=None, init_params=None, full_tensors=None, red_data=None, red_errors=None, full_in_ref_frame=None, rdcs=None, rdc_errors=None, xh_vect=None): """Set up the class instance for optimisation. All constant data required for the N-state model are initialised here. @@ -59,6 +59,10 @@ and the second index correspond to the RDCs of different alignment media. @type rdcs: list of lists of float + @keyword rdc_errors: The RDC error lists. The first index must correspond to the spin + systems and the second index correspond to the RDCs of different + alignment media. + @type rdc_errors: list of lists of float @keyword xh_vect: The unit XH vector lists. The dimensions of this argument are the same as for 'rdcs'. @type xh_vect: list of lists of float @@ -111,11 +115,16 @@ # The total number of alignments. self.num_align = len(rdcs[0]) - # RDC set up. + # Convert to lists of numpy arrays. self.rdcs = [] + self.rdc_errors = [] self.xh_vect = [] for i in xrange(self.num_spins): self.rdcs.append(array(rdcs[i], float64)) + if rdc_errors: + self.rdc_errors.append(array(rdc_errors[i], float64)) + else: + self.rdc_errors.append(ones(self.num_align, float64)) self.xh_vect.append(array(xh_vect[i], float64)) # Set the target function.