Beispiel #1
0
def plot(infile, outfile=None):
    yt = [None]*4
    for i in [1]:
        yt[i-1],t,_,_,_,_ = wfm2read_fast.wfm2read(infile)
        print "Read file: ", infile
    y = np.array(yt)
   
    return (t, y[0]) # , 'r')
Beispiel #2
0
def read_wfm(infolder, num_traces=100):
    print 'Reading WFMs from', infolder
    # Can add a check to see that we are not reading a file that is not
    # availabled
    for file_count in xrange(1,num_traces+1):
        fname = 'W%d.wfm' % file_count
        print 'Reading %s [%d/%d]' % (fname, file_count, num_traces)
        trace_data = wfm2read_fast.wfm2read(infolder+'/'+fname)[0] 
        trace_trimmed = trace_data[:]
        try:
            traces
        except NameError:
            traces = np.zeros((num_traces, len(trace_trimmed)))
        traces[file_count-1, :] = trace_trimmed
    # np.save(outfile, traces)
    # print 'Finished processing all WFMs. Output in',outfile
    return traces