Allow Waves to be directly used as numpy arrays
authorMerlijn van Deen (valhallasw) <valhallasw+prune@gmail.com>
Mon, 26 Sep 2011 08:38:47 +0000 (10:38 +0200)
committerMerlijn van Deen (valhallasw) <valhallasw+prune@gmail.com>
Mon, 26 Sep 2011 08:38:47 +0000 (10:38 +0200)
igor.py

diff --git a/igor.py b/igor.py
index e67ed33d80e1db6b9f2b18a25e56750af5c8d026..9c68111e8509e1eb3ce10c9fec43a2d2077d23e2 100644 (file)
--- a/igor.py
+++ b/igor.py
@@ -204,6 +204,9 @@ class Wave(ParseObject):
         else:
             type,size = "data", "x".join(str(d) for d in self.data.shape)
         return " "*indent+"%s %s (%s)"%(self.name, type, size)
+    
+    def __array__(self):
+        return self.data
         
 class Recreation(ParseObject):
     """