Hmmm, I wonder if there is a way of querying the matplotlib plot for the axis labels, rather than calling plt.show(). That would allow this system test to be activated and converted into a usable and useful test! Or to obtain some text representation of the plot which can then be checked. Do you know of any ways to do this? Cheers, Edward On 28 November 2014 at 13:54, <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet Date: Fri Nov 28 13:54:20 2014 New Revision: 26804 URL: http://svn.gna.org/viewcvs/relax?rev=26804&view=rev Log: Added additonal systemtest for plotting data. Nmrglue.xtest_plot_contour_cpmg. This shoves, that the automatic ppm scale finding is working. Task #7873 (https://gna.org/task/index.php?7873): Write wrapper function to nmrglue, to read .ft2 files and process them. Homepage: http://www.nmrglue.com/ Link to nmrglue discussion: https://groups.google.com/forum/#!forum/nmrglue-discuss The code is develop at Github: https://github.com/jjhelmus/nmrglue/ Google code: https://code.google.com/p/nmrglue/ Documentation: http://nmrglue.readthedocs.org/en/latest/index.html Modified: branches/nmrglue/test_suite/system_tests/nmrglue.py Modified: branches/nmrglue/test_suite/system_tests/nmrglue.py URL: http://svn.gna.org/viewcvs/relax/branches/nmrglue/test_suite/system_tests/nmrglue.py?rev=26804&r1=26803&r2=26804&view=diff ============================================================================== --- branches/nmrglue/test_suite/system_tests/nmrglue.py (original) +++ branches/nmrglue/test_suite/system_tests/nmrglue.py Fri Nov 28 13:54:20 2014 @@ -26,6 +26,7 @@ # relax module imports. from data_store import Relax_data_store; ds = Relax_data_store() +from lib.io import file_root from pipe_control.nmrglue import plot_contour from status import Status; status = Status() from test_suite.system_tests.base_classes import SystemTestCase @@ -107,3 +108,34 @@ # Now show import matplotlib.pyplot as plt plt.show() + + + def xtest_plot_contour_cpmg(self): + """Test the plot_contour function in pipe_control. + This is from the U{tutorial<http://jjhelmus.github.io/nmrglue/current/examples/plot_2d_spectrum.html>}. + + The data is from systemtest -s Relax_disp.test_repeat_cpmg + U{task #7826<https://gna.org/task/index.php?7826>}. Write an python class for the repeated analysis of dispersion data. + """ + + # Define base path to files. + base_path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'repeated_analysis'+sep+'SOD1' + + # Define folder to all ft files. + ft2_folder_1 = base_path +sep+ 'cpmg_disp_sod1d90a_060518' +sep+ 'cpmg_disp_sod1d90a_060518_normal.fid' +sep+ 'ft2_data' + ft2_folder_2 = base_path +sep+ 'cpmg_disp_sod1d90a_060521' +sep+ 'cpmg_disp_sod1d90a_060521_normal.fid' +sep+ 'ft2_data' + + # Read the spectrum. + fname = '128_0_FT.ft2' + sp_id = file_root(fname) + self.interpreter.spectrum.nmrglue_read(file=fname, dir=ft2_folder_1, spectrum_id=sp_id) + + # Call the pipe_control function and get the return axis. + ax = plot_contour(spectrum_id=sp_id, contour_start=200000., contour_num=20, contour_factor=1.20, ppm=True, show=False) + + # Set a new title. + ax.set_title("CPMG Spectrum") + + # Now show + import matplotlib.pyplot as plt + plt.show() _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@xxxxxxx To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits