def coilpower(self, event): # wxGlade: MyFrame.<event_handler> print "Event handler `coilpower' " try: n = nearest(self.freq, 165) except AttributeError: print 'no power... running for you' self.pow,self.freq = functions.psd(self.datapdf) n = nearest(self.freq, 165) self.ch = channel.index(self.datapdf, 'meg') megcontour.display(self.pow[int(n[0]),:], self.ch.chanlocs)
def __init__(self, dataobj, time, startsec, stopsec): ##def cut(dataobj, time, startsec, stopsec): r = two2threeD(dataobj) print 'were using seconds here not ms' indstart = nearest(time, startsec) indstop = nearest(time, stopsec) cutdata = r[indstart:indstop,:,:] self.data = cutdata.reshape(size(cutdata,0)*size(cutdata,1),size(cutdata,2),order='F') self.time = time[indstart:indstop] self.avg = mean(self.data.reshape(self.time.size, size(self.data,0)/self.time.size, size(self.data,1)),1)
def cut(reshapemeg, time, startsec, stopsec): print 'were using seconds here not ms' indstart = nearest(time, startsec) indstop = nearest(time, endsec) cutdata = d.data_block[indstart:indstop,:] return cutdata