Author: bugman Date: Sat Oct 7 10:52:57 2006 New Revision: 2603 URL: http://svn.gna.org/viewcvs/relax?rev=2603&view=rev Log: Ported r2600 from the 1.2 line. The command used was: svn merge -r2599:2600 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.2 This fixes bug #7297 (https://gna.org/bugs/index.php?7297). Modified: 1.3/generic_fns/diffusion_tensor.py Modified: 1.3/generic_fns/diffusion_tensor.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/diffusion_tensor.py?rev=2603&r1=2602&r2=2603&view=diff ============================================================================== --- 1.3/generic_fns/diffusion_tensor.py (original) +++ 1.3/generic_fns/diffusion_tensor.py Sat Oct 7 10:52:57 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."