def shortToyTwo(ds, newpath="/rg"): dat = ds.getData()[:,0] fs = ds.fs() start = ds.start() h = {'SampleType':'timeseries', 'SamplesPerSecond':fs, 'StartTime':start} k2 = array([0,0,0,0,-1,1,-1,1,0,0,0,0]) k1 = array([-1,1,-1,1,0,0,0,0,-1,1,-1,1]) g = cal._applyFilterWithTR(dat, k1) g = shift(g, 6) g = g - g.min() g = g/g.max() g2 = -1*sc.match(dat, k2) g2 = g2 - g2.min() g2 = g2/g2.max() g = g + 3*g2 ds.createSubData('/k', column_stack([k1, k2]), h, delete=True) ds.createSubData(newpath, g, h, delete=True)
def compoundToy(ds, klen = 200, newpath="/rg"): dat = ds.getData()[:,0] fs = ds.fs() start = ds.start() h = {'SampleType':'timeseries', 'SamplesPerSecond':fs, 'StartTime':start} x=arange(klen)/fs k2=sin( 2*pi*100*x) k1=sin( 2*pi*400*x) g = cal._applyFilterWithTR(dat, k1) g = shift(g, int(klen/2)) g = g - g.min() g = g/g.max() g2 = -1*sc.match(dat, k2) g2 = g2 - g2.min() g2 = g2/g2.max() g = g + g2 ds.createSubData('/k', column_stack([k1, k2]), h, delete=True) ds.createSubData(newpath, g, h, delete=True)