mailRe: r26786 - /branches/nmrglue/lib/spectrum/objects.py


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

Header


Content

Posted by Edward d'Auvergne on November 27, 2014 - 17:39:
Hi Troels,

Note that the relax data store XML routines will handle a simply numpy
array already.  With the system test I mention at
http://thread.gmane.org/gmane.science.nmr.relax.scm/24536/focus=7342,
maybe you should try storing this in the relax data store?  That would
be the ultimate solution!

Cheers,

Edward



On 27 November 2014 at 16:43,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Thu Nov 27 16:43:22 2014
New Revision: 26786

URL: http://svn.gna.org/viewcvs/relax?rev=26786&view=rev
Log:
Added a class instance object for handling and storing nmrglue data.

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/spectrum/objects.py

Modified: branches/nmrglue/lib/spectrum/objects.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/nmrglue/lib/spectrum/objects.py?rev=26786&r1=26785&r2=26786&view=diff
==============================================================================
--- branches/nmrglue/lib/spectrum/objects.py    (original)
+++ branches/nmrglue/lib/spectrum/objects.py    Thu Nov 27 16:43:22 2014
@@ -32,6 +32,37 @@
 class Assignment:
     """A special container for a single assignment in a peak list."""

+
+class Nmrglue_data(list):
+    """The object used to represent a nmrglue data."""
+
+    def __init__(self):
+        """Set up the object."""
+
+
+    def add(self, file_path=None, dic=None, udic=None, data=None):
+        """Add a nmrglue data element.
+
+
+        @keyword file_path:         The path to the spectrum.
+        @type file_path:            str
+        @keyword dic:               The data dictionary.
+        @type dic:                  dic
+        @keyword udic:              The universal data dictionary.
+        @type udic:                 dic
+        @keyword data:              The data as numpy array.
+        @type data:                 numpy array
+        """
+
+        # Add a new element.
+        self.append(Assignment())
+
+        # Store the data.
+        assign = self[-1]
+        assign.file_path = file_path
+        assign.dic = dic
+        assign.udic = udic
+        assign.data = data


 class Peak_list(list):


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits



Related Messages


Powered by MHonArc, Updated Thu Nov 27 18:00:17 2014