Author: bugman Date: Tue Dec 9 09:06:23 2014 New Revision: 27041 URL: http://svn.gna.org/viewcvs/relax?rev=27041&view=rev Log: Merged revisions 27011,27014,27035-27040 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r27011 | bugman | 2014-12-08 11:03:44 +0100 (Mon, 08 Dec 2014) | 7 lines Added a compressed EPS version of the 128x128/actions/document-preview-archive Oxygen icon. The EPS bounding box was manually changed to 0 0 18 18 in a text editor. The scanline translation parameters were also fixed by changing them all to 18 as well. This allows the icon to be used in the relax manual. ........ r27014 | bugman | 2014-12-08 15:50:04 +0100 (Mon, 08 Dec 2014) | 5 lines Fix for the blacklist objects in data_store.data_classes.Element.to_xml(). The class blacklist variable was not being taken into account. ........ r27035 | bugman | 2014-12-09 08:32:31 +0100 (Tue, 09 Dec 2014) | 9 lines Added the norm_type argument to the grace.write user function. This is in response to http://thread.gmane.org/gmane.science.nmr.relax.devel/7392/focus=7438. This norm_type argument can either be 'first' or 'last' to allow different points of the plot to be the normalisation factor. The default of 'first' preserves the old behaviour of first point normalisation. ........ r27036 | bugman | 2014-12-09 08:36:47 +0100 (Tue, 09 Dec 2014) | 5 lines The relax_fit_saturation_recovery.py system test script now sets the norm_type argument. This is for testing out this new option for the grace.write user function. ........ r27037 | bugman | 2014-12-09 08:41:45 +0100 (Tue, 09 Dec 2014) | 6 lines The new grace.write user function norm_type argument has been activated. The argument is now passed from pipe_control.grace.write into the write_xy_data() function of the lib.software.grace module, and is used to select which point to use for the normalisation. ........ r27038 | bugman | 2014-12-09 08:47:10 +0100 (Tue, 09 Dec 2014) | 7 lines The relaxation exponential curve-fitting auto-analysis now sets the normalisation type. This is for the new grace.write user function. If the model for all spins is set to 'sat', then the norm_type will be set to 'last'. This allows for reasonable normalised curves for the saturation recovery R1 experiment types. ........ r27039 | bugman | 2014-12-09 08:54:53 +0100 (Tue, 09 Dec 2014) | 7 lines Change for norm_type variable in the relaxation exponential curve-fitting auto-analysis. This is now set to 'last', not only for the saturation recovery, but now also for the inversion recovery experiment types. This ensures that the normalisation point is the steady state magnetisation peak intensity. ........ r27040 | bugman | 2014-12-09 09:04:20 +0100 (Tue, 09 Dec 2014) | 8 lines Cleared the list of blacklisted objects for the cdp.exp_info data structure. The data_store.exp_info.ExpInfo class blacklist variable had previously not been used. But after recent changes, the list was now active. As all the contents of the container were blacklisted, the container was being initialised as being empty when reading the XML formatted state or results files. Therefore the blacklist is now set to an empty list. ........ Added: branches/frame_order_cleanup/graphics/oxygen_icons/128x128/actions/document-preview-archive.eps.gz - copied unchanged from r27040, trunk/graphics/oxygen_icons/128x128/actions/document-preview-archive.eps.gz Modified: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/auto_analyses/relax_fit.py branches/frame_order_cleanup/data_store/data_classes.py branches/frame_order_cleanup/data_store/exp_info.py branches/frame_order_cleanup/lib/software/grace.py branches/frame_order_cleanup/pipe_control/grace.py branches/frame_order_cleanup/test_suite/system_tests/scripts/relax_fit_saturation_recovery.py branches/frame_order_cleanup/user_functions/grace.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Dec 9 09:06:23 2014 @@ -1 +1 @@ -/trunk:1-27009 +/trunk:1-27040 Modified: branches/frame_order_cleanup/auto_analyses/relax_fit.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/auto_analyses/relax_fit.py?rev=27041&r1=27040&r2=27041&view=diff ============================================================================== --- branches/frame_order_cleanup/auto_analyses/relax_fit.py (original) +++ branches/frame_order_cleanup/auto_analyses/relax_fit.py Tue Dec 9 09:06:23 2014 @@ -132,12 +132,19 @@ # Save the results. self.interpreter.results.write(file='results', dir=self.results_dir, force=True) + # Determine the normalisation type. + norm_type = 'last' + for spin in spin_loop(skip_desel=True): + if spin.model not in ['sat', 'inv']: + norm_type = 'first' + break + # Create Grace plots of the data. self.interpreter.grace.write(y_data_type='chi2', file='chi2.agr', dir=self.grace_dir, force=True) # Minimised chi-squared value. self.interpreter.grace.write(y_data_type='i0', file='i0.agr', dir=self.grace_dir, force=True) # Initial peak intensity. self.interpreter.grace.write(y_data_type='rx', file=self.file_root+'.agr', dir=self.grace_dir, force=True) # Relaxation rate. self.interpreter.grace.write(x_data_type='relax_times', y_data_type='peak_intensity', file='intensities.agr', dir=self.grace_dir, force=True) # Average peak intensities. - self.interpreter.grace.write(x_data_type='relax_times', y_data_type='peak_intensity', norm=True, file='intensities_norm.agr', dir=self.grace_dir, force=True) # Average peak intensities (normalised). + self.interpreter.grace.write(x_data_type='relax_times', y_data_type='peak_intensity', norm_type=norm_type, norm=True, file='intensities_norm.agr', dir=self.grace_dir, force=True) # Average peak intensities (normalised). # Write a python "grace to PNG/EPS/SVG..." conversion script. # Open the file for writing. Modified: branches/frame_order_cleanup/data_store/data_classes.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/data_store/data_classes.py?rev=27041&r1=27040&r2=27041&view=diff ============================================================================== --- branches/frame_order_cleanup/data_store/data_classes.py (original) +++ branches/frame_order_cleanup/data_store/data_classes.py Tue Dec 9 09:06:23 2014 @@ -137,7 +137,7 @@ cont_element.setAttribute('desc', self.desc) # Blacklisted objects. - blacklist = ['name', 'desc', 'blacklist'] + list(Element.__dict__.keys()) + list(self.__class__.__dict__.keys()) + list(object.__dict__.keys()) + blacklist = self.blacklist + ['name', 'desc', 'blacklist'] + list(Element.__dict__.keys()) + list(self.__class__.__dict__.keys()) + list(object.__dict__.keys()) # Store and blacklist the objects which have to_xml() methods. to_xml_list = [] Modified: branches/frame_order_cleanup/data_store/exp_info.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/data_store/exp_info.py?rev=27041&r1=27040&r2=27041&view=diff ============================================================================== --- branches/frame_order_cleanup/data_store/exp_info.py (original) +++ branches/frame_order_cleanup/data_store/exp_info.py Tue Dec 9 09:06:23 2014 @@ -40,7 +40,7 @@ self.desc = "Experimental information" # Blacklisted objects. - self.blacklist = ["citations", "software", "temp_calibration", "temp_control"] + self.blacklist = [] def add_citation(self, cite_id=None, authors=None, doi=None, pubmed_id=None, full_citation=None, title=None, status=None, type=None, journal_abbrev=None, journal_full=None, volume=None, issue=None, page_first=None, page_last=None, year=None): Modified: branches/frame_order_cleanup/lib/software/grace.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/software/grace.py?rev=27041&r1=27040&r2=27041&view=diff ============================================================================== --- branches/frame_order_cleanup/lib/software/grace.py (original) +++ branches/frame_order_cleanup/lib/software/grace.py Tue Dec 9 09:06:23 2014 @@ -25,6 +25,10 @@ # Python module imports. from math import ceil, sqrt + +# relax module imports. +from lib.errors import RelaxError + # This script is used to batch convert the Grace *.agr files into graphics files using the Grace # program itself. @@ -119,7 +123,7 @@ file.write(" return_code = subprocess.call(im_args)\n") -def write_xy_data(data, file=None, graph_type=None, norm=None, autoscale=True): +def write_xy_data(data, file=None, graph_type=None, norm_type='first', norm=None, autoscale=True): """Write the data into the Grace xy-scatter plot. The numerical data should be supplied as a 4 dimensional list or array object. The first dimension corresponds to the graphs, Gx. The second corresponds the sets of each graph, Sx. The third corresponds to the data series (i.e. each data point). The forth is a list of the information about each point, it is a list where the first element is the x value, the second is the y value, the third is the optional dx or dy error (either dx or dy dependent upon the graph_type arg), and the forth is the optional dy error when graph_type is xydxdy (the third position is then dx). @@ -131,6 +135,8 @@ @type file: file object @keyword graph_type: The graph type which can be one of xy, xydy, xydx, or xydxdy. @type graph_type: str + @keyword norm_type: The point to normalise to 1. This can be 'first' or 'last'. + @type norm_type: str @keyword norm: The normalisation flag which if set to True will cause all graphs to be normalised to 1. The first dimension is the graph. @type norm: None or list of bool @keyword autoscale: A flag which if True will cause the world view of each graph to be autoscaled (by placing the Grace command "@autoscale" at the end of the file). If you have supplied a world view for the header or the tick spacing, this argument should be set to False to prevent that world view from being overwritten. @@ -164,7 +170,12 @@ # Normalisation (to the first data point y value!). norm_fact = 1.0 if norm[gi]: - norm_fact = data[gi][si][0][1] + if norm_type == 'first': + norm_fact = data[gi][si][0][1] + elif norm_type == 'last': + norm_fact = data[gi][si][-1][1] + else: + raise RelaxError("The normalisation type '%s' must be one of ['first', 'last']." % norm_fact) # Loop over the data points. for point in data[gi][si]: Modified: branches/frame_order_cleanup/pipe_control/grace.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/pipe_control/grace.py?rev=27041&r1=27040&r2=27041&view=diff ============================================================================== --- branches/frame_order_cleanup/pipe_control/grace.py (original) +++ branches/frame_order_cleanup/pipe_control/grace.py Tue Dec 9 09:06:23 2014 @@ -205,7 +205,7 @@ system(grace_exe + " \"" + file_path + "\" &") -def write(x_data_type='res_num', y_data_type=None, spin_id=None, plot_data='value', file=None, dir=None, force=False, norm=True): +def write(x_data_type='res_num', y_data_type=None, spin_id=None, plot_data='value', norm_type='first', file=None, dir=None, force=False, norm=True): """Writing data to a file. @keyword x_data_type: The category of the X-axis data. @@ -216,6 +216,8 @@ @type spin_id: str @keyword plot_data: The type of the plotted data, one of 'value', 'error', or 'sim'. @type plot_data: str + @keyword norm_type: The point to normalise to 1. This can be 'first' or 'last'. + @type norm_type: str @keyword file: The name of the Grace file to create. @type file: str @keyword dir: The optional directory to place the file into. @@ -272,7 +274,7 @@ write_xy_header(file=file, data_type=data_type, seq_type=seq_type, sets=[len(data[0])], set_names=[set_names], axis_labels=[axis_labels], norm=[norm]) # Write the data. - write_xy_data(data, file=file, graph_type=graph_type, norm=[norm]) + write_xy_data(data, file=file, graph_type=graph_type, norm_type=norm_type, norm=[norm]) # Close the file. file.close() Modified: branches/frame_order_cleanup/test_suite/system_tests/scripts/relax_fit_saturation_recovery.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/system_tests/scripts/relax_fit_saturation_recovery.py?rev=27041&r1=27040&r2=27041&view=diff ============================================================================== --- branches/frame_order_cleanup/test_suite/system_tests/scripts/relax_fit_saturation_recovery.py (original) +++ branches/frame_order_cleanup/test_suite/system_tests/scripts/relax_fit_saturation_recovery.py Tue Dec 9 09:06:23 2014 @@ -130,7 +130,7 @@ grace.write(y_data_type='i0', file='i0.agr', dir=ds.tmpdir, force=True) # Initial peak intensity. grace.write(y_data_type='rx', file='rx.agr', dir=ds.tmpdir, force=True) # Relaxation rate. grace.write(x_data_type='relax_times', y_data_type='peak_intensity', file='intensities.agr', dir=ds.tmpdir, force=True) # Average peak intensities. -grace.write(x_data_type='relax_times', y_data_type='peak_intensity', norm=True, file='intensities_norm.agr', dir=ds.tmpdir, force=True) # Average peak intensities (normalised). +grace.write(x_data_type='relax_times', y_data_type='peak_intensity', norm_type='last', norm=True, file='intensities_norm.agr', dir=ds.tmpdir, force=True) # Average peak intensities (normalised). # Save the program state. state.save('devnull', force=True) Modified: branches/frame_order_cleanup/user_functions/grace.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/user_functions/grace.py?rev=27041&r1=27040&r2=27041&view=diff ============================================================================== --- branches/frame_order_cleanup/user_functions/grace.py (original) +++ branches/frame_order_cleanup/user_functions/grace.py Tue Dec 9 09:06:23 2014 @@ -146,6 +146,23 @@ wiz_read_only = True ) uf.add_keyarg( + name = "norm_type", + default = "first", + py_type = "str", + desc_short = "normalisation point", + desc = "How the graph should be normalised, if the norm flag is set.", + wiz_element_type = "combo", + wiz_combo_choices = [ + "First point normalisation", + "Last point normalisation" + ], + wiz_combo_data = [ + "first", + "last" + ], + wiz_read_only = True +) +uf.add_keyarg( name = "file", py_type = "str", arg_type = "file sel", @@ -175,7 +192,7 @@ default = False, py_type = "bool", desc_short = "normalisation flag", - desc = "A flag which, if set to True, will cause all graphs to be normalised to a starting value of 1. This is for the normalisation of series type data." + desc = "A flag which, if set to True, will cause all graphs to be normalised to 1. This is for the normalisation of series type data. The point for normalisation is set with the norm_type argument." ) # Description. uf.desc.append(Desc_container())