summaryrefslogtreecommitdiff
path: root/gr-utils/src
diff options
context:
space:
mode:
authorJosh Blum2011-08-17 11:56:33 -0700
committerJosh Blum2011-08-17 11:56:33 -0700
commite6ed4fa7bb0d253adbf0cf2ae4da7c301b3c971f (patch)
tree09f43f64f581af7b5159debaf7489365b0a1259d /gr-utils/src
parent40a9071074b2ec0f6daf74e50e131b89b9f66226 (diff)
parented564be6c78a3e22b3c98862834192f8b20bc551 (diff)
downloadgnuradio-e6ed4fa7bb0d253adbf0cf2ae4da7c301b3c971f.tar.gz
gnuradio-e6ed4fa7bb0d253adbf0cf2ae4da7c301b3c971f.tar.bz2
gnuradio-e6ed4fa7bb0d253adbf0cf2ae4da7c301b3c971f.zip
Merge branch 'digital' of https://github.com/trondeau/gnuradio into digital
Conflicts: gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h gnuradio-core/src/lib/general/gr_pll_refout_cc.h gr-digital/lib/digital_constellation_receiver_cb.cc gr-digital/lib/digital_constellation_receiver_cb.h gr-digital/lib/digital_costas_loop_cc.h
Diffstat (limited to 'gr-utils/src')
-rwxr-xr-xgr-utils/src/python/gr_plot_const.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/gr-utils/src/python/gr_plot_const.py b/gr-utils/src/python/gr_plot_const.py
index 5dd08c9a0..0c52899b2 100755
--- a/gr-utils/src/python/gr_plot_const.py
+++ b/gr-utils/src/python/gr_plot_const.py
@@ -85,16 +85,23 @@ class draw_constellation:
except MemoryError:
print "End of File"
else:
- self.reals = scipy.array([r.real for r in iq])
- self.imags = scipy.array([i.imag for i in iq])
+ # retesting length here as newer version of scipy 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.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.reals))])
+ return Tr
+ else:
+ print "End of File"
+ return False
- self.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.reals))])
-
def make_plots(self):
# if specified on the command-line, set file pointer
self.hfile.seek(self.sizeof_data*self.start, 1)
- self.get_data()
+ r = self.get_data()
# Subplot for real and imaginary parts of signal
self.sp_iq = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.4, 0.6])
@@ -175,8 +182,9 @@ class draw_constellation:
self.step_forward()
def step_forward(self):
- self.get_data()
- self.update_plots()
+ r = self.get_data()
+ if(r):
+ self.update_plots()
def step_backward(self):
# Step back in file position
@@ -184,8 +192,9 @@ class draw_constellation:
self.hfile.seek(-2*self.sizeof_data*self.block_length, 1)
else:
self.hfile.seek(-self.hfile.tell(),1)
- self.get_data()
- self.update_plots()
+ r = self.get_data()
+ if(r):
+ self.update_plots()
def mouse_button_callback(self, event):