Author: semor Date: Tue Feb 3 00:01:37 2009 New Revision: 8720 URL: http://svn.gna.org/viewcvs/relax?rev=8720&view=rev Log: Reordered a few functions for alphabetical reasons. Modified: branches/relax_disp/specific_fns/relax_disp.py Modified: branches/relax_disp/specific_fns/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_fns/relax_disp.py?rev=8720&r1=8719&r2=8720&view=diff ============================================================================== --- branches/relax_disp/specific_fns/relax_disp.py (original) +++ branches/relax_disp/specific_fns/relax_disp.py Tue Feb 3 00:01:37 2009 @@ -274,6 +274,48 @@ return r2eff + def cpmg_delayT(self, id=None, delayT=None): + """Set the CPMG constant time delay (T) of the experiment. + + @keyword id: The experimental identification string (allowing for multiple experiments + per data pipe). + @type id: str + @keyword delayT: The CPMG constant time delay (T) in s. + @type delayT: float + """ + + # Test if the current data pipe exists. + pipes.test() + + # Alias the current data pipe. + cdp = pipes.get_pipe() + + # Set up the dictionnary data structure if it doesn't exist yet. + 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 this user function, 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 cpmg_frq(self, cpmg_frq=None, spectrum_id=None): """Set the CPMG frequency associated with a given spectrum. @@ -310,48 +352,6 @@ # Add the frequency at the correct position. cdp.cpmg_frqs[index] = cpmg_frq - - - def cpmg_delayT(self, id=None, delayT=None): - """Set the CPMG constant time delay (T) of the experiment. - - @keyword id: The experimental identification string (allowing for multiple experiments - per data pipe). - @type id: str - @keyword delayT: The CPMG constant time delay (T) in s. - @type delayT: float - """ - - # Test if the current data pipe exists. - pipes.test() - - # Alias the current data pipe. - cdp = pipes.get_pipe() - - # Set up the dictionnary data structure if it doesn't exist yet. - 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 this user function, 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): @@ -1113,26 +1113,6 @@ return spin.intensities - def return_error(self, spin_id): - """Return the standard deviation data structure. - - @param spin_id: The spin identification string, as yielded by the base_data_loop() generator - method. - @type spin_id: str - @return: The standard deviation data structure. - @rtype: list of float - """ - - # Get the current data pipe. - cdp = pipes.get_pipe() - - # Get the spin container. - spin = return_spin(spin_id) - - # Return the error list. - return spin.intensity_err - - def return_data_name(self, name): """ Relaxation dispersion curve fitting data type string matching patterns @@ -1195,6 +1175,26 @@ return 'cpmg_frqs' + def return_error(self, spin_id): + """Return the standard deviation data structure. + + @param spin_id: The spin identification string, as yielded by the base_data_loop() generator + method. + @type spin_id: str + @return: The standard deviation data structure. + @rtype: list of float + """ + + # Get the current data pipe. + cdp = pipes.get_pipe() + + # Get the spin container. + spin = return_spin(spin_id) + + # Return the error list. + return spin.intensity_err + + def return_grace_string(self, data_type): """Function for returning the Grace string representing the data type for axis labelling."""