def up_and_down(file1, file2):
    data1 = dataframes.DataStore(file1)
    data2 = dataframes.DataStore(file2)
    duty1, order1 = duty_order(data1)
    duty2, order2 = duty_order(data2)
    plotter = plotting.Plotter()
    plotter.add_plot(duty1, order1, label='up')
    plotter.add_plot(duty2, order2, label='down')
    plotter.configure_legend()
    plotter.show_figure()
def order_histogram(file, frames):
    data = dataframes.DataStore(file)
    plotter = plotting.Plotter()
    for f in frames:
        order = data.get_info(f, ['real order'])
        n, bins = np.histogram(order, np.linspace(0, 1, 100))
        bins = bins[:-1] + (bins[1] - bins[0]) / 2
        plotter.add_plot(bins, n, label=str(f))
    plotter.configure_xaxis(0, 'Order parameter')
    plotter.configure_yaxis(0, 'Frequency')
    plotter.configure_legend(0, title='Frame')
    plotter.show_figure()
示例#3
0
def histogram(file, duty):
    data = dataframes.DataStore(file)
    print(data.frame_data.head())
    df = data.frame_data.merge(data.df.drop('frame', 1).reset_index()).set_index('Duty')

    p = plotting.Plotter()
    for d in duty:
        orders = df.loc[d, 'real order']
        n, bins = np.histogram(orders, bins=100, density=True)
        p.add_plot(bins[:-1]+(bins[1]-bins[0])/2, n*(bins[1]-bins[0]), label=d)
    p.configure_legend()
    p.configure_xaxis(xlabel='Order Parameter')
    p.configure_yaxis(ylabel='Relative Frequency')
def frame_order(file):
    data = dataframes.DataStore(file)
    print(data.num_frames)
    plotter = plotting.Plotter()
    # duty_cycle = data.frame_data.Duty
    # frames = data.frame_data.Duty
    # order = data.frame_data['mean order']
    # plotter.add_plot(frames, order, fmt='x')
    # plotter.show_figure()
    fdata = data.frame_data
    fdata = fdata.groupby('Duty').mean()
    plotter.add_plot(fdata.index.values, fdata['mean order'].values)
    plotter.show_figure()
示例#5
0
def run(files):
    plotter = plotting.Plotter(subplot=(3, 2))
    duties = list(range(400, 1050, 50))
    for i, file in enumerate(files):
        print(i)
        with dataframes.DataStore(file) as data:
            df1, df2 = split_df(data.df)
            plotter = order_histograms(df1, duties, plotter, i)
            plotter.configure_legend(i)
            plotter.configure_xaxis(i, 'Order')
            plotter.configure_yaxis(i, 'Density')
            plotter.configure_subplot_title(i, file)
    plotter.show_figure()
示例#6
0
    for i in range(np.shape(crack_width)[0]-1):
        index = np.max(np.where(crack_width[i,:] > 1))
        tip_pos[i]=index
        rad_tip[i]=np.max(np.sum(crack_width[:,index-50:index]))



    time = (1/fps)*np.arange(0,np.size(tip_pos))
    tip_pos = scale*tip_pos
    rad_tip = scale * rad_tip/2

    np.savetxt(filename[:-4] + '_tiptraj.txt',np.c_[time,tip_pos])



    p2 = p.Plotter(subplot=(3,1))
    #1st subplot is tip trajectory
    p2.add_plot(time, tip_pos, marker='r-',subplot=0)
    p2.configure_xaxis(xlabel='time (s)',subplot=0)
    p2.configure_yaxis(ylabel='xpos (microns)', subplot=0,fontsize=14)

    #2nd subplot is the final width profile of crack indicating where width measurements are being taken
    p2.add_plot(range(0,np.shape(crack_width)[1]),crack_width[np.shape(crack_width)[0]-10,:],marker='b-',subplot=1)
    #Show position of width measurement on this profile
    p2.configure_yaxis(ylabel='width',subplot=1,fontsize=14)
    p2.configure_yaxis(ylabel='Crack width (microns)', subplot=2,fontsize=14)
    p2.configure_xaxis(xlim=(tip_pos[0],None),subplot=1)
    add_position(p2, filename, crack_width, time, 929, 'g')
    add_position(p2, filename, crack_width, time, 1073, 'y')
    add_position(p2, filename, crack_width, time, 1241, 'k')
    add_position(p2, filename, crack_width, time, 1400, 'r')