def doit(verbose = 0): print __doc__ a = np.array(data) r = mtanalyze(a - a.mean(), dt = dt, kind = 2, npi = 4, nwin = 10, padby = 0, doplot = 1, verbose = verbose, title = "Adaptive Multi-taper of Ocean Wave Data", ) return r
def doit(verbose = 0): print __doc__ fn = "chile.txt" sps = None with file(fn, "rb") as f: for l in f: if l.startswith(('!', '$')): continue c = l.find(":") if c < 0: break if l[:c] == "SPS": sps = float(l[(c+1):]) a = [float(l.strip())] for l in f: a.append(float(l.strip())) a = np.array(a) f.close() if verbose: print >> sys.stderr, "read in %d values at %e sps" % (len(a), sps) r = mtanalyze(a, dt = 1.0/sps, kind = 1, npi = 4, nwin = 7, padby = 32, nlines = 9, linedomain = [0.0015, 0.003], doplot = 1, title = "Free Oscillations of the Earth", verbose = verbose, ) return r