diff options
author | trondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-01-30 11:36:39 +0000 |
---|---|---|
committer | trondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-01-30 11:36:39 +0000 |
commit | f52a5932f178e474b625e86fb85c1c8954334398 (patch) | |
tree | d3b6ff2fb68c38823e6aed5d07a231d6ba288c11 /gnuradio-core/src/utils/gr_plot_const.py | |
parent | d25106c30ba0b169148ddaf98bb30dfd38012e03 (diff) |
Updating and cleaning up plotting code. When plotting char/int/short/float you can now specify multiple input files on the command line and each are plotted in a different color. Useful when comparing two outputs.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7528 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/utils/gr_plot_const.py')
-rwxr-xr-x | gnuradio-core/src/utils/gr_plot_const.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gnuradio-core/src/utils/gr_plot_const.py b/gnuradio-core/src/utils/gr_plot_const.py index bbcbb85cc2..9ec75ddb9a 100755 --- a/gnuradio-core/src/utils/gr_plot_const.py +++ b/gnuradio-core/src/utils/gr_plot_const.py @@ -35,6 +35,9 @@ class draw_constellation: self.start = options.start self.sample_rate = options.sample_rate + self.datatype = scipy.complex64 + self.sizeof_data = self.datatype().nbytes # number of bytes per sample in file + self.axis_font_size = 16 self.label_font_size = 18 self.title_font_size = 20 @@ -68,8 +71,8 @@ class draw_constellation: show() def get_data(self): - self.text_file_pos.set_text("File Position: %d" % (self.hfile.tell()//8)) - iq = scipy.fromfile(self.hfile, dtype=scipy.complex64, count=self.block_length) + self.text_file_pos.set_text("File Position: %d" % (self.hfile.tell()//self.sizeof_data)) + iq = scipy.fromfile(self.hfile, dtype=self.datatype, count=self.block_length) #print "Read in %d items" % len(iq) if(len(iq) == 0): print "End of File" @@ -81,7 +84,7 @@ class draw_constellation: def make_plots(self): # if specified on the command-line, set file pointer - self.hfile.seek(16*self.start, 1) + self.hfile.seek(self.sizeof_data*self.start, 1) self.get_data() @@ -150,8 +153,8 @@ class draw_constellation: def step_backward(self): # Step back in file position - if(self.hfile.tell() >= 16*self.block_length ): - self.hfile.seek(-16*self.block_length, 1) + if(self.hfile.tell() >= 2*self.sizeof_data*self.block_length ): + self.hfile.seek(-2*self.sizeof_data*self.block_length, 1) else: self.hfile.seek(-self.hfile.tell(),1) self.get_data() |