Exemplo n.º 1
0
def plotdeltaphase(fname, k):
    d = genplotlib.gendict_phase(fname, 'deltaphase')
    print(d)

    plt.figure()
    genplotlib.plot_phaseplot(d, k, 'no', 'Phase')
    plt.savefig('deltaphase_r1')
Exemplo n.º 2
0
def plotdeltaphase(fname, k):
    d = genplotlib.gendict_phase(fname, 'deltaphase')
    print(d)
    
    plt.figure()
    genplotlib.plot_phaseplot(d, k, 'no', 'Phase')
    plt.savefig('deltaphase_r1')
Exemplo n.º 3
0
def plotdeltatime(fname, k):
    d = genplotlib.gendict_phase(fname, 'deltatime')
    md = genplotlib.genlist(d)

    n = []
    for i, v in d.iteritems():
        n.append(max(v))
    print(n)

    plt.figure()
    genplotlib.plotdata(d,
                        md,
                        k,
                        's',
                        'Delay (seconds)',
                        'Time delay',
                        ymin=0.05,
                        ylim=(max(n) + 0.1 * max(n)))
    plt.savefig('deltatime_summ')

    plt.figure()
    genplotlib.plotdata(d,
                        md,
                        k,
                        'b',
                        'Delay (seconds)',
                        'Time delay',
                        ymin=0.05,
                        ylim=(max(n) + 0.1 * max(n)))
    plt.savefig('deltatime_summ_bar')
Exemplo n.º 4
0
def plotdeltaframe(fname, k):
    d = genplotlib.gendict_phase(fname, 'deltaframe')
    md = genplotlib.genlist(d)

    n = []
    for i, v in d.iteritems():
        n.append(max(v))
    print(n)

    plt.figure()
    genplotlib.plotdata(d,
                        md,
                        k,
                        's',
                        'Delay (frames)',
                        'Frame delay',
                        ymin=0,
                        ylim=max(n) + 5)
    plt.savefig('deltaframe_summ')

    plt.figure()
    genplotlib.plotdata(d,
                        md,
                        k,
                        'b',
                        'Delay (frames)',
                        'Frame delay',
                        ymin=0,
                        ylim=max(n) + 5)
    plt.savefig('deltaframe_summ_bar')
Exemplo n.º 5
0
def plotphaselen(fname, K):
    """Plots and saves the phase vs. length of phase vector; run from the 'summary' folder."""

    d = genplotlib.gendict_phase(fname, 'dp_freq')

    plt.figure()
    ad = genavgphaselendict(d)
    print(ad)
    genplotlib.plot_phaseplot_l(ad, K, 'no', 'Average phase', withn='no')
    aname = 'deltaphasevsphaselen_avg'
    plt.savefig(aname)
Exemplo n.º 6
0
def plotphaselen(fname, K):
    """Plots and saves the phase vs. length of phase vector; run from the 'summary' folder."""
    
    d = genplotlib.gendict_phase(fname, 'dp_freq')
    
    
    plt.figure()
    ad = genavgphaselendict(d)
    print(ad)
    genplotlib.plot_phaseplot_l(ad, K, 'no', 'Average phase', withn='no')
    aname = 'deltaphasevsphaselen_avg'
    plt.savefig(aname)
Exemplo n.º 7
0
def plotphasenlpersec(fname, K):
    """Plots and saves the phase vs. nlpersec plots; run from the 'summary' folder."""
    
    d = genplotlib.gendict_phase(fname, 'dp_freq')
    
    plt.figure()
    genplotlib.plot_phaseplot_lpf(d, K, 'no', 'Phase vs. volume drunk')
    pname = 'deltaphasevsvol'
    plt.savefig(pname)
    
    plt.figure()
    ad = genavgphasefreqdict(d)
    print(ad)
    genplotlib.plot_phaseplot_lpf(ad, K, 'no', 'Average phase vs. average volume', withn='no')
    aname = 'deltaphasevsfreq_avg'
    plt.savefig(aname)
Exemplo n.º 8
0
def plotdeltaframe(fname, k):
    d = genplotlib.gendict_phase(fname, 'deltaframe')
    md = genplotlib.genlist(d)
    
    n = []
    for i, v in d.iteritems():
        n.append(max(v))
    print(n)
    
    plt.figure()
    genplotlib.plotdata(d, md, k, 's', 'Delay (frames)', 'Frame delay', ymin=0, ylim=max(n)+5)
    plt.savefig('deltaframe_summ')
    
    plt.figure()
    genplotlib.plotdata(d, md, k, 'b', 'Delay (frames)', 'Frame delay', ymin=0, ylim=max(n)+5)
    plt.savefig('deltaframe_summ_bar')
Exemplo n.º 9
0
def plotdeltatime(fname, k):
    d = genplotlib.gendict_phase(fname, 'deltatime')
    md = genplotlib.genlist(d)
    
    n = []
    for i, v in d.iteritems():
        n.append(max(v))
    print(n)
    
    plt.figure()
    genplotlib.plotdata(d, md, k, 's', 'Delay (seconds)', 'Time delay', ymin=0.05, 
            ylim=(max(n)+0.1*max(n)))
    plt.savefig('deltatime_summ')
    
    plt.figure()
    genplotlib.plotdata(d, md, k, 'b', 'Delay (seconds)', 'Time delay', ymin=0.05, 
            ylim=(max(n)+0.1*max(n)))
    plt.savefig('deltatime_summ_bar')
Exemplo n.º 10
0
def plotphasenlpersec(fname, K):
    """Plots and saves the phase vs. nlpersec plots; run from the 'summary' folder."""

    d = genplotlib.gendict_phase(fname, 'dp_freq')

    plt.figure()
    genplotlib.plot_phaseplot_lpf(d, K, 'no', 'Phase vs. volume drunk')
    pname = 'deltaphasevsvol'
    plt.savefig(pname)

    plt.figure()
    ad = genavgphasefreqdict(d)
    print(ad)
    genplotlib.plot_phaseplot_lpf(ad,
                                  K,
                                  'no',
                                  'Average phase vs. average volume',
                                  withn='no')
    aname = 'deltaphasevsfreq_avg'
    plt.savefig(aname)
Exemplo n.º 11
0
    """Plots bar graph from data in 'peakf.txt' and saves it in the summary directory. Run from a 
    data/ or summary/ folder."""

    dictmeans = genplotlib.genlist(dictdata)
    n = []
    for i, v in dictdata.iteritems():
        n.append(max(v))

    plt.figure()
    genplotlib.plotdata(d,
                        md,
                        k,
                        'b',
                        'Delay (seconds)',
                        'Time delay',
                        ymin=0.05,
                        ylim=(max(n)))
    plt.savefig(plotname)


print(os.path.abspath(os.getcwd()))
k = load_keys(keyfile)
d = genplotlib.gendict_phase(fname, 'deltatime')
print(d)
md = genplotlib.genlist(d)
print(md)

writemeans(md, meansfname)

plotbar(d, k, plotname)
Exemplo n.º 12
0
def writemeans_deltatime(fnameread, fnamewrite):
    
    d = gpl.gendict_phase(fnameread, 'deltatime')
    md = gpl.genlist(d)
    
    writemeans(md, fnamewrite)
Exemplo n.º 13
0
fname = sys.argv[1]
keyfile = sys.argv[2]
plotname = sys.argv[3]
meansfname = sys.argv[4]


def plotbar(dictdata, keylist, plotname, fdir='.', ylim=10):
    """Plots bar graph from data in 'peakf.txt' and saves it in the summary directory. Run from a 
    data/ or summary/ folder."""
    
    dictmeans = genplotlib.genlist(dictdata)
    n = []
    for i, v in dictdata.iteritems():
        n.append(max(v))
    
    plt.figure()
    genplotlib.plotdata(d, md, k, 'b', 'Delay (seconds)', 'Time delay', ymin=0.05, ylim=(max(n)))
    plt.savefig(plotname)

print(os.path.abspath(os.getcwd()))
k = load_keys(keyfile)
d = genplotlib.gendict_phase(fname, 'deltatime')
print(d)
md = genplotlib.genlist(d)
print(md)

writemeans(md, meansfname)

plotbar(d, k, plotname)

Exemplo n.º 14
0
def writemeans_deltatime(fnameread, fnamewrite):

    d = gpl.gendict_phase(fnameread, 'deltatime')
    md = gpl.genlist(d)

    writemeans(md, fnamewrite)