Author: bugman Date: Wed Oct 22 12:36:21 2008 New Revision: 7915 URL: http://svn.gna.org/viewcvs/relax?rev=7915&view=rev Log: Renamed relax_fit.read() to relax_fit.relax_time() and significantly decreased its functionality. Most of relax_fit.read() is now in spectrum.read_intensities() and hence this functionality has been axed. All that is left is the associating of a spectrum to a time point. Modified: branches/spectral_errors/prompt/relax_fit.py Modified: branches/spectral_errors/prompt/relax_fit.py URL: http://svn.gna.org/viewcvs/relax/branches/spectral_errors/prompt/relax_fit.py?rev=7915&r1=7914&r2=7915&view=diff ============================================================================== --- branches/spectral_errors/prompt/relax_fit.py (original) +++ branches/spectral_errors/prompt/relax_fit.py Wed Oct 22 12:36:21 2008 @@ -42,106 +42,43 @@ self.__relax__ = relax - def read(self, file=None, dir=None, relax_time=0.0, format='sparky', heteronuc='N', proton='HN', int_col=None): - """Function for reading peak intensities from a file. + def relax_time(self, time=0.0, spectrum_id=None): + """Function for setting the relaxation time period associated with each spectrum. Keyword Arguments ~~~~~~~~~~~~~~~~~ - file: The name of the file containing the sequence data. + time: The time, in seconds, of the relaxation period. - dir: The directory where the file is located. - - relax_time: The time, in seconds, of the relaxation period. - - format: The type of file containing peak intensities. - - heteronuc: The name of the heteronucleus as specified in the peak intensity file. - - proton: The name of the proton as specified in the peak intensity file. - - int_col: The column containing the peak intensity data (for a non-standard formatted file). + spectrum_id: The spectrum identification string. Description ~~~~~~~~~~~ - The peak intensity can either be from peak heights or peak volumes. - - - The format argument can currently be set to: - 'sparky' - 'xeasy' - 'nmrview' - - If the 'format' argument is set to 'sparky', the file should be a Sparky peak list saved after - typing the command 'lt'. The default is to assume that columns 0, 1, 2, and 3 (1st, 2nd, - 3rd, and 4th) contain the Sparky assignment, w1, w2, and peak intensity data respectively. - The frequency data w1 and w2 are ignored while the peak intensity data can either be the - peak height or volume displayed by changing the window options. If the peak intensity data - is not within column 3, set the argument int_col to the appropriate value (column numbering - starts from 0 rather than 1). - - If the 'format' argument is set to 'xeasy', the file should be the saved XEasy text window - output of the list peak entries command, 'tw' followed by 'le'. As the columns are fixed, - the peak intensity column is hardwired to number 10 (the 11th column) which contains either - the peak height or peak volume data. Because the columns are fixed, the int_col argument - will be ignored. - - If the 'format' argument is set to 'nmrview', the file should be a NMRView peak list. The - default is to use column 16 (which contains peak heights) for peak intensities. To use - use peak volumes (or evolumes), int_col must be set to 15. - - - The heteronuc and proton arguments should be set respectively to the name of the - heteronucleus and proton in the file. Only those lines which match these labels will be - used. - - + Peak intensities should be loaded before calling this user function via the + 'spectrum.read_intensities()' user function. The intensity values will then be associated + with a spectrum identifier. To associate each spectrum identifier with a time point in the + relaxation curve prior to optimisation, this user function should be called. """ # Function intro text. if self.__relax__.interpreter.intro: - text = sys.ps3 + "relax_fit.read(" - text = text + "file=" + `file` - text = text + ", dir=" + `dir` - text = text + ", relax_time=" + `relax_time` - text = text + ", format=" + `format` - text = text + ", heteronuc=" + `heteronuc` - text = text + ", proton=" + `proton` - text = text + ", int_col=" + `int_col` + ")" + text = sys.ps3 + "relax_fit.relax_time(" + text = text + "time=" + `time` + text = text + ", spectrum_id=" + `spectrum_id` + ")" print text - # The file name. - if type(file) != str: - raise RelaxStrError, ('file name', file) + # The relaxation time. + if type(time) != int and type(time) != float: + raise RelaxNumError, ('relaxation time', time) - # Directory. - if dir != None and type(dir) != str: - raise RelaxNoneStrError, ('directory name', dir) - - # The relaxation time. - if type(relax_time) != int and type(relax_time) != float: - raise RelaxNumError, ('relaxation time', relax_time) - - # The format. - if type(format) != str: - raise RelaxStrError, ('format', format) - - # The heteronucleus name. - if type(heteronuc) != str: - raise RelaxStrError, ('heteronucleus name', heteronuc) - - # The proton name. - if type(proton) != str: - raise RelaxStrError, ('proton name', proton) - - # The intensity column. - if int_col and type(int_col) != int: - raise RelaxNoneIntError, ('intensity column', int_col) + # The spectrum identification string. + if type(spectrum_id) != str: + raise RelaxStrError, ('spectrum identification string', spectrum_id) # Execute the functional code. - relax_fit_obj.read(file=file, dir=dir, relax_time=relax_time, format=format, heteronuc=heteronuc, proton=proton, int_col=int_col) + relax_fit_obj.relax_time(time=time, spectrum_id=spectrum_id) def select_model(self, model='exp'):