mailr12695 - in /branches/relax_data: generic_fns/pdc.py prompt/pdc.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on March 02, 2011 - 10:57:
Author: bugman
Date: Wed Mar  2 10:57:34 2011
New Revision: 12695

URL: http://svn.gna.org/viewcvs/relax?rev=12695&view=rev
Log:
Updated the pdc.read() user function to the new relax data ID string design.


Modified:
    branches/relax_data/generic_fns/pdc.py
    branches/relax_data/prompt/pdc.py

Modified: branches/relax_data/generic_fns/pdc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_data/generic_fns/pdc.py?rev=12695&r1=12694&r2=12695&view=diff
==============================================================================
--- branches/relax_data/generic_fns/pdc.py (original)
+++ branches/relax_data/generic_fns/pdc.py Wed Mar  2 10:57:34 2011
@@ -81,13 +81,15 @@
     return ":%s" % res_num
 
 
-def read(file=None, dir=None):
+def read(ri_id=None, file=None, dir=None):
     """Read the PDC data file and place all the data into the relax data 
store.
 
-    @keyword file:          The name of the file to open.
-    @type file:             str
-    @keyword dir:           The directory containing the file (defaults to 
the current directory if None).
-    @type dir:              str or None
+    @keyword ri_id: The relaxation data ID string.
+    @type ri_id:    str
+    @keyword file:  The name of the file to open.
+    @type file:     str
+    @keyword dir:   The directory containing the file (defaults to the 
current directory if None).
+    @type dir:      str or None
     """
 
     # Test if the current pipe exists.
@@ -135,16 +137,15 @@
         # The data type.
         if row[0] == 'Project:':
             if search('T1', row[1]):
-                ri_label = 'R1'
+                ri_type = 'R1'
             elif search('T2', row[1]):
-                ri_label = 'R2'
+                ri_type = 'R2'
             elif search('NOE', row[1]):
-                ri_label = 'NOE'
+                ri_type = 'NOE'
 
         # Get the frequency.
         elif row[0] == 'Proton frequency[MHz]:':
             frq = float(row[1])
-            frq_label = str(int(round(float(row[1])/10)*10))
 
         # Inside the relaxation data section.
         elif row[0] == 'SECTION:' and row[1] == 'results':
@@ -160,7 +161,7 @@
             res_nums.append(get_res_num(row[0]))
 
             # Get the relaxation data.
-            if ri_label != 'NOE':
+            if ri_type != 'NOE':
                 #rx, rx_err = convert_relax_data(row[3:])
                 rx = float(row[-2])
                 rx_err = float(row[-1])
@@ -197,10 +198,10 @@
                 int_type = 'volume'
 
     # Pack the data.
-    pack_data(ri_label, frq_label, frq, values, errors, spin_ids=res_nums)
+    pack_data(ri_id, ri_type, frq, values, errors, spin_ids=res_nums)
 
     # Set the integration method.
-    peak_intensity_type(ri_label=ri_label, frq_label=frq_label, 
type=int_type)
+    peak_intensity_type(ri_id=ri_id, type=int_type)
 
     # Set the PDC as used software.
     software_select('Bruker PDC', version=version)

Modified: branches/relax_data/prompt/pdc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_data/prompt/pdc.py?rev=12695&r1=12694&r2=12695&view=diff
==============================================================================
--- branches/relax_data/prompt/pdc.py (original)
+++ branches/relax_data/prompt/pdc.py Wed Mar  2 10:57:34 2011
@@ -33,11 +33,13 @@
 class Pdc(User_fn_class):
     """Class containing the function for reading the Bruker Protein Dynamics 
Centre (PDC) files."""
 
-    def read(self, file=None, dir=None):
+    def read(self, ri_id=None, file=None, dir=None):
         """Read the Bruker Protein Dynamics Centre (PDC) file.
 
         Keyword Arguments
         ~~~~~~~~~~~~~~~~~
+
+        ri_id:  The relaxation data ID string.
 
         file:  The name of the PDC file.
 
@@ -54,13 +56,15 @@
         # Function intro text.
         if self._exec_info.intro:
             text = self._exec_info.ps3 + "pdc.read("
-            text = text + "file=" + repr(file)
+            text = text + "ri_id=" + repr(ri_id)
+            text = text + ", file=" + repr(file)
             text = text + ", dir=" + repr(dir) + ")"
             print(text)
 
         # The argument checks.
+        arg_check.is_str(ri_id, 'relaxation data ID string')
         arg_check.is_str(file, 'file name')
         arg_check.is_str(dir, 'directory name', can_be_none=True)
 
         # Execute the functional code.
-        pdc.read(file=file, dir=dir)
+        pdc.read(ri_id=ri_id, file=file, dir=dir)




Related Messages


Powered by MHonArc, Updated Wed Mar 02 11:20:02 2011