projects
/
debian
/
gnuradio
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9d306b2
)
Fix how the end of a file is handled.
author
Tom Rondeau
<trondeau@vt.edu>
Sat, 15 Jan 2011 22:15:11 +0000
(17:15 -0500)
committer
Tom Rondeau
<trondeau@vt.edu>
Sat, 15 Jan 2011 22:15:11 +0000
(17:15 -0500)
gr-utils/src/python/gr_plot_psd.py
patch
|
blob
|
history
diff --git
a/gr-utils/src/python/gr_plot_psd.py
b/gr-utils/src/python/gr_plot_psd.py
index 0e3dbecd944f583d126364d76f215f244063d57d..b386d35ab21527ec37e3f9f2a9779e16675c9daf 100755
(executable)
--- a/
gr-utils/src/python/gr_plot_psd.py
+++ b/
gr-utils/src/python/gr_plot_psd.py
@@
-60,8
+60,10
@@
class gr_plot_psd:
rcParams['xtick.labelsize'] = self.axis_font_size
rcParams['ytick.labelsize'] = self.axis_font_size
rcParams['xtick.labelsize'] = self.axis_font_size
rcParams['ytick.labelsize'] = self.axis_font_size
- self.text_file = figtext(0.10, 0.95, ("File: %s" % filename), weight="heavy", size=self.text_size)
- self.text_file_pos = figtext(0.10, 0.92, "File Position: ", weight="heavy", size=self.text_size)
+ self.text_file = figtext(0.10, 0.95, ("File: %s" % filename),
+ weight="heavy", size=self.text_size)
+ self.text_file_pos = figtext(0.10, 0.92, "File Position: ",
+ weight="heavy", size=self.text_size)
self.text_block = figtext(0.35, 0.92, ("Block Size: %d" % self.block_length),
weight="heavy", size=self.text_size)
self.text_sr = figtext(0.60, 0.915, ("Sample Rate: %.2f" % self.sample_rate),
self.text_block = figtext(0.35, 0.92, ("Block Size: %d" % self.block_length),
weight="heavy", size=self.text_size)
self.text_sr = figtext(0.60, 0.915, ("Sample Rate: %.2f" % self.sample_rate),
@@
-86,9
+88,9
@@
class gr_plot_psd:
def get_data(self):
self.position = self.hfile.tell()/self.sizeof_data
self.text_file_pos.set_text("File Position: %d" % self.position)
def get_data(self):
self.position = self.hfile.tell()/self.sizeof_data
self.text_file_pos.set_text("File Position: %d" % self.position)
- self.iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length)
-
#print "Read in %d items" % len(self.iq
)
-
if(len(self.iq) == 0)
:
+ try:
+
self.iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length
)
+
except MemoryError
:
print "End of File"
else:
tstep = 1.0 / self.sample_rate
print "End of File"
else:
tstep = 1.0 / self.sample_rate