diff options
author | Marcus Müller <marcus@hostalia.de> | 2018-08-25 01:23:10 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-11-02 22:15:53 +0100 |
commit | 65a3df1665a8286c82307828891577613a37d70a (patch) | |
tree | 510634e8f453a6cbf4f5287897ab7c09d5a7ef4c /gr-utils/python/utils/gr_plot_qt | |
parent | 990de8eed1bf7d4d1a7e9e453b32906ca2860949 (diff) |
remove completely unused scipy from gr-util plot apps
Diffstat (limited to 'gr-utils/python/utils/gr_plot_qt')
-rwxr-xr-x | gr-utils/python/utils/gr_plot_qt | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/gr-utils/python/utils/gr_plot_qt b/gr-utils/python/utils/gr_plot_qt index 854ecc53b8..6a23e2b7af 100755 --- a/gr-utils/python/utils/gr_plot_qt +++ b/gr-utils/python/utils/gr_plot_qt @@ -1,11 +1,5 @@ #!/usr/bin/env python - -try: - import scipy - from scipy import fftpack -except ImportError: - print("Please install SciPy to run this script (http://www.scipy.org/)") - raise SystemExit(1) +import numpy try: from matplotlib import mlab @@ -42,7 +36,7 @@ class SpectrogramData(Qwt.QwtRasterData): def __init__(self, f, t): Qwt.QwtArrayData.__init__(self, Qt.QRectF(0, 0, 0, 0)) - self.sp = scipy.array([[0], [0]]) + self.sp = numpy.array([[0], [0]]) def set_data(self, xfreq, ytime, data): self.sp = data @@ -84,9 +78,9 @@ class gr_plot_qt(QtGui.QMainWindow): self.sample_rate = options.sample_rate self.psdfftsize = options.psd_size self.specfftsize = options.spec_size - self.winfunc = scipy.blackman + self.winfunc = numpy.blackman self.sizeof_data = 8 - self.datatype = scipy.complex64 + self.datatype = numpy.complex64 self.pen_width = 1 self.iq = list() self.time = list() @@ -328,7 +322,7 @@ class gr_plot_qt(QtGui.QMainWindow): self.hfile.seek(start*self.sizeof_data, os.SEEK_SET) self.position = start try: - iq = scipy.fromfile(self.hfile, dtype=self.datatype, + iq = numpy.fromfile(self.hfile, dtype=self.datatype, count=end-start) if(len(iq) < (end-start)): @@ -355,7 +349,7 @@ class gr_plot_qt(QtGui.QMainWindow): window=winpoints, scale_by_freq=False) - self.iq_psd = 10.0*scipy.log10(abs(fftpack.fftshift(iq_psd))) + self.iq_psd = 10.0*numpy.log10(abs(numpy.fft.fftshift(iq_psd))) self.freq = freq - self.sample_rate/2.0 def get_specgram(self): @@ -366,7 +360,7 @@ class gr_plot_qt(QtGui.QMainWindow): window=winpoints, scale_by_freq=False) - self.iq_spec = 10.0*scipy.log10(abs(iq_spec)) + self.iq_spec = 10.0*numpy.log10(abs(iq_spec)) self.spec_f = f self.spec_t = t |