diff options
author | Brennan Ashton <bashton@brennanashton.com> | 2018-11-15 16:27:44 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-11-22 11:09:00 -0800 |
commit | 745b2b2d34cff22468ea9a4a785e82d3398dc4e6 (patch) | |
tree | ab34aaca154581a37c9d50c636a69cd10a6d7cf1 /gr-utils/python/utils/plot_fft_base.py | |
parent | 2e8f3ad85e13045fcaf81368fb9372735c503e68 (diff) |
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)
Diffstat (limited to 'gr-utils/python/utils/plot_fft_base.py')
-rw-r--r-- | gr-utils/python/utils/plot_fft_base.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gr-utils/python/utils/plot_fft_base.py b/gr-utils/python/utils/plot_fft_base.py index 1b6eb72910..56037e5330 100644 --- a/gr-utils/python/utils/plot_fft_base.py +++ b/gr-utils/python/utils/plot_fft_base.py @@ -28,12 +28,14 @@ import numpy from numpy.fft import fftpack try: - from pylab import * + from pylab import Button, connect, draw, figure, figtext, get_current_fig_manager, show, rcParams, ceil except ImportError: print("Please install Python Matplotlib (http://matplotlib.sourceforge.net/) and Python TkInter https://wiki.python.org/moin/TkInter to run this script") raise SystemExit(1) from argparse import ArgumentParser +from gnuradio.plot_data import datatype_lookup + class plot_fft_base(object): def __init__(self, datatype, filename, options): @@ -42,7 +44,9 @@ class plot_fft_base(object): self.start = options.start self.sample_rate = options.sample_rate - 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 @@ -236,7 +240,7 @@ def main(): parser = plot_fft_base.setup_options() args = parser.parse_args() - dc = plot_fft_base(args.data_type, args.file, args) + plot_fft_base(None, args.file, args) if __name__ == "__main__": try: |