Author: semor Date: Fri Oct 10 04:23:03 2008 New Revision: 7593 URL: http://svn.gna.org/viewcvs/relax?rev=7593&view=rev Log: Added more for the reading of intensities from a nmrview peak list. There is still a need to fix the reading of the assignments which are of the format number.nucleus (e.g. 22.HN). Moreover, a functionality to chose whether the intensity or volume column is read could be added as proposed in a post at: https://mail.gna.org/public/relax-devel/2008-10/msg00026.html (Message-id: <48EE7028.6060409@xxxxxxxxx>). Modified: 1.3/generic_fns/intensity.py Modified: 1.3/generic_fns/intensity.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/intensity.py?rev=7593&r1=7592&r2=7593&view=diff ============================================================================== --- 1.3/generic_fns/intensity.py (original) +++ 1.3/generic_fns/intensity.py Fri Oct 10 04:23:03 2008 @@ -173,9 +173,28 @@ @raises RelaxError: When the expected peak intensity is not a float. """ - # Print some texte indicating the unavailability of this function... - print "This function is still unavailable.\n" - sys.exit() + # The residue number + try: + res_num = int(line[2]) + except ValueError: + raise RelaxError, "The peak list is invalid." + + # Nuclei names. + x_name = line[9] + h_name = line[2] + + # The peak intensity column. + if int_col == None: + int_col = 16 + + # Intensity. + try: + intensity = float(line[int_col]) + except ValueError: + raise RelaxError, "The peak intensity value " + `intensity` + " from the line " + `line` + " is invalid." + + # Return the data. + return res_num, h_name, x_name, intensity def number_of_header_lines(file_data, format, int_col, intensity):