From d692a41f98e7b888c745efbb9fcbbb0400f39025 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 24 Nov 2010 17:29:11 -0800 Subject: Major Makefile.am housecleaning. Passes distcheck. Move all occurrences of swig_built_sources out of Makefile.am's. Move all SWIG related use of BUILT_SOURCES out of Makefile.am's. Clean up 'if PYTHON' conditionalization in gr-* Still left to do: fix Makefile.swig CLEANFILES and no_dist_files such that they remove exactly the generated files. --- gr-utils/src/python/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gr-utils/src') diff --git a/gr-utils/src/python/Makefile.am b/gr-utils/src/python/Makefile.am index 9c4e222c8..450032266 100644 --- a/gr-utils/src/python/Makefile.am +++ b/gr-utils/src/python/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common -EXTRA_DIST = \ +EXTRA_DIST += \ $(bin_SCRIPTS) \ README.plot \ pyqt_plot.ui \ -- cgit From 91ca107edc1e4cad69f102d947471d2c0adfc354 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Thu, 30 Dec 2010 17:12:26 -0500 Subject: Fixes to psd plotting tool. Trying to keep up with the changing API; this should be backwards compatible. --- gr-utils/src/python/gr_plot_psd.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'gr-utils/src') diff --git a/gr-utils/src/python/gr_plot_psd.py b/gr-utils/src/python/gr_plot_psd.py index f3535d321..e3ecabd6a 100755 --- a/gr-utils/src/python/gr_plot_psd.py +++ b/gr-utils/src/python/gr_plot_psd.py @@ -87,13 +87,13 @@ 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) - 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 - self.time = [tstep*(self.position + i) for i in xrange(len(self.iq))] + self.time = scipy.array([tstep*(self.position + i) for i in xrange(len(self.iq))]) self.iq_psd, self.freq = self.dopsd(self.iq) @@ -153,14 +153,14 @@ class gr_plot_psd: imags = self.iq.imag self.plot_iq[0].set_data([self.time, reals]) self.plot_iq[1].set_data([self.time, imags]) - self.sp_iq.set_xlim(min(self.time), max(self.time)) - self.sp_iq.set_ylim([1.5*min([min(reals), min(imags)]), - 1.5*max([max(reals), max(imags)])]) + self.sp_iq.set_xlim(self.time.min(), self.time.max()) + self.sp_iq.set_ylim([1.5*min([reals.min(), imags.min()]), + 1.5*max([reals.max(), imags.max()])]) def draw_psd(self): self.plot_psd[0].set_data([self.freq, self.iq_psd]) - self.sp_psd.set_ylim([min(self.iq_psd)-10, max(self.iq_psd)+10]) - self.sp_psd.set_xlim([min(self.freq), max(self.freq)]) + self.sp_psd.set_ylim([self.iq_psd.min()-10, self.iq_psd.max()+10]) + self.sp_psd.set_xlim([self.freq.min(), self.freq.max()]) def draw_spec(self): overlap = self.specfftsize/4 @@ -168,7 +168,7 @@ class gr_plot_psd: self.sp_spec.clear() self.sp_spec.specgram(self.iq, self.specfftsize, self.sample_rate, window = lambda d: d*winfunc(self.specfftsize), - noverlap = overlap, xextent=[min(self.time), max(self.time)]) + noverlap = overlap, xextent=[self.time.min(), self.time.max()]) def update_plots(self): self.draw_time() @@ -188,14 +188,14 @@ class gr_plot_psd: xmin = max(0, int(ceil(self.sample_rate*(self.xlim[0] - self.position)))) xmax = min(int(ceil(self.sample_rate*(self.xlim[1] - self.position))), len(self.iq)) - iq = self.iq[xmin : xmax] - time = self.time[xmin : xmax] + iq = scipy.array(self.iq[xmin : xmax]) + time = scipy.array(self.time[xmin : xmax]) iq_psd, freq = self.dopsd(iq) self.plot_psd[0].set_data(freq, iq_psd) - self.sp_psd.axis([min(freq), max(freq), - min(iq_psd)-10, max(iq_psd)+10]) + self.sp_psd.axis([freq.min(), freq.max(), + iq_psd.min()-10, iq_psd.max()+10]) draw() -- cgit