Author: tlinnet Date: Sat Nov 29 01:36:54 2014 New Revision: 26818 URL: http://svn.gna.org/viewcvs/relax?rev=26818&view=rev Log: Added systemtest Nmrglue.xtest_plot_hist_cpmg_several to test the histogram plotting of several spectra. 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=26818&r1=26817&r2=26818&view=diff ============================================================================== --- branches/nmrglue/test_suite/system_tests/nmrglue.py (original) +++ branches/nmrglue/test_suite/system_tests/nmrglue.py Sat Nov 29 01:36:54 2014 @@ -21,6 +21,7 @@ ############################################################################### # Python module imports. +from numpy import concatenate from os import sep from tempfile import mkdtemp, NamedTemporaryFile @@ -214,3 +215,35 @@ # Plot the histogram. kwargs = {'bins': 3000, 'range': None, 'normed': False, 'facecolor':'green', 'alpha':0.75} plot_hist(ndarray=data, hist_kwargs=kwargs, show=True) + + + def xtest_plot_hist_cpmg_several(self): + """Test the plot_hist function in pipe_control with several spectra. + + 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' + + # Get the file list matching a glob pattern. + ft2_glob_pat = '128_*_FT.ft2' + basename_list, file_root_list = get_file_list(glob_pattern=ft2_glob_pat, dir=ft2_folder_1) + + # Read the spectra. + self.interpreter.spectrum.nmrglue_read(file=basename_list, dir=ft2_folder_1, spectrum_id=file_root_list) + + # Extract the data. + data_0 = cdp.ngdata[file_root_list[0]].data + data_1 = cdp.ngdata[file_root_list[1]].data + + # First flatten arrays, and then merge them. + data = concatenate( (data_0.flatten(), data_1.flatten() ) ) + + # Plot the histogram. + kwargs = {'bins': 3000, 'range': None, 'normed': False, 'facecolor':'green', 'alpha':0.75} + plot_hist(ndarray=data, hist_kwargs=kwargs, show=True)