summaryrefslogtreecommitdiff
path: root/gr-utils/python/utils/gr_plot_const
diff options
context:
space:
mode:
authorMarcus Müller <marcus@hostalia.de>2018-08-25 01:23:10 +0200
committerMarcus Müller <marcus@hostalia.de>2018-11-02 22:15:53 +0100
commit65a3df1665a8286c82307828891577613a37d70a (patch)
tree510634e8f453a6cbf4f5287897ab7c09d5a7ef4c /gr-utils/python/utils/gr_plot_const
parent990de8eed1bf7d4d1a7e9e453b32906ca2860949 (diff)
remove completely unused scipy from gr-util plot apps
Diffstat (limited to 'gr-utils/python/utils/gr_plot_const')
-rwxr-xr-xgr-utils/python/utils/gr_plot_const22
1 files changed, 9 insertions, 13 deletions
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]))]