Author: bugman Date: Wed Oct 4 07:36:41 2006 New Revision: 2600 URL: http://svn.gna.org/viewcvs/relax?rev=2600&view=rev Log: Fix for bug #7297 (https://gna.org/bugs/index.php?7297). This bug was reported by Alex Hansen. The problem was that relax was being too strict with the checking of the Da and Dr diffusion tensor parameters. I have added a margin of error to these checks to allow machine precision errors and optimisation precision issues (for the Method of Multipliers constraint algorithm which allows the parameters outside of the limits). Modified: 1.2/generic_fns/diffusion_tensor.py Modified: 1.2/generic_fns/diffusion_tensor.py URL: http://svn.gna.org/viewcvs/relax/1.2/generic_fns/diffusion_tensor.py?rev=2600&r1=2599&r2=2600&view=diff ============================================================================== --- 1.2/generic_fns/diffusion_tensor.py (original) +++ 1.2/generic_fns/diffusion_tensor.py Wed Oct 4 07:36:41 2006 @@ -1336,6 +1336,9 @@ def test_params(self, num_params): """Function for testing the validity of the input parameters.""" + # An allowable error to account for machine precision, optimisation quality, etc. + error = 1e-4 + # tm. tm = self.relax.data.diff[self.run].tm if tm <= 0.0 or tm > 1e-6: @@ -1348,7 +1351,7 @@ Da = self.relax.data.diff[self.run].Da # Da. - if Da < -1.5*Diso or Da > 3.0*Diso: + if Da < (-1.5*Diso - error*Diso) or Da > (3.0*Diso + error*Diso): raise RelaxError, "The Da value of " + `Da` + " should be between -3/2 * Diso and 3Diso." # Ellipsoid. @@ -1359,11 +1362,11 @@ Dr = self.relax.data.diff[self.run].Dr # Da. - if Da < 0.0 or Da > 3.0*Diso: + if Da < (0.0 - error*Diso) or Da > (3.0*Diso + error*Diso): raise RelaxError, "The Da value of " + `Da` + " should be between zero and 3Diso." # Dr. - if Dr < 0.0 or Dr > 1.0: + if Dr < (0.0 - error) or Dr > (1.0 + error): raise RelaxError, "The Dr value of " + `Dr` + " should be between zero and one."