Author: bugman Date: Fri Oct 14 10:21:50 2011 New Revision: 14869 URL: http://svn.gna.org/viewcvs/relax?rev=14869&view=rev Log: Fix for a problem introduced at r14810 - relax uses D and not 2D internally for the RDCs. This is only a problem if the rdc.read 'data_type' argument is used. This is only a few days old so will affect no one! Modified: 1.3/generic_fns/rdc.py 1.3/prompt/rdc.py Modified: 1.3/generic_fns/rdc.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/rdc.py?rev=14869&r1=14868&r2=14869&view=diff ============================================================================== --- 1.3/generic_fns/rdc.py (original) +++ 1.3/generic_fns/rdc.py Fri Oct 14 10:21:50 2011 @@ -122,7 +122,7 @@ @type value: float or None @param align_id: The alignment tensor ID string. @type align_id: str - @keyword to_intern: A flag which if True will convert to the internal 2D notation if needed, or if False will convert from the internal 2D notation to the external D or 2D format. + @keyword to_intern: A flag which if True will convert to the internal D notation if needed, or if False will convert from the internal D notation to the external D or 2D format. @type to_intern: bool @return: The converted value. @rtype: float or None @@ -134,14 +134,14 @@ # The conversion factor. factor = 1.0 - if hasattr(cdp, 'rdc_data_types') and cdp.rdc_data_types.has_key(align_id) and cdp.rdc_data_types[align_id] == 'D': + if hasattr(cdp, 'rdc_data_types') and cdp.rdc_data_types.has_key(align_id) and cdp.rdc_data_types[align_id] == '2D': + # Convert from 2D to D. + if to_intern: + factor = 2.0 + # Convert from D to 2D. - if to_intern: + else: factor = 0.5 - - # Convert from 2D to D. - else: - factor = 2.0 # Return the converted value. return value * factor @@ -358,7 +358,7 @@ cdp.q_rdc_norm2 = sqrt(cdp.q_rdc_norm2 / len(cdp.q_factors_rdc_norm2)) -def read(align_id=None, file=None, dir=None, file_data=None, data_type='2D', spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None, spin_id=None, neg_g_corr=False): +def read(align_id=None, file=None, dir=None, file_data=None, data_type='D', spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None, spin_id=None, neg_g_corr=False): """Read the RDC data from file. @keyword align_id: The alignment tensor ID string. @@ -369,7 +369,7 @@ @type dir: str or None @keyword file_data: An alternative to opening a file, if the data already exists in the correct format. The format is a list of lists where the first index corresponds to the row and the second the column. @type file_data: list of lists - @keyword data_type: A string which is set to '2D' means that the splitting in the aligned sample was assumed to be J + 2D, or if set to 'D' then the splitting was taken as J + D. + @keyword data_type: A string which is set to 'D' means that the splitting in the aligned sample was assumed to be J + D, or if set to '2D' then the splitting was taken as J + 2D. @keyword spin_id_col: The column containing the spin ID strings. If supplied, the mol_name_col, res_name_col, res_num_col, spin_name_col, and spin_num_col arguments must be none. @type spin_id_col: int or None @keyword mol_name_col: The column containing the molecule name information. If supplied, spin_id_col must be None. Modified: 1.3/prompt/rdc.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/rdc.py?rev=14869&r1=14868&r2=14869&view=diff ============================================================================== --- 1.3/prompt/rdc.py (original) +++ 1.3/prompt/rdc.py Fri Oct 14 10:21:50 2011 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2003-2005,2007-2010 Edward d'Auvergne # +# Copyright (C) 2003-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -267,7 +267,7 @@ rdc.display(align_id=align_id) - def read(self, align_id=None, file=None, dir=None, data_type='2D', spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None, spin_id=None, neg_g_corr=False): + def read(self, align_id=None, file=None, dir=None, data_type='D', spin_id_col=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None, spin_id=None, neg_g_corr=False): """Read the RDC data from file. Keyword Arguments @@ -279,7 +279,7 @@ dir: The directory where the file is located. - data_type: Whether the RDC data is in the 2D or D format. + data_type: Whether the RDC data is in the D or 2D format. spin_id_col: The spin ID string column (an alternative to the mol, res, and spin name and number columns). @@ -311,10 +311,10 @@ The data_type argument is used to specify how the RDC is defined. It is a string which can be set to two values: + - 'D' means that the splitting in the aligned sample was taken as J + D. - '2D' means that the splitting in the aligned sample was assumed to be J + 2D. - - 'D' means that the splitting in the aligned sample was taken as J + D. - - Internally, relax uses the 2D notation. Therefore if set to 'D', the values will be halved + + Internally, relax uses the D notation. Therefore if set to '2D', the values will be doubled when read in. If neg_g_corr is set to True, a sign inversion will be applied to all RDC values to be