From: Paul Brossier Date: Fri, 25 Sep 2009 23:09:50 +0000 (+0200) Subject: python/aubio/task/onset.py: use numarray, not numpy (debian #478438) X-Git-Tag: bzr2git~289 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fcacd8893784a2e7d41a615be168b4f186d87368;p=aubio.git python/aubio/task/onset.py: use numarray, not numpy (debian #478438) --- diff --git a/python/aubio/task/onset.py b/python/aubio/task/onset.py index 20a1282e..8466e2d5 100644 --- a/python/aubio/task/onset.py +++ b/python/aubio/task/onset.py @@ -92,7 +92,7 @@ class taskonset(task): import Gnuplot, Gnuplot.funcutils import aubio.txtfile import os.path - import numarray + from numpy import arange, array, ones from aubio.onsetcompare import onset_roc x1,y1,y1p = [],[],[] @@ -102,7 +102,7 @@ class taskonset(task): self.lenofunc = len(ofunc) self.maxofunc = max(ofunc) # onset detection function - downtime = numarray.arange(len(ofunc))*self.params.step + downtime = arange(len(ofunc))*self.params.step oplot.append(Gnuplot.Data(downtime,ofunc,with='lines',title=self.params.onsetmode)) # detected onsets @@ -111,8 +111,8 @@ class taskonset(task): x1.append(i[0]*self.params.step) y1.append(self.maxofunc) y1p.append(-self.maxofunc) - #x1 = numarray.array(onsets)*self.params.step - #y1 = self.maxofunc*numarray.ones(len(onsets)) + #x1 = array(onsets)*self.params.step + #y1 = self.maxofunc*ones(len(onsets)) if x1: oplot.append(Gnuplot.Data(x1,y1,with='impulses')) wplot.append(Gnuplot.Data(x1,y1p,with='impulses')) @@ -126,8 +126,8 @@ class taskonset(task): self.title = "" #"(no ground truth)" else: t_onsets = aubio.txtfile.read_datafile(datafile) - x2 = numarray.array(t_onsets).resize(len(t_onsets)) - y2 = self.maxofunc*numarray.ones(len(t_onsets)) + x2 = array(t_onsets).resize(len(t_onsets)) + y2 = self.maxofunc*ones(len(t_onsets)) wplot.append(Gnuplot.Data(x2,y2,with='impulses')) tol = 0.050