Author: bugman Date: Thu Aug 14 16:56:46 2008 New Revision: 7197 URL: http://svn.gna.org/viewcvs/relax?rev=7197&view=rev Log: Shifted the calculation of the paramagnetic centre from __minimise_setup_pcs() to centre(). Modified: branches/rdc_analysis/generic_fns/pcs.py branches/rdc_analysis/specific_fns/n_state_model.py Modified: branches/rdc_analysis/generic_fns/pcs.py URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/generic_fns/pcs.py?rev=7197&r1=7196&r2=7197&view=diff ============================================================================== --- branches/rdc_analysis/generic_fns/pcs.py (original) +++ branches/rdc_analysis/generic_fns/pcs.py Thu Aug 14 16:56:46 2008 @@ -234,10 +234,20 @@ # Test the centre has already been set. if hasattr(dp, 'paramagnetic_centre'): - raise RelaxError, "The paramagnetic centre has already been set to the atom " + `dp.paramagnetic_centre` + "." + raise RelaxError, "The paramagnetic centre has already been set to the coordinates " + `dp.paramagnetic_centre` + "." + + # Get the positions. + pos = zeros(3, float64) + i = 0 + for R in cdp.structure.atom_loop(atom_id=atom_id, pos_flag=True): + pos = pos + R + i = i + 1 + + # Averaging. + pos = pos / float(i) # Set the centre. - dp.paramagnetic_centre = atom_id + dp.paramagnetic_centre = pos def copy(pipe_from=None, pipe_to=None, ri_label=None, frq_label=None): 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=7197&r1=7196&r2=7197&view=diff ============================================================================== --- branches/rdc_analysis/specific_fns/n_state_model.py (original) +++ branches/rdc_analysis/specific_fns/n_state_model.py Thu Aug 14 16:56:46 2008 @@ -425,17 +425,8 @@ # Loop over the states, and calculate the paramagnetic centre to nucleus unit vectors. for c in range(cdp.N): - # Get the paramagnetic coordinates. - i = 0 - for R in cdp.structure.atom_loop(atom_id=cdp.paramagnetic_centre, str_id=c, pos_flag=True): - i = i + 1 - - # Can only be one paramagnetic centre (for now). - if i > 1: - raise RelaxError, "More than one paramagnetic centre found." - # Calculate the electron spin to nuclear spin vector. - vect = spin.pos[c] - R + vect = spin.pos[c] - cdp.paramagnetic_centre # The length. r[-1].append(norm(vect))