summaryrefslogtreecommitdiff
path: root/gr-utils/src/python/plot_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-utils/src/python/plot_data.py')
-rw-r--r--gr-utils/src/python/plot_data.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/gr-utils/src/python/plot_data.py b/gr-utils/src/python/plot_data.py
index 15012e589..242ca2a4b 100644
--- a/gr-utils/src/python/plot_data.py
+++ b/gr-utils/src/python/plot_data.py
@@ -1,23 +1,23 @@
#
# Copyright 2007,2008,2011 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
try:
import scipy
@@ -57,7 +57,7 @@ class plot_data:
self.fig = figure(1, figsize=(16, 9), facecolor='w')
rcParams['xtick.labelsize'] = self.axis_font_size
rcParams['ytick.labelsize'] = self.axis_font_size
-
+
self.text_file_pos = figtext(0.10, 0.88, "File Position: ", weight="heavy", size=self.text_size)
self.text_block = figtext(0.40, 0.88, ("Block Size: %d" % self.block_length),
weight="heavy", size=self.text_size)
@@ -78,7 +78,7 @@ class plot_data:
self.manager = get_current_fig_manager()
connect('key_press_event', self.click)
show()
-
+
def get_data(self, hfile):
self.text_file_pos.set_text("File Position: %d" % (hfile.tell()//self.sizeof_data))
try:
@@ -88,7 +88,7 @@ class plot_data:
else:
self.f = scipy.array(f)
self.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.f))])
-
+
def make_plots(self):
self.sp_f = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.875, 0.6])
self.sp_f.set_title(("Amplitude"), fontsize=self.title_font_size, fontweight="bold")
@@ -104,7 +104,7 @@ class plot_data:
hf.seek(self.sizeof_data*self.start, 1)
self.get_data(hf)
-
+
# Subplot for real and imaginary parts of signal
self.plot_f += plot(self.time, self.f, 'o-')
maxval = max(maxval, self.f.max())
@@ -126,16 +126,16 @@ class plot_data:
minval = min(minval, self.f.min())
self.sp_f.set_ylim([1.5*minval, 1.5*maxval])
-
+
draw()
-
+
def click(self, event):
forward_valid_keys = [" ", "down", "right"]
backward_valid_keys = ["up", "left"]
if(find(event.key, forward_valid_keys)):
self.step_forward()
-
+
elif(find(event.key, backward_valid_keys)):
self.step_backward()
@@ -156,7 +156,7 @@ class plot_data:
else:
hf.seek(-hf.tell(),1)
self.update_plots()
-
+
def find(item_in, list_search):
try: