Author: bugman Date: Tue Aug 27 10:05:22 2013 New Revision: 20691 URL: http://svn.gna.org/viewcvs/relax?rev=20691&view=rev Log: Reverted r20681 as the chemical shift conversion is better performed by the specific analysis code. The command used was: svn merge -r20681:r20680 . ..... r20681 | bugman | 2013-08-23 16:59:16 +0200 (Fri, 23 Aug 2013) | 6 lines Changed paths: M /branches/relax_disp/target_functions/relax_disp.py Changed how chemical shifts are handled in the dispersion target function class. The chemical shifts in ppm are accepted and they are converted to rad/s inside the __init__() method. A structure for rotating frame tilt angles is now also accepted. ..... Modified: branches/relax_disp/target_functions/relax_disp.py Modified: branches/relax_disp/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/target_functions/relax_disp.py?rev=20691&r1=20690&r2=20691&view=diff ============================================================================== --- branches/relax_disp/target_functions/relax_disp.py (original) +++ branches/relax_disp/target_functions/relax_disp.py Tue Aug 27 10:05:22 2013 @@ -46,7 +46,7 @@ class Dispersion: - def __init__(self, model=None, num_params=None, num_spins=None, num_frq=None, num_disp_points=None, values=None, errors=None, missing=None, frqs=None, cpmg_frqs=None, spin_lock_nu1=None, relax_time=None, scaling_matrix=None, chemical_shifts=None, tilt_angles=None): + def __init__(self, model=None, num_params=None, num_spins=None, num_frq=None, num_disp_points=None, values=None, errors=None, missing=None, frqs=None, cpmg_frqs=None, spin_lock_nu1=None, relax_time=None, scaling_matrix=None, chemical_shifts=None): """Relaxation dispersion target functions for optimisation. Models @@ -101,10 +101,8 @@ @type relax_time: float @keyword scaling_matrix: The square and diagonal scaling matrix. @type scaling_matrix: numpy rank-2 float array - @keyword chemical_shifts: The chemical shifts for all spins in the cluster in ppm, only used for the off-resonance R1rho models. The first dimension is that of the spin cluster (each element corresponds to a different spin in the block). - @type chemical_shifts: numpy rank-1 float array - @keyword tilt_angles: The pre-calculated rotating frame tilt angle theta, only for off-resonance models. The first dimension is that of the spin cluster (each element corresponds to a different spin in the block), the second dimension is the spectrometer field strength, and the third is the different spin-lock offsets, and the fourth is the dispersion points. - @type tilt_angles: numpy rank-4 float array + @keyword chemical_shifts: The chemical shifts for all spins in the cluster in rad/s. The first dimension is that of the spin cluster (each element corresponds to a different spin in the block) and the second dimension is the spectrometer field strength. The ppm values are not used to save computation time, therefore they must be converted to rad/s by the calling code. + @type chemical_shifts: numpy rank-2 float array """ # Check the args. @@ -132,21 +130,12 @@ self.spin_lock_nu1 = spin_lock_nu1 self.relax_time = relax_time self.scaling_matrix = scaling_matrix + self.chemical_shifts = chemical_shifts # Scaling initialisation. self.scaling_flag = False if self.scaling_matrix != None: self.scaling_flag = True - - # Convert the chemical shifts from ppm to rad/s. - if chemical_shifts != None: - # Initialise the rad/s data structure. - self.chemical_shifts = zeros((self.num_spins, self.num_frq), float64) - - # Loop over the elements. - for spin_index in range(self.num_spins): - for frq_index in range(self.num_frq): - self.chemical_shifts[spin_index][frq_index] = chemical_shifts[spin_index] * self.frqs[spin_index, frq_index] # Create the structure for holding the back-calculated R2eff values (matching the dimensions of the values structure). self.back_calc = zeros((num_spins, num_frq, num_disp_points), float64)