Author: bugman Date: Wed Mar 27 14:32:54 2013 New Revision: 19217 URL: http://svn.gna.org/viewcvs/relax?rev=19217&view=rev Log: Ported r8415 from the old relax_disp branch into the new branch. The command used was: svn merge -r8414:8415 svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/relax_disp/specific_fns/@r18123 specific_analyses ..... r8415 | semor | 2009-01-12 14:27:11 +0100 (Mon, 12 Jan 2009) | 7 lines Changed paths: M /branches/relax_disp/specific_fns/relax_disp.py Added tests, print statements and other code to the relaxation dispersion specific functions. Tests were proosed by Ed in a post at: https://mail.gna.org/public/relax-devel/2009-01/msg00065.html (Message-id: <7f080ed10901120107t4f1cd53ew51f498a45a38eade@xxxxxxxxxxxxxx>) ..... Modified: branches/relax_disp/specific_analyses/relax_disp.py Modified: branches/relax_disp/specific_analyses/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp.py?rev=19217&r1=19216&r2=19217&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp.py (original) +++ branches/relax_disp/specific_analyses/relax_disp.py Wed Mar 27 14:32:54 2013 @@ -245,6 +245,9 @@ @type delayT: float """ + # Test if the current data pipe exists. + pipes.test + # Alias the current data pipe. cdp = pipes.get_pipe() @@ -252,12 +255,26 @@ if not hasattr(cdp, 'delayT'): cdp.delayT = {} + # Test if the pipe type is set to 'relax_disp'. + function_type = cdp.pipe_type + if function_type != 'relax_disp': + raise RelaxFuncSetupError, specific_setup.get_string(function_type) + + # Test if sequence data is loaded. + if not exists_mol_res_spin_data(): + raise RelaxNoSequenceError + + # Make sure the experiment type is set to 'cpmg'. + if not cdp.exp_type == 'cpmg': + raise RelaxError, "To use the function cpmg_delay(), the experiment type must be set to 'cpmg'." + # Test the CPMG constant time delay (T) has not already been set. if cdp.delayT.has_key(id): raise RelaxError, "The CPMG constant time delay (T) for the experiment " + `id` + " has already been set." # Set the CPMG constant time delay (T). cdp.delayT[id] = delayT + print "The CPMG delay T for experiment " + `id` + " has been set to " + `cdp.delayT[id]` + " s." def create_mc_data(self, spin_id): @@ -540,11 +557,12 @@ # CPMG relaxation dispersion experiments. if exp == 'cpmg': print "CPMG relaxation dispersion experiments." + cdp.exp_type = 'cpmg' # R1rho relaxation dispersion experiments. elif exp == 'r1rho': - #print "R1rho relaxation dispersion experiments." - raise RelaxError, "R1rho relaxation dispersion experiments have not been implemented yet." + print "R1rho relaxation dispersion experiments." + cdp.exp_type = 'r1rho' # Invalid relaxation dispersion experiment. else: @@ -1156,6 +1174,10 @@ if not exists_mol_res_spin_data(): raise RelaxNoSequenceError + # Test if the experiment type is set. + if not hasattr(cdp, 'exp_type'): + raise RelaxError, "The relaxation dispersion experiment type has not been set." + # Fast-exchange regime. if model == 'fast': print "Fast-exchange regime."