From 745b2b2d34cff22468ea9a4a785e82d3398dc4e6 Mon Sep 17 00:00:00 2001 From: Brennan Ashton <bashton@brennanashton.com> Date: Thu, 15 Nov 2018 16:27:44 -0800 Subject: gr-utils: Condense gr_plot commands and fix datatype arg This removes all the gr_plot_* applications save for: - gr_plot (time-domain) - gr_plot_fft (FFT domain) - gr_plot_psd (Power Spectrum Density) --- gr-utils/python/utils/plot_psd_base.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gr-utils/python/utils/plot_psd_base.py') diff --git a/gr-utils/python/utils/plot_psd_base.py b/gr-utils/python/utils/plot_psd_base.py index eb9a5a6431..8995a90a38 100644 --- a/gr-utils/python/utils/plot_psd_base.py +++ b/gr-utils/python/utils/plot_psd_base.py @@ -26,13 +26,15 @@ from __future__ import unicode_literals import numpy try: - from pylab import * + from pylab import Button, connect, draw, figure, figtext, get_current_fig_manager, mlab, show, rcParams, ceil except ImportError: print("Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)") raise SystemExit(1) from argparse import ArgumentParser from gnuradio.eng_arg import eng_float, intx +from gnuradio.plot_data import datatype_lookup + class plot_psd_base(object): def __init__(self, datatype, filename, options): @@ -45,7 +47,9 @@ class plot_psd_base(object): self.dospec = options.enable_spec # if we want to plot the spectrogram - self.datatype = numpy.complex64 + self.datatype = datatype + if self.datatype is None: + self.datatype = datatype_lookup[options.data_type] self.sizeof_data = self.datatype().nbytes # number of bytes per sample in file self.axis_font_size = 16 @@ -275,7 +279,7 @@ def main(): parser = plot_psd_base.setup_options() args = parser.parse_args() - dc = plot_psd_base(args.data_type, args.file, args) + plot_psd_base(None, args.file, args) if __name__ == "__main__": try: -- cgit v1.2.3