Author: bugman Date: Tue Mar 3 14:46:20 2015 New Revision: 27745 URL: http://svn.gna.org/viewcvs/relax?rev=27745&view=rev Log: Implemented the back_calc argument for the pcs.copy user function. This allows the back-calculated PCSs to be additionally copied together with the real value and error. The implementation simply copies that of the rdc.copy user function. Modified: trunk/pipe_control/pcs.py trunk/user_functions/pcs.py Modified: trunk/pipe_control/pcs.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/pcs.py?rev=27745&r1=27744&r2=27745&view=diff ============================================================================== --- trunk/pipe_control/pcs.py (original) +++ trunk/pipe_control/pcs.py Tue Mar 3 14:46:20 2015 @@ -273,15 +273,17 @@ raise RelaxError("The paramagnetic centre has not been defined.") -def copy(pipe_from=None, pipe_to=None, align_id=None): +def copy(pipe_from=None, pipe_to=None, align_id=None, back_calc=True): """Copy the PCS data from one data pipe to another. @keyword pipe_from: The data pipe to copy the PCS data from. This defaults to the current data pipe. @type pipe_from: str @keyword pipe_to: The data pipe to copy the PCS data to. This defaults to the current data pipe. @type pipe_to: str - @param align_id: The alignment ID string. + @keyword align_id: The alignment ID string. @type align_id: str + @keyword back_calc: A flag which if True will cause any back-calculated RDCs present to also be copied with the real values and errors. + @type back_calc: bool """ # Defaults. @@ -336,12 +338,16 @@ # Initialise the spin data if necessary. if hasattr(spin_from, 'pcs') and not hasattr(spin_to, 'pcs'): spin_to.pcs = {} + if back_calc and hasattr(spin_from, 'pcs_bc') and not hasattr(spin_to, 'pcs_bc'): + spin_to.pcs_bc = {} if hasattr(spin_from, 'pcs_err') and not hasattr(spin_to, 'pcs_err'): spin_to.pcs_err = {} # Copy the value and error from pipe_from. if hasattr(spin_from, 'pcs'): spin_to.pcs[align_id] = spin_from.pcs[align_id] + if back_calc and hasattr(spin_from, 'pcs_bc'): + spin_to.pcs_bc[align_id] = spin_from.pcs_bc[align_id] if hasattr(spin_from, 'pcs_err'): spin_to.pcs_err[align_id] = spin_from.pcs_err[align_id] Modified: trunk/user_functions/pcs.py URL: http://svn.gna.org/viewcvs/relax/trunk/user_functions/pcs.py?rev=27745&r1=27744&r2=27745&view=diff ============================================================================== --- trunk/user_functions/pcs.py (original) +++ trunk/user_functions/pcs.py Tue Mar 3 14:46:20 2015 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2003-2014 Edward d'Auvergne # +# Copyright (C) 2003-2015 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -136,6 +136,13 @@ wiz_combo_iter = align_tensor.get_align_ids, wiz_read_only = True, can_be_none = True +) +uf.add_keyarg( + name = "back_calc", + default = True, + py_type = "bool", + desc_short = "back-calculated data flag", + desc = "A flag which if True will cause any back-calculated PCSs present to also be copied with the real values and errors." ) # Description. uf.desc.append(Desc_container())