Author: tlinnet Date: Sat Dec 6 15:19:46 2014 New Revision: 26977 URL: http://svn.gna.org/viewcvs/relax?rev=26977&view=rev Log: Added systemtest Spectrum.test_grace_sn_ratio to help implement plotting the signaÃl to noise ratio per residue. Modified: trunk/test_suite/system_tests/spectrum.py Modified: trunk/test_suite/system_tests/spectrum.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/spectrum.py?rev=26977&r1=26976&r2=26977&view=diff ============================================================================== --- trunk/test_suite/system_tests/spectrum.py (original) +++ trunk/test_suite/system_tests/spectrum.py Sat Dec 6 15:19:46 2014 @@ -194,3 +194,32 @@ # View the plotting. if show_grace: self.interpreter.grace.view(file=outfile, dir=filedir, grace_exe='xmgrace') + + + def test_grace_sn_ratio(self): + """Test grace plotting function for plotting the signal to noise ratio per residue. + """ + + # Setup data. + self.setup_signal_noise_ratio() + + # Calculate the signal to noise ratio calculation. + self.interpreter.spectrum.sn_ratio() + + # Deselect spin with negative intensity. + self.interpreter.deselect.spin(spin_id=':4@N', boolean='AND', change_all=False) + + # Test show grace. If showing, the temporary directory created, should not be deleted. + show_grace = False + if show_grace: + outfile= NamedTemporaryFile(delete=False).name + filedir = dirname(outfile) + else: + filedir = self.tmpdir + outfile = 'int_sn.agr' + + self.interpreter.grace.write(x_data_type='res_num', y_data_type='sn_ratio', file=outfile, dir=filedir, force=True) + + # View the plotting. + if show_grace: + self.interpreter.grace.view(file=outfile, dir=filedir, grace_exe='xmgrace')