Author: bugman Date: Thu Feb 18 13:27:07 2010 New Revision: 10712 URL: http://svn.gna.org/viewcvs/relax?rev=10712&view=rev Log: Created the rdc.calc_q_factors() and pcs.calc_q_factors() user functions. The back-calculated RDC/PCS data must first be generated by the specific code. Modified: 1.3/prompt/pcs.py 1.3/prompt/rdc.py Modified: 1.3/prompt/pcs.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/pcs.py?rev=10712&r1=10711&r2=10712&view=diff ============================================================================== --- 1.3/prompt/pcs.py (original) +++ 1.3/prompt/pcs.py Thu Feb 18 13:27:07 2010 @@ -54,6 +54,44 @@ # Execute the functional code. pcs.back_calc(align_id=align_id) + + + def calc_q_factors(self, spin_id=None): + """Calculate the PCS Q-factor for the selected spins. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + spin_id: The spin ID string to restrict the PCS Q-factor calculation to subset of all selected spins. + + + Description + ~~~~~~~~~~~ + + For this function to work, the back-calculated PCS data must first be generated by the + analysis specific code. Otherwise a warning will be given. + + + Examples + ~~~~~~~~ + + To calculate the RDC Q-factor for only the spins '@H26', '@H27', and '@H28', type one of: + + relax> pcs.calc_q_factors('@H26 & @H27 & @H28') + relax> pcs.calc_q_factors(spin_id='@H26 & @H27 & @H28') + """ + + # Function intro text. + if self.exec_info.intro: + text = self.exec_info.ps3 + "pcs.calc_q_factors(" + text = text + "spin_id=" + repr(spin_id) + ")" + print(text) + + # The argument checks. + arg_check.is_str(spin_id, 'spin ID string', can_be_none=True) + + # Execute the functional code. + pcs.q_factors(spin_id=spin_id) def centre(self, pos=None, atom_id=None, pipe=None, verbosity=1, ave_pos=True, force=False): Modified: 1.3/prompt/rdc.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/rdc.py?rev=10712&r1=10711&r2=10712&view=diff ============================================================================== --- 1.3/prompt/rdc.py (original) +++ 1.3/prompt/rdc.py Thu Feb 18 13:27:07 2010 @@ -54,6 +54,44 @@ # Execute the functional code. rdc.back_calc(align_id=align_id) + + + def calc_q_factors(self, spin_id=None): + """Calculate the RDC Q-factor for the selected spins. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + spin_id: The spin ID string for restricting to subset of all selected spins. + + + Description + ~~~~~~~~~~~ + + For this function to work, the back-calculated RDC data must first be generated by the + analysis specific code. Otherwise a warning will be given. + + + Examples + ~~~~~~~~ + + To calculate the RDC Q-factor for only the spins '@H26', '@H27', and '@H28', type one of: + + relax> rdc.calc_q_factors('@H26 & @H27 & @H28') + relax> rdc.calc_q_factors(spin_id='@H26 & @H27 & @H28') + """ + + # Function intro text. + if self.exec_info.intro: + text = self.exec_info.ps3 + "rdc.calc_q_factors(" + text = text + "spin_id=" + repr(spin_id) + ")" + print(text) + + # The argument checks. + arg_check.is_str(spin_id, 'spin ID string', can_be_none=True) + + # Execute the functional code. + rdc.q_factors(spin_id=spin_id) def copy(self, pipe_from=None, pipe_to=None, align_id=None):