Author: bugman Date: Tue Jun 5 16:27:01 2012 New Revision: 16670 URL: http://svn.gna.org/viewcvs/relax?rev=16670&view=rev Log: Merged revisions 16666,16668 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r16666 | bugman | 2012-06-05 14:27:34 +0200 (Tue, 05 Jun 2012) | 3 lines Missing import. ........ r16668 | bugman | 2012-06-05 15:17:58 +0200 (Tue, 05 Jun 2012) | 9 lines Added checks for the proton frq for the relax_data.read and relax_data.back_calc user functions. This is in response to the problems seen by Martin Ballaschk <ballaschk att fmp-berlin dott de> and reported at http://www.mail-archive.com/relax-users@xxxxxxx/msg01179.html (Message-Id: <533CDA92-36FE-4E36-8925-7536EFF2608E@xxxxxxxxxxxxx>). If the frequency is not exact or is less than 1 MHz, warnings are now given to the user. ........ Modified: branches/uf_redesign/ (props changed) branches/uf_redesign/generic_fns/relax_data.py branches/uf_redesign/prompt/uf_objects.py branches/uf_redesign/specific_fns/model_free/main.py Propchange: branches/uf_redesign/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Jun 5 16:27:01 2012 @@ -1,1 +1,1 @@ -/1.3:1-16454 +/1.3:1-16669 Modified: branches/uf_redesign/generic_fns/relax_data.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/generic_fns/relax_data.py?rev=16670&r1=16669&r2=16670&view=diff ============================================================================== --- branches/uf_redesign/generic_fns/relax_data.py (original) +++ branches/uf_redesign/generic_fns/relax_data.py Tue Jun 5 16:27:01 2012 @@ -25,6 +25,7 @@ # Python module imports. from copy import deepcopy +from math import modf from numpy import array, float64, int32, ones, zeros import string import sys @@ -77,6 +78,9 @@ # Check if the type is valid. if ri_type and ri_type not in VALID_TYPES: raise RelaxError("The relaxation data type '%s' must be one of %s." % (ri_type, VALID_TYPES)) + + # Frequency checks. + frq_checks(frq) # Initialise the global data for the current pipe if necessary. if not hasattr(cdp, 'frq'): @@ -505,6 +509,27 @@ # Print the data. value.write_data(param=ri_id, file=sys.stdout, return_value=return_value) + + +def frq_checks(frq): + """Perform a number of checks on the given frequency. + + @param frq: The proton frequency value. + @type frq: float or None + """ + + # No frequency given. + if frq == None: + return + + # Make sure the precise value has been supplied. + frac, integer = modf(frq / 1e6) + if frac == 0.0 or frac > 0.99999: + warn(RelaxWarning("The precise spectrometer frequency should be suppled, a value such as 500000000 or 5e8 for a 500 MHz machine is not acceptable. Please see the 'sfrq' parameter in the Varian procpar file or the 'SFO1' parameter in the Bruker acqus file.")) + + # Check that Hz have been supplied. + if frq < 1e6: + warn(RelaxWarning("The proton frequency of %s should be in Hz, but it seems to be in MHz." % frq)) def frq_loop(): @@ -812,6 +837,9 @@ if ri_type not in VALID_TYPES: raise RelaxError("The relaxation data type '%s' must be one of %s." % (ri_type, VALID_TYPES)) + # Frequency checks. + frq_checks(frq) + # Loop over the file data to create the data structures for packing. values = [] errors = [] Modified: branches/uf_redesign/prompt/uf_objects.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/uf_objects.py?rev=16670&r1=16669&r2=16670&view=diff ============================================================================== --- branches/uf_redesign/prompt/uf_objects.py (original) +++ branches/uf_redesign/prompt/uf_objects.py Tue Jun 5 16:27:01 2012 @@ -381,6 +381,7 @@ @rtype: str """ + print `status.ps3` # Initialise. text = "" Modified: branches/uf_redesign/specific_fns/model_free/main.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/specific_fns/model_free/main.py?rev=16670&r1=16669&r2=16670&view=diff ============================================================================== --- branches/uf_redesign/specific_fns/model_free/main.py (original) +++ branches/uf_redesign/specific_fns/model_free/main.py Tue Jun 5 16:27:01 2012 @@ -38,7 +38,7 @@ from maths_fns.mf import Mf from minfx.generic import generic_minimise import specific_fns -from relax_errors import RelaxError, RelaxFuncSetupError, RelaxInfError, RelaxInvalidDataError, RelaxLenError, RelaxNaNError, RelaxNoModelError, RelaxNoPdbError, RelaxNoResError, RelaxNoSequenceError, RelaxNoSpinSpecError, RelaxNoTensorError, RelaxNoValueError, RelaxNoVectorsError, RelaxNucleusError, RelaxTensorError +from relax_errors import RelaxError, RelaxFault, RelaxFuncSetupError, RelaxInfError, RelaxInvalidDataError, RelaxLenError, RelaxNaNError, RelaxNoModelError, RelaxNoPdbError, RelaxNoResError, RelaxNoSequenceError, RelaxNoSpinSpecError, RelaxNoTensorError, RelaxNoValueError, RelaxNoVectorsError, RelaxNucleusError, RelaxTensorError from relax_warnings import RelaxDeselectWarning from user_functions.data import Uf_tables; uf_tables = Uf_tables() from user_functions.objects import Desc_container