From 65a3df1665a8286c82307828891577613a37d70a Mon Sep 17 00:00:00 2001
From: Marcus Müller <marcus@hostalia.de>
Date: Sat, 25 Aug 2018 01:23:10 +0200
Subject: remove completely unused scipy from gr-util plot apps

---
 gr-utils/python/utils/gr_plot_const | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

(limited to 'gr-utils/python/utils/gr_plot_const')

diff --git a/gr-utils/python/utils/gr_plot_const b/gr-utils/python/utils/gr_plot_const
index 2ec54c3585..6d0484391e 100755
--- a/gr-utils/python/utils/gr_plot_const
+++ b/gr-utils/python/utils/gr_plot_const
@@ -22,11 +22,7 @@
 
 from __future__ import print_function
 
-try:
-    import scipy
-except ImportError:
-    print("Please install SciPy to run this script (http://www.scipy.org/)")
-    raise SystemExit(1)
+import numpy
 
 try:
     from pylab import *
@@ -44,7 +40,7 @@ class draw_constellation:
         self.start = options.start
         self.sample_rate = options.sample_rate
 
-        self.datatype = scipy.complex64
+        self.datatype = numpy.complex64
         self.sizeof_data = self.datatype().nbytes    # number of bytes per sample in file
 
         self.axis_font_size = 16
@@ -83,17 +79,17 @@ class draw_constellation:
     def get_data(self):
         self.text_file_pos.set_text("File Position: %d" % (self.hfile.tell()//self.sizeof_data))
         try:
-            iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
+            iq = numpy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
         except MemoryError:
             print("End of File")
         else:
-            # retesting length here as newer version of scipy does not throw a MemoryError, just
+            # retesting length here as newer version of numpy does not throw a MemoryError, just
             # returns a zero-length array
             if(len(iq) > 0):
-                self.reals = scipy.array([r.real for r in iq])
-                self.imags = scipy.array([i.imag for i in iq])
+                self.reals = numpy.array([r.real for r in iq])
+                self.imags = numpy.array([i.imag for i in iq])
 
-                self.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.reals))])
+                self.time = numpy.array([i*(1/self.sample_rate) for i in range(len(self.reals))])
                 return True
             else:
                 print("End of File")
@@ -145,8 +141,8 @@ class draw_constellation:
         draw()
 
     def zoom(self, event):
-        newxlim = scipy.array(self.sp_iq.get_xlim())
-        curxlim = scipy.array(self.xlim)
+        newxlim = numpy.array(self.sp_iq.get_xlim())
+        curxlim = numpy.array(self.xlim)
         if(newxlim[0] != curxlim[0] or newxlim[1] != curxlim[1]):
             self.xlim = newxlim
             r = self.reals[int(ceil(self.xlim[0])) : int(ceil(self.xlim[1]))]
-- 
cgit v1.2.3