diff options
author | mleech | 2007-08-13 23:35:59 +0000 |
---|---|---|
committer | mleech | 2007-08-13 23:35:59 +0000 |
commit | 6a341feb050f97b258594a968403ee4e65f44455 (patch) | |
tree | d614786090f0d1a6769fe30f2a64f69717ed586d /gr-radio-astronomy/src | |
parent | 36050b7e616c22defbf4b4841f1d2cc7e4b837cf (diff) | |
download | gnuradio-6a341feb050f97b258594a968403ee4e65f44455.tar.gz gnuradio-6a341feb050f97b258594a968403ee4e65f44455.tar.bz2 gnuradio-6a341feb050f97b258594a968403ee4e65f44455.zip |
Changed to use numpy instead of Numeric
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6134 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-radio-astronomy/src')
-rwxr-xr-x | gr-radio-astronomy/src/python/ra_fftsink.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gr-radio-astronomy/src/python/ra_fftsink.py b/gr-radio-astronomy/src/python/ra_fftsink.py index 9c900158b..f65486418 100755 --- a/gr-radio-astronomy/src/python/ra_fftsink.py +++ b/gr-radio-astronomy/src/python/ra_fftsink.py @@ -24,7 +24,7 @@ from gnuradio import gr, gru, window from gnuradio.wxgui import stdgui import wx import gnuradio.wxgui.plot as plot -import Numeric +import numpy import threading import math import random @@ -200,7 +200,7 @@ class input_watcher (threading.Thread): start = itemsize * (nitems - 1) s = s[start:start+itemsize] - complex_data = Numeric.fromstring (s, Numeric.Float32) + complex_data = numpy.fromstring (s, numpy.float32) de = DataEvent (complex_data) wx.PostEvent (self.event_receiver, de) del de @@ -252,7 +252,7 @@ class fft_window (plot.PlotCanvas): if self.peak_vals is None: self.peak_vals = dB else: - self.peak_vals = Numeric.maximum(dB, self.peak_vals) + self.peak_vals = numpy.maximum(dB, self.peak_vals) dB = self.peak_vals x = max(abs(self.ra_fftsink.sample_rate), abs(self.ra_fftsink.baseband_freq)) @@ -270,20 +270,20 @@ class fft_window (plot.PlotCanvas): units = "Hz" if self.ra_fftsink.input_is_real: # only plot 1/2 the points - x_vals = ((Numeric.arrayrange (L/2) + x_vals = ((numpy.arange (L/2) * (self.ra_fftsink.sample_rate * sf / L)) + self.ra_fftsink.baseband_freq * sf) - points = Numeric.zeros((len(x_vals), 2), Numeric.Float64) + points = numpy.zeros((len(x_vals), 2), numpy.float64) points[:,0] = x_vals points[:,1] = dB[0:L/2] else: # the "negative freqs" are in the second half of the array - x_vals = ((Numeric.arrayrange (-L/2, L/2) + x_vals = ((numpy.arange(-L/2, L/2) * (self.ra_fftsink.sample_rate * sf / L)) + self.ra_fftsink.baseband_freq * sf) - points = Numeric.zeros((len(x_vals), 2), Numeric.Float64) + points = numpy.zeros((len(x_vals), 2), numpy.float64) points[:,0] = x_vals - points[:,1] = Numeric.concatenate ((dB[L/2:], dB[0:L/2])) + points[:,1] = numpy.concatenate ((dB[L/2:], dB[0:L/2])) lines = plot.PolyLine (points, colour='BLUE') graphics = plot.PlotGraphics ([lines], |