Author: bugman Date: Wed Oct 12 13:07:25 2011 New Revision: 14823 URL: http://svn.gna.org/viewcvs/relax?rev=14823&view=rev Log: The alignment_tensor.fix user function is now tensor specific. This will allow a subset of tensors to be optimised while the others are kept fixed. The specific analysis code will need to be updated for this. Modified: 1.3/generic_fns/align_tensor.py 1.3/prompt/align_tensor.py Modified: 1.3/generic_fns/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/align_tensor.py?rev=14823&r1=14822&r2=14823&view=diff ============================================================================== --- 1.3/generic_fns/align_tensor.py (original) +++ 1.3/generic_fns/align_tensor.py Wed Oct 12 13:07:25 2011 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2003-2010 Edward d'Auvergne # +# Copyright (C) 2003-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -448,18 +448,27 @@ print("\n\n\n") -def fix(fixed=True): +def fix(id=None, fixed=True): """Fix the alignment tensor during optimisation. - @param fixed: If True, the alignment tensor will be fixed during optimisation. If False, the alignment tensors will be optimised. + @keyword id: The alignment tensor ID string. If set to None, then all alignment tensors will be fixed. + @type id: str or None + @keyword fixed: If True, the alignment tensor will be fixed during optimisation. If False, the alignment tensors will be optimised. @type fixed: bool """ # Test if the current data pipe exists. pipes.test() - # Set the flag. - cdp.align_tensors.fixed = fixed + # Loop over the tensors. + for i in range(len(cdp.align_tensors)): + # ID match. + if id and cdp.align_tensors[i].name == id: + cdp.align_tensors[i].fixed = fixed + + # Set all tensor flags. + if id == None: + cdp.align_tensors[i].fixed = fixed def fold_angles(sim_index=None): Modified: 1.3/prompt/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/align_tensor.py?rev=14823&r1=14822&r2=14823&view=diff ============================================================================== --- 1.3/prompt/align_tensor.py (original) +++ 1.3/prompt/align_tensor.py Wed Oct 12 13:07:25 2011 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2007-2010 Edward d'Auvergne # +# Copyright (C) 2007-2011 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -153,26 +153,36 @@ align_tensor.display(tensor=tensor) - def fix(self, fixed=True): + def fix(self, id=None, fixed=True): """Fix all alignment tensors so that they do not change during optimisation. Keyword Arguments ~~~~~~~~~~~~~~~~~ + id: The alignment tensor identification string. + fixed: The flag specifying if the tensors should be fixed or variable. + + + Description + ~~~~~~~~~~~ + + If the ID string is left unset, then all alignment tensors will be fixed. """ # Function intro text. if self._exec_info.intro: text = self._exec_info.ps3 + "align_tensor.fix(" - text = text + "fixed=" + repr(fixed) + ")" - print(text) - - # The argument checks. + text = text + "id=" + repr(id) + text = text + ", fixed=" + repr(fixed) + ")" + print(text) + + # The argument checks. + arg_check.is_str(id, 'tensor ID', can_be_none=True)) arg_check.is_bool(fixed, 'fixed') # Execute the functional code. - align_tensor.fix(fixed=fixed) + align_tensor.fix(id=id, fixed=fixed) def init(self, tensor=None, params=None, scale=1.0, angle_units='deg', param_types=0, errors=False):