From 9880e7bb383054aa43681b52ebd33c8fd4cb8fcb Mon Sep 17 00:00:00 2001 From: jcorgan Date: Mon, 28 May 2007 17:04:09 +0000 Subject: Merged r5547:5542 from jcorgan/num into trunk. Converts from using Python Numeric to numpy. Trunk passes distcheck. gr-radio-astronomy still needs conversion. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5553 221aa14e-8319-0410-a670-987f0aec2ac5 --- gr-wxgui/src/python/scopesink.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gr-wxgui/src/python/scopesink.py') diff --git a/gr-wxgui/src/python/scopesink.py b/gr-wxgui/src/python/scopesink.py index 14df9b265..a7f76fecf 100755 --- a/gr-wxgui/src/python/scopesink.py +++ b/gr-wxgui/src/python/scopesink.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2003,2004,2006 Free Software Foundation, Inc. +# Copyright 2003,2004,2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -24,7 +24,7 @@ from gnuradio import gr, gru, eng_notation from gnuradio.wxgui import stdgui import wx import gnuradio.wxgui.plot as plot -import Numeric +import numpy import threading import struct @@ -215,7 +215,7 @@ class input_watcher (threading.Thread): start = ch * bytes_per_chan chan_data = s[start:start+bytes_per_chan] - rec = Numeric.fromstring (chan_data, Numeric.Float32) + rec = numpy.fromstring (chan_data, numpy.float32) records.append (rec) # print "nrecords = %d, reclen = %d" % (len (records),nsamples) @@ -485,7 +485,7 @@ class graph_window (plot.PlotCanvas): objects = [] Ts = 1.0 / (info.get_sample_rate () / info.get_decimation_rate ()) - x_vals = Ts * Numeric.arrayrange (-npoints/2, npoints/2) + x_vals = Ts * numpy.arange (-npoints/2, npoints/2) # preliminary clipping based on time axis here, instead of in graphics code time_per_window = self.info.get_time_per_div () * 10 @@ -503,7 +503,7 @@ class graph_window (plot.PlotCanvas): lb = npoints/2 - n/2 ub = npoints/2 + n/2 # points = zip (x_vals[lb:ub], r[lb:ub]) - points = Numeric.zeros ((ub-lb, 2), Numeric.Float64) + points = numpy.zeros ((ub-lb, 2), numpy.float64) points[:,0] = x_vals[lb:ub] points[:,1] = r[lb:ub] @@ -542,7 +542,7 @@ class graph_window (plot.PlotCanvas): objects = [] # points = zip (records[0], records[1]) - points = Numeric.zeros ((len(records[0]), 2), Numeric.Float32) + points = numpy.zeros ((len(records[0]), 2), numpy.float32) points[:,0] = records[0] points[:,1] = records[1] -- cgit