Author: tlinnet Date: Mon Dec 8 19:40:27 2014 New Revision: 27034 URL: http://svn.gna.org/viewcvs/relax?rev=27034&view=rev Log: Parsed the dic, udic, data from pipe_control into backend of contour_plot for nmrglue. 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/lib/software/nmrglue.py branches/nmrglue/pipe_control/nmrglue.py Modified: branches/nmrglue/lib/software/nmrglue.py URL: http://svn.gna.org/viewcvs/relax/branches/nmrglue/lib/software/nmrglue.py?rev=27034&r1=27033&r2=27034&view=diff ============================================================================== --- branches/nmrglue/lib/software/nmrglue.py (original) +++ branches/nmrglue/lib/software/nmrglue.py Mon Dec 8 19:40:27 2014 @@ -36,11 +36,15 @@ from target_functions.chi2 import chi2_rankN -def contour_plot(nmrglue_id=None, contour_start=30000., contour_num=20, contour_factor=1.20, ppm=True, show=False): +def contour_plot(dic=None, udic=None, data=None, contour_start=30000., contour_num=20, contour_factor=1.20, ppm=True, show=False): """Plot the spectrum as contour plot. - @keyword nmrglue_id: The spectrum identification string. - @type nmrglue_id: str or list of str + @keyword dic: The data dictionary, from nmrglue. + @type dic: dict + @keyword udic: The universal dictionary, from nmrglue. + @type udic: dict + @keyword data: The spectrum data as 2D numpy array. + @type data: 2D numpy array @keyword contour_start: Contour level start value @type contour_start: float @keyword contour_num: Number of contour levels @@ -55,11 +59,6 @@ @rtype: matplotlib.axes.AxesSubplot """ - # Extract the data. - dic = cdp.nmrglue[nmrglue_id].dic - udic = cdp.nmrglue[nmrglue_id].udic - data = cdp.nmrglue[nmrglue_id].data - # Setup plot parameters # contour map (colors to use for contours) cmap = matplotlib.cm.Blues_r Modified: branches/nmrglue/pipe_control/nmrglue.py URL: http://svn.gna.org/viewcvs/relax/branches/nmrglue/pipe_control/nmrglue.py?rev=27034&r1=27033&r2=27034&view=diff ============================================================================== --- branches/nmrglue/pipe_control/nmrglue.py (original) +++ branches/nmrglue/pipe_control/nmrglue.py Mon Dec 8 19:40:27 2014 @@ -154,8 +154,13 @@ @rtype: matplotlib.axes.AxesSubplot """ + # Extract the data. + dic = cdp.nmrglue[nmrglue_id].dic + udic = cdp.nmrglue[nmrglue_id].udic + data = cdp.nmrglue[nmrglue_id].data + # Call the contour plot. - ax = contour_plot(nmrglue_id=nmrglue_id, contour_start=contour_start, contour_num=contour_num, contour_factor=contour_factor, ppm=ppm, show=show) + ax = contour_plot(dic=dic, udic=udic, data=data, contour_start=contour_start, contour_num=contour_num, contour_factor=contour_factor, ppm=ppm, show=show) # Return the axis instance, for possibility for additional decoration. return ax