Exemplo n.º 1
0
def getTimeinCenterMulti(datasets, windowSize= None, tRange=None, stateRange=None):
    durations = []
    if tRange is not None: 
        endWindow = tRange[-1] 
    else: 
        for i in range(len(datasets)):
            tracking = datasets[i]['warpedTracking']
            if stateRange is not None: 
                _,et,_,_ = aba.state_to_time(datasets[i], stateRange[1])
                durations.append(et-tracking[0,0])
            else: 
                durations.append(datasets[i]['warpedTracking'][-1,0]-datasets[i]['warpedTracking'][0,0])
        endWindow = np.min(durations)

    windowsize = 30
    if windowSize is not None: 
        windowsize = windowSize
 
    ticks = np.arange(0,endWindow, windowsize)
    eTimeinCenter = np.zeros((len(datasets),len(ticks)-1))
    for i in range(len(ticks)-1):
        startT = ticks[i]
        endT = ticks[i+1]
        for d in range(len(datasets)):
            eTimeinCenter[d,i] = aba.getPercentTimeinCenter(datasets[d], tRange=[startT, endT])
    
    return eTimeinCenter
def plot_data(datasets, datanames, plotTraces=False, startVel = 0.0):

    #initialize arrays and timing
    e_first_startshock = []
    e_first_endshock = []
    e_first_end = []
    mean_line = []
    trace_data =[]
    sm = 15
    endWinLen = 5*60 #amount of tracking at end

    for i in range(0,len(datasets)):
        ndx =[]
        vel = aba.getMedianVelMulti(datasets[i], tRange=[0, 900], smoothWinLen = sm)
        for pos,sv in enumerate(vel):
            if sv<startVel:
                print "you lost a fish with starting velocity lower than {} in {}".format(startVel, datanames[i])
                ndx.append(pos)
        startshock = aba.getMedianVelMulti(datasets[i], tRange=[0, 900], smoothWinLen = sm)
        endshock = aba.getMedianVelMulti(datasets[i], tRange=[50*60, 55*60], smoothWinLen = sm)
        end = aba.getMedianVelMulti(datasets[i], tRange=[-15*60, -0], smoothWinLen = sm)
        startshock=np.delete(startshock, ndx)
        endshock=np.delete(endshock, ndx)
        end=np.delete(end, ndx)
        e_first_startshock.append(startshock)
        e_first_endshock.append(endshock)
        e_first_end.append(end)
            
        #for i in range(len(datasets)): 
        mean_line.append(np.transpose(np.hstack((np.mean(e_first_startshock[i]), np.mean(e_first_endshock[i]), np.mean(e_first_end[i])))))
        if plotTraces:
            trace_data.append(np.vstack((e_first_startshock[i],e_first_endshock[i], e_first_end[i])))
    print e_first_startshock, e_first_endshock, e_first_end

#plot all the data together
    subx = len(datasets)/2
    suby = 1
    
    pylab.figure()

    for i in range(len(datasets)):
        ax=pylab.subplot(1,len(datasets),i+1)
        if plotTraces:
            print "plotting all fish traces"
            pylab.plot(trace_data[i],'grey')
        #yerr = (2*scipy.stats.sem(e_first_startshock[i]), 2*scipy.stats.sem(e_first_endshock[i]), 2*scipy.stats.sem(e_first_end[i]))
        pylab.plot([0,1,2],[np.mean(e_first_startshock[i]), np.mean(e_first_endshock[i]), np.mean(e_first_end[i])], lw=3, label=datanames[i])
       # pylab.errorbar([0,1,2],[np.mean(e_first_startshock[i]), np.mean(e_first_endshock[i]), np.mean(e_first_end[i])], yerr = yerr, lw=3)
        ax.set_xticks((0,1,2))
        ax.set_xticklabels(('first 15', 'last 5', '30m later'))
        pylab.xlim((-.25, 2.25))
        pylab.ylim((0,2.0))
        pylab.gca()
        pylab.plot(mean_line[i], lw=3)
        pylab.ylabel('Median speed (mm/s)')
        patch = mpl.patches.Rectangle((.25,0), .5, 10, color=[1,.5,.5], fill=True)
        pyplot.gca().add_patch(patch)
        handles, labels = ax.get_legend_handles_labels()
        ax.legend(handles, labels)
def plotFishPositionVsTime(jsonData, startState=1, endState=0, smooth=5, axis=0, fmt='b-',wid=1):
    state = jsonData['stateinfo']
    midLine = (jsonData['tankSize_mm'][axis])/2.0

    st,_,nS,_ = aba.state_to_time(jsonData,startState)
    _,et,_,nE = aba.state_to_time(jsonData,endState)

    tracking = aba.getTracking(jsonData)
    tracking = tracking[np.logical_and(tracking[:,0] > st, tracking[:,0] < et),:].copy()
    frametime = tracking[:,0] - st
    position = tracking[:,axis+1]
    
    if 'OMRinfo' in jsonData.keys():
        results = aba.getOMRinfo(jsonData, tankLength =midLine*2)
        color = {-1:'red', 1:'blue'}
        hatch = {-1:'\\', 1:'/'}
        os = results['omrResults']['st']
        oe = results['omrResults']['et']
        od = results['omrResults']['dir']
        for n in range(len(os)):
            p1 = mpl.patches.Rectangle((os[n]-st,0),
                                       width=oe[n]-os[n],
                                       height=midLine*2,alpha=0.5,
                                       color=[.5,1,.5],hatch=hatch[od[n]])
            pyplot.gca().add_patch(p1)
            #pyplot.text(os[n]-st+(oe[n]-os[n])/3, 45, '%0.2f'%results['omrResults']['maxdist'][n])

    pyplot.plot(frametime, position, fmt, lw=1)
    if smooth>0:
        import scipy
        pyplot.plot(frametime, scipy.convolve(position,np.ones(smooth)/smooth, mode='same'))
    pyplot.ylim([0,midLine*2])
    pyplot.xlim([0,et-st])
    if axis==0:
        pyplot.ylabel('')
    else:
        pyplot.ylabel('')
    pyplot.xlabel('Time (s)')
def plotFishpathandTraces(dataArr, colorArr):
    fig = pyplot.figure(1, figsize=(11, 7))
    for i in range(2):
        if i == 0:
            for k in range(3):
                ax = pyplot.subplot(4, 3, k + 1)
                aba.plotFishPath(dataArr[k], color=colorArr[k], smoothWinLen=5)
                # pyplot.title('Fish Path in Tank')
                pyplot.xlabel("46 mm")
                pyplot.ylabel("22 mm")
                ax.set_xticks([20, 40])
                ax.set_yticks([10, 20])
                ax2 = pyplot.subplot(4, 3, k + 4)
                aba.plotFishXPosition(dataArr[k], fmt=colorArr[k], smooth=5)
                ax2.set_yticks([20, 40])
                pyplot.ylabel("x position")
                if k == 1:
                    patch5 = mpl.patches.Rectangle((900, 0), 1844, 50, color=[1, 0.5, 0.5], fill=True)
                    pyplot.gca().add_patch(patch5)

        if i == 1:
            for k in range(3):
                ax = pyplot.subplot(4, 3, i + k + 6)
                aba.plotFishPath(dataArr[k + i + 2], color=colorArr[k + i + 2], smoothWinLen=5)
                # pyplot.title('Fish Path in Tank')
                pyplot.xlabel("46 mm")
                pyplot.ylabel("22 mm")
                ax.set_xticks([20, 40])
                ax.set_yticks([10, 20])
                ax2 = pyplot.subplot(4, 3, i + k + 9)
                aba.plotFishXPosition(dataArr[k + i + 2], fmt=colorArr[k + i + 2], smooth=5)
                pyplot.ylabel("x position")
                ax2.set_yticks([20, 40])
                if k == 1:
                    patch5 = mpl.patches.Rectangle((900, 0), 1844, 50, color=[1, 0.5, 0.5], fill=True)
                    pyplot.gca().add_patch(patch5)
import ArenaBehaviorAnalysis as aba
import pylab
import numpy as np

e_test_f = [u'/Users/andalman/Dropbox/ConchisData/2013-01-11/f00076/f00076_2013-01-11-13-41-31.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-11/f00077/f00077_2013-01-11-13-41-34.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-11/f00078/f00078_2013-01-11-13-41-37.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-11/f00079/f00079_2013-01-11-13-41-39.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00076/f00076_2013-01-10-18-40-41.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00077/f00077_2013-01-10-18-40-38.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00078/f00078_2013-01-10-18-40-36.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00079/f00079_2013-01-10-18-40-34.json']
e_test = aba.loadMultipleDataFiles(e_test_f)

e_lh_f = [u'/Users/andalman/Dropbox/ConchisData/2013-01-11/f00076/f00076_2013-01-11-12-29-51.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-11/f00077/f00077_2013-01-11-12-29-49.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-11/f00078/f00078_2013-01-11-12-29-46.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-11/f00079/f00079_2013-01-11-12-29-44.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00076/f00076_2013-01-10-18-03-08.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00077/f00077_2013-01-10-18-03-11.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00078/f00078_2013-01-10-18-03-13.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00079/f00079_2013-01-10-18-03-16.json']
e_lh = aba.loadMultipleDataFiles(e_lh_f)

c_test_f = [u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00072/f00072_2013-01-10-17-16-45.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00073/f00073_2013-01-10-17-16-42.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00074/f00074_2013-01-10-17-16-39.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-10/f00075/f00075_2013-01-10-17-16-36.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-09/f00046/f00046_2013-01-09-18-24-16.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-09/f00047/f00047_2013-01-09-18-24-20.json',
 u'/Users/andalman/Dropbox/ConchisData/2013-01-09/f00048/f00048_2013-01-09-18-24-24.json',
Exemplo n.º 6
0
import pylab
import scipy


#first is shocking, second is 15 min in novel context 
e_shock5 = [
'/home/vburns/Dropbox/ConchisData/2013-03-30/f00263/f00263_2013-03-30-14-13-36.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00264/f00264_2013-03-30-14-13-34.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00265/f00265_2013-03-30-14-13-32.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00266/f00266_2013-03-30-14-13-29.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00267/f00267_2013-03-30-14-15-28.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00268/f00268_2013-03-30-14-15-26.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00269/f00269_2013-03-30-14-15-24.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00270/f00270_2013-03-30-14-15-21.json',
]
e_shock5 = aba.loadMultipleDataFiles(e_shock5)

e_shock25 = [
'/home/vburns/Dropbox/ConchisData/2013-03-30/f00271/f00271_2013-03-30-15-33-25.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00272/f00272_2013-03-30-15-33-27.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00273/f00273_2013-03-30-15-33-29.json',
# '/home/vburns/Dropbox/ConchisData/2013-03-30/f00274/f00274_2013-03-30-15-33-31.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00275/f00275_2013-03-30-15-35-03.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00276/f00276_2013-03-30-15-35-01.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00277/f00277_2013-03-30-15-34-59.json',
# '/home/vburns/Dropbox/ConchisData/2013-03-30/f00278/f00278_2013-03-30-15-34-57.json',
]
e_shock25= aba.loadMultipleDataFiles(e_shock25)

e_novel5 = [
 '/home/vburns/Dropbox/ConchisData/2013-03-30/f00263/f00263_2013-03-30-15-06-08.json',
def getmintime(d):
    tracking = aba.getTracking(d)
    frametime = tracking[:,0]
    mintime = max(frametime)-min(frametime)
    return mintime
Exemplo n.º 8
0
import ArenaBehaviorAnalysis as aba
import pylab
import numpy as np

e_fish_youngNR = [
    "/home/vburns/Dropbox/ConchisData/2013-02-12/f00134/f00134_2013-02-12-17-57-45.json",
    "/home/vburns/Dropbox/ConchisData/2013-02-12/f00135/f00135_2013-02-12-17-57-30.json",
]
e_fish_youngNR = aba.loadMultipleDataFiles(e_fish_youngNR)

e_fish_youngR = "/home/vburns/Dropbox/ConchisData/2013-02-12/f00136/f00136_2013-02-12-17-57-33.json"
e_fish_youngR = aba.loadDataFromFile(e_fish_youngR)
e_fish_youngR = [e_fish_youngR]

e_fish_oldNR = [
    "/home/vburns/Dropbox/ConchisData/2013-02-12/f00138/f00138_2013-02-12-17-57-37.json",
    "/home/vburns/Dropbox/ConchisData/2013-02-12/f00139/f00139_2013-02-12-17-57-40.json",
]
e_fish_oldNR = aba.loadMultipleDataFiles(e_fish_oldNR)

e_fish_oldR = [
    "/home/vburns/Dropbox/ConchisData/2013-02-12/f00140/f00140_2013-02-12-17-57-48.json",
    "/home/vburns/Dropbox/ConchisData/2013-02-12/f00141/f00141_2013-02-12-17-57-51.json",
    "/home/vburns/Dropbox/ConchisData/2013-02-12/f00142/f00142_2013-02-12-17-57-53.json",
]
e_fish_oldR = aba.loadMultipleDataFiles(e_fish_oldR)

# assumes shock is on red
(e_frac_yNR, e_dist_yNR) = aba.getSidePreference_Multi(e_fish_youngNR, cond=[8, 8], refState="Red")
(e_frac_yR, e_dist_yR) = aba.getSidePreference_Multi(e_fish_youngR, cond=[8, 8], refState="Red")
(e_frac_oNR, e_dist_oNR) = aba.getSidePreference_Multi(e_fish_oldNR, cond=[8, 8], refState="Red")
Exemplo n.º 9
0
def plot_drug_data(datasets, datanames, sbplt=(2, 2)):
    suby = sbplt[0]
    subx = sbplt[1]
    if subx * suby != len(datasets) / 2:
        print "warning, wrong plotting or data lengths"

    # initialize arrays and timing
    e_first_startshock = []
    e_first_endshock = []
    e_sec_2a = []
    e_sec_2b = []
    mean_line = []
    sm = 15
    endWinLen = 5 * 60  # amount of tracking at end

    for i in range(0, len(datasets), 2):
        e_first_startshock.append(aba.getMedianVelMulti(datasets[i], (0, 900), smoothWinLen=sm))
        e_first_endshock.append(aba.getMedianVelMulti(datasets[i], tRange=[-endWinLen, -0], smoothWinLen=sm))
        e_sec_2a.append(aba.getMedianVelMulti(datasets[i + 1], (0, 900), smoothWinLen=sm))
        e_sec_2b.append(aba.getMedianVelMulti(datasets[i + 1], (900, 1800), smoothWinLen=sm))

    for i in range(len(datasets) / 2):
        mean_line.append(
            np.transpose(
                np.hstack(
                    (
                        np.mean(e_first_startshock[i]),
                        np.mean(e_first_endshock[i]),
                        np.mean(e_sec_2a[i]),
                        np.mean(e_sec_2b[i]),
                    )
                )
            )
        )

    # plot data
    pylab.figure()
    pylab.suptitle("Drug Pilot Results")
    for i in range(subx * suby):
        ax = pylab.subplot(subx, suby, i + 1)
        pylab.plot(0, [e_first_startshock[i]], ".")
        pylab.plot(1, [e_first_endshock[i]], ".")
        pylab.plot(2, [e_sec_2a[i]], ".")
        pylab.plot(3, [e_sec_2b[i]], ".")
        yerr = (
            2 * scipy.stats.sem(e_first_startshock[i]),
            2 * scipy.stats.sem(e_first_endshock[i]),
            2 * scipy.stats.sem(e_sec_2a[i]),
            2 * scipy.stats.sem(e_sec_2b[i]),
        )
        pylab.plot(
            [0, 1, 2, 3],
            [np.mean(e_first_startshock[i]), np.mean(e_first_endshock[i]), np.mean(e_sec_2a[i]), np.mean(e_sec_2b[i])],
            "ok",
            lw=3,
        )
        pylab.errorbar(
            [0, 1, 2, 3],
            [np.mean(e_first_startshock[i]), np.mean(e_first_endshock[i]), np.mean(e_sec_2a[i]), np.mean(e_sec_2b[i])],
            fmt="ok",
            yerr=yerr,
            lw=3,
        )
        pylab.title(datanames[i])
        ax.set_xticks((0, 1, 2, 3))
        ax.set_xticklabels(("first 15", "last 5", "post 0-15", "post 15-30"))
        pylab.xlim((-0.25, 3.25))
        pylab.ylim((0, 4))
        pylab.plot(mean_line[i], "k", lw=3)
        pylab.ylabel("Median speed (mm/s)")
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as pyplot

#first 15 min is baseline, then 60 bouts of 60 sec shocking (30 bouts total), then 5 min post
e_shockR = [
'/home/vburns/Dropbox/ConchisData/2013-03-21/f00217/f00217_2013-03-21-14-35-21.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00218/f00218_2013-03-21-14-35-27.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00219/f00219_2013-03-21-14-35-34.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00220/f00220_2013-03-21-14-35-40.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00221/f00221_2013-03-21-14-37-14.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00222/f00222_2013-03-21-14-37-16.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00223/f00223_2013-03-21-14-37-18.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00224/f00224_2013-03-21-14-37-23.json', 
]
e_shockR = aba.loadMultipleDataFiles(e_shockR)

e_shockS = [
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00217/f00217_2013-03-21-15-29-22.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00218/f00218_2013-03-21-15-29-26.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00219/f00219_2013-03-21-15-30-00.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00220/f00220_2013-03-21-15-29-53.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00221/f00221_2013-03-21-15-31-35.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00222/f00222_2013-03-21-15-31-54.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00223/f00223_2013-03-21-15-32-04.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00224/f00224_2013-03-21-15-32-12.json',
]
e_shockS= aba.loadMultipleDataFiles(e_shockS)

e_shockN = [
 '/home/vburns/Dropbox/ConchisData/2013-03-21/f00217/f00217_2013-03-21-16-33-26.json',
Exemplo n.º 11
0
import ArenaBehaviorAnalysis as aba
import matplotlib as mpl
import matplotlib.pyplot as plt

if __name__ == '__main__':
    d = aba.loadDataFromFile_UI(initialdir='~/Dropbox/ConchisData/')
    if d is not None:
        aba.plotFishSummary(d)
        plt.show()

 '/home/vburns/Dropbox/ConchisData/2013-06-13/f00516/f00516_2013-06-13-13-22-37.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-13/f00517/f00517_2013-06-13-13-22-45.json',
# '/home/vburns/Dropbox/ConchisData/2013-06-13/f00518/f00518_2013-06-13-13-25-44.json', #low starting velocity
# '/home/vburns/Dropbox/ConchisData/2013-06-13/f00519/f00519_2013-06-13-13-25-49.json', #low starting velocity
 '/home/vburns/Dropbox/ConchisData/2013-06-13/f00520/f00520_2013-06-13-13-25-55.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-13/f00521/f00521_2013-06-13-13-26-01.json',
# '/home/vburns/Dropbox/ConchisData/2013-06-14/f00530/f00530_2013-06-14-13-15-42.json', #poor tracking?
 '/home/vburns/Dropbox/ConchisData/2013-06-14/f00531/f00531_2013-06-14-13-15-48.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-14/f00532/f00532_2013-06-14-13-15-57.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-14/f00533/f00533_2013-06-14-13-16-07.json',
#'/home/vburns/Dropbox/ConchisData/2013-06-14/f00534/f00534_2013-06-14-13-17-09.json', #current imbalance
 '/home/vburns/Dropbox/ConchisData/2013-06-14/f00535/f00535_2013-06-14-13-17-18.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-14/f00536/f00536_2013-06-14-13-17-30.json',
# '/home/vburns/Dropbox/ConchisData/2013-06-14/f00537/f00537_2013-06-14-13-17-34.json', #low velocity in base
]
e_safe5_first = aba.loadMultipleDataFiles(e_safe5_first)

e_shock5 = [
 '/home/vburns/Dropbox/ConchisData/2013-06-13/f00514/f00514_2013-06-13-13-54-27.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-13/f00515/f00515_2013-06-13-13-54-20.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-13/f00516/f00516_2013-06-13-13-54-11.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-13/f00517/f00517_2013-06-13-13-53-54.json',
# '/home/vburns/Dropbox/ConchisData/2013-06-13/f00518/f00518_2013-06-13-13-57-02.json',
# '/home/vburns/Dropbox/ConchisData/2013-06-13/f00519/f00519_2013-06-13-13-57-11.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-13/f00520/f00520_2013-06-13-13-57-25.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-13/f00521/f00521_2013-06-13-13-57-43.json',
# '/home/vburns/Dropbox/ConchisData/2013-06-14/f00530/f00530_2013-06-14-13-48-02.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-14/f00531/f00531_2013-06-14-13-47-54.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-14/f00532/f00532_2013-06-14-13-47-47.json',
 '/home/vburns/Dropbox/ConchisData/2013-06-14/f00533/f00533_2013-06-14-13-47-41.json',
#'/home/vburns/Dropbox/ConchisData/2013-06-14/f00534/f00534_2013-06-14-13-49-17.json',
Exemplo n.º 13
0
import ArenaBehaviorAnalysis as aba
import pylab
import numpy as np

e_pre_f_multi = '/home/vburns/Dropbox/ConchisData/2012-12-21/f00022/f00022_2012-12-21-10-07-32.json'
e_pre_f = ['/home/vburns/Dropbox/ConchisData/2012-12-21/f00024/f00024_2012-12-21-10-07-38.json',
 '/home/vburns/Dropbox/ConchisData/2012-12-21/f00027/f00027_2012-12-21-10-07-46.json',
 '/home/vburns/Dropbox/ConchisData/2012-12-21/f00029/f00029_2012-12-21-10-07-51.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-03/f00042/f00042_2013-01-03-11-26-35.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-03/f00043/f00043_2013-01-03-11-26-32.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-03/f00044/f00044_2013-01-03-11-26-30.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-03/f00045/f00045_2013-01-03-11-26-27.json']
e_pre = aba.loadMultipleDataFiles(e_pre_f)
e_temp = aba.loadDataFromFile_AvgMultiFish(e_pre_f_multi) 
e_pre = [e_temp] + e_pre

e_postM_f = '/home/vburns/Dropbox/ConchisData/2012-12-21/f00022/f00022_2012-12-21-13-23-49.json'
e_post_f = ['/home/vburns/Dropbox/ConchisData/2012-12-21/f00024/f00024_2012-12-21-13-24-03.json',
 '/home/vburns/Dropbox/ConchisData/2012-12-21/f00027/f00027_2012-12-21-13-25-17.json',
 '/home/vburns/Dropbox/ConchisData/2012-12-21/f00029/f00029_2012-12-21-13-25-49.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-03/f00042/f00042_2013-01-03-13-52-59.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-03/f00043/f00043_2013-01-03-13-53-02.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-03/f00044/f00044_2013-01-03-13-53-04.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-03/f00045/f00045_2013-01-03-13-53-06.json']
e_temp2 = aba.loadDataFromFile_AvgMultiFish(e_postM_f)
e_post = aba.loadMultipleDataFiles(e_post_f)
e_post = [e_temp2] + e_post

c_pre_f = ['/home/vburns/Dropbox/ConchisData/2013-01-14/f00080/f00080_2013-01-14-12-17-49.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-14/f00081/f00081_2013-01-14-12-17-52.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-14/f00082/f00082_2013-01-14-12-17-55.json',
Exemplo n.º 14
0
# '/home/vburns/Dropbox/ConchisData/2013-05-15/f00424/f00424_2013-05-15-14-37-25.json',#low starting velocity
# '/home/vburns/Dropbox/ConchisData/2013-05-15/f00425/f00425_2013-05-15-14-37-21.json', #problem with plotting ##CHECKCHECK
 '/home/vburns/Dropbox/ConchisData/2013-05-15/f00426/f00426_2013-05-15-14-40-23.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-15/f00427/f00427_2013-05-15-14-40-20.json', #current imbalance
 '/home/vburns/Dropbox/ConchisData/2013-05-15/f00428/f00428_2013-05-15-14-40-18.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-15/f00429/f00429_2013-05-15-14-40-13.json', #tracking in sec?
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00430/f00430_2013-05-16-10-04-07.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00431/f00431_2013-05-16-10-04-05.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00432/f00432_2013-05-16-10-04-03.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00433/f00433_2013-05-16-10-04-01.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00434/f00434_2013-05-16-10-05-40.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-16/f00435/f00435_2013-05-16-10-05-42.json', #low starting velocity
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00436/f00436_2013-05-16-10-05-45.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00437/f00437_2013-05-16-10-05-47.json',
]
e_water_first = aba.loadMultipleDataFiles(e_water_first)

#this is new water in shock tank
e_water_shock = [
 '/home/vburns/Dropbox/ConchisData/2013-05-15/f00422/f00422_2013-05-15-15-08-23.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-15/f00423/f00423_2013-05-15-15-08-34.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-15/f00424/f00424_2013-05-15-15-08-45.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-15/f00425/f00425_2013-05-15-15-08-54.json', 
 '/home/vburns/Dropbox/ConchisData/2013-05-15/f00426/f00426_2013-05-15-15-11-28.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-15/f00427/f00427_2013-05-15-15-11-35.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-15/f00428/f00428_2013-05-15-15-11-41.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-15/f00429/f00429_2013-05-15-15-11-46.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00430/f00430_2013-05-16-10-35-52.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00431/f00431_2013-05-16-10-35-47.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00432/f00432_2013-05-16-10-35-40.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-16/f00433/f00433_2013-05-16-10-35-34.json',
import ArenaBehaviorAnalysis as aba
import pylab
import numpy as np

e_fish_red = ['/home/vburns/Dropbox/ConchisData/2012-12-12/120612_HuC_f1/120612_HuC_f1_2012-12-12-15-31-39.json',
 '/home/vburns/Dropbox/ConchisData/2012-12-12/120612_HuC_f2/120612_HuC_f2_2012-12-12-15-31-32.json',]
e_fish_red = aba.loadMultipleDataFiles(e_fish_red)

e_fish_blue = ['/home/vburns/Dropbox/ConchisData/2012-12-12/120612_HuC_f3/120612_HuC_f3_2012-12-12-15-31-47.json',
'/home/vburns/Dropbox/ConchisData/2012-12-12/120612_HuC_f4/120612_HuC_f4_2012-12-12-15-31-52.json']
e_fish_blue = aba.loadMultipleDataFiles(e_fish_blue)

c_fish = ['/home/vburns/Dropbox/ConchisData/2013-01-16/f00084/f00084_2013-01-16-15-28-12.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-16/f00085/f00085_2013-01-16-15-28-14.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-16/f00086/f00086_2013-01-16-15-28-09.json',
 '/home/vburns/Dropbox/ConchisData/2013-01-16/f00087/f00087_2013-01-16-15-28-06.json']
c_fish = aba.loadMultipleDataFiles(c_fish)

#assumes cocaine is on red
(e_frac_pr, e_dist_pr) = aba.getSidePreference_Multi(e_fish_red, cond = [3,3], refState ='Red')
(e_frac_pb, e_dist_pb) = aba.getSidePreference_Multi(e_fish_blue, cond = [3,3], refState ='Blue')
(e_frac_por, e_dist_por) = aba.getSidePreference_Multi(e_fish_red, cond = [8,8], refState ='Red')
(e_frac_pob, e_dist_pob) = aba.getSidePreference_Multi(e_fish_blue, cond = [8,8], refState ='Blue')
(c_frac_pre,c_dist_pre) = aba.getSidePreference_Multi(c_fish, cond = [3,3], refState = 'Red')
(c_frac_post,c_dist_post) = aba.getSidePreference_Multi(c_fish, cond = [8,8], refState = 'Red')

e_frac_pre = np.append(e_frac_pr, e_frac_pb, axis = 0)
e_frac_post = np.append(e_frac_por, e_frac_pob, axis =0)
e_dis_pre = np.append(e_dist_pr, e_dist_pb, axis = 0)
e_dis_post = np.append(e_dist_por, e_dist_pob, axis = 0)
Exemplo n.º 16
0
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00889/f00889_2014-02-12-09-55-46.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00890/f00890_2014-02-12-09-55-49.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00891/f00891_2014-02-12-09-55-51.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00892/f00892_2014-02-12-09-55-54.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00893/f00893_2014-02-12-09-55-57.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00894/f00894_2014-02-12-09-56-00.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00895/f00895_2014-02-12-09-56-02.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00896/f00896_2014-02-12-09-56-05.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00897/f00897_2014-02-12-09-57-24.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00898/f00898_2014-02-12-09-57-29.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00899/f00899_2014-02-12-09-57-32.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00900/f00900_2014-02-12-09-57-35.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00901/f00901_2014-02-12-09-57-38.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00902/f00902_2014-02-12-09-57-41.json',
]
five_fluox_first = aba.loadMultipleDataFiles(five_fluox_first)

five_fluox_sec = [
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00889/f00889_2014-02-12-10-51-36.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00890/f00890_2014-02-12-10-51-31.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00891/f00891_2014-02-12-10-51-25.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00892/f00892_2014-02-12-10-51-20.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00893/f00893_2014-02-12-10-51-14.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00894/f00894_2014-02-12-10-51-07.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00895/f00895_2014-02-12-10-50-59.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00896/f00896_2014-02-12-10-50-55.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00897/f00897_2014-02-12-10-53-20.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00898/f00898_2014-02-12-10-53-07.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00899/f00899_2014-02-12-10-52-53.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00900/f00900_2014-02-12-10-52-35.json',
 '/home/vburns/Dropbox/ConchisData/2014-02-12/f00901/f00901_2014-02-12-10-52-25.json',
Exemplo n.º 17
0
import ArenaBehaviorAnalysis as aba
import pylab
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as pyplot
import pylab
import scipy
import os

e_safe5_first = aba.loadDataFromFile(
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-16/f00438/f00438_2013-05-16-14-13-03.json")
)
e_shock5 = aba.loadDataFromFile(
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-16/f00438/f00438_2013-05-16-14-44-45.json")
)
e_safe5_sec = aba.loadDataFromFile(
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-16/f00438/f00438_2013-05-16-15-39-01.json")
)

e_safe_same = aba.loadDataFromFile(
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-07/f00411/f00411_2013-05-07-14-15-17.json")
)  # ,bAcqArenaPoly=True)
e_shock_same = aba.loadDataFromFile(
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-07/f00411/f00411_2013-05-07-14-46-43.json")
)
e_safe_same_sec = aba.loadDataFromFile(
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-07/f00411/f00411_2013-05-07-15-40-02.json")
)

mpl.rcParams.update({"font.size": 18})
Exemplo n.º 18
0
import matplotlib.pyplot as pyplot
import scipy
import os

#control fish moved to shock water
control_first = [
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01105/f01105_2014-03-06-10-20-43.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01106/f01106_2014-03-06-10-20-39.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01107/f01107_2014-03-06-10-20-34.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01108/f01108_2014-03-06-10-20-28.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01109/f01109_2014-03-06-10-20-23.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01110/f01110_2014-03-06-10-20-16.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01111/f01111_2014-03-06-10-20-11.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01112/f01112_2014-03-06-10-20-06.json',
]
control_first = aba.loadMultipleDataFiles(control_first)

control_sec =[
'/home/vburns/Dropbox/ConchisData/2014-03-06/f01105/f01105_2014-03-06-11-16-23.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01106/f01106_2014-03-06-11-16-29.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01107/f01107_2014-03-06-11-16-34.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01108/f01108_2014-03-06-11-16-40.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01109/f01109_2014-03-06-11-16-48.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01110/f01110_2014-03-06-11-16-53.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01111/f01111_2014-03-06-11-17-01.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-06/f01112/f01112_2014-03-06-11-17-08.json',
]
control_sec = aba.loadMultipleDataFiles(control_sec)

print "Done loading fish."
Exemplo n.º 19
0
    # os.path.expanduser('~/Dropbox/ConchisData/2013-05-16/f00439/f00439_2013-05-16-14-13-09.json'), #low velocity in second base
    # os.path.expanduser('~/Dropbox/ConchisData/2013-05-16/f00440/f00440_2013-05-16-14-13-20.json'), #tracking
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-16/f00441/f00441_2013-05-16-14-13-27.json"),
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-16/f00442/f00442_2013-05-16-14-16-16.json"),
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-16/f00444/f00444_2013-05-16-14-16-04.json"),
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-16/f00445/f00445_2013-05-16-14-15-59.json"),
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-17/f00446/f00446_2013-05-17-12-47-21.json"),
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-17/f00447/f00447_2013-05-17-12-47-23.json"),
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-17/f00448/f00448_2013-05-17-12-47-25.json"),
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-17/f00449/f00449_2013-05-17-12-47-27.json"),
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-17/f00450/f00450_2013-05-17-12-49-05.json"),
    # os.path.expanduser('~/Dropbox/ConchisData/2013-05-17/f00451/f00451_2013-05-17-12-49-07.json'), #current imbalance and tracking
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-17/f00452/f00452_2013-05-17-12-49-08.json"),
    os.path.expanduser("~/Dropbox/ConchisData/2013-05-17/f00453/f00453_2013-05-17-12-49-10.json"),
]
e_first = aba.loadMultipleDataFiles(e_first)

e_shock = [
    "/home/vburns/Dropbox/ConchisData/2013-03-29/f00239/f00239_2013-03-29-17-46-08.json",
    "/home/vburns/Dropbox/ConchisData/2013-03-29/f00240/f00240_2013-03-29-17-46-14.json",
    "/home/vburns/Dropbox/ConchisData/2013-03-29/f00241/f00241_2013-03-29-17-46-21.json",
    "/home/vburns/Dropbox/ConchisData/2013-03-29/f00242/f00242_2013-03-29-17-46-29.json",
    "/home/vburns/Dropbox/ConchisData/2013-03-29/f00243/f00243_2013-03-29-17-51-19.json",
    "/home/vburns/Dropbox/ConchisData/2013-03-29/f00244/f00244_2013-03-29-17-51-24.json",
    "/home/vburns/Dropbox/ConchisData/2013-03-29/f00245/f00245_2013-03-29-17-51-30.json",
    "/home/vburns/Dropbox/ConchisData/2013-03-29/f00246/f00246_2013-03-29-17-51-35.json",
    "/home/vburns/Dropbox/ConchisData/2013-04-29/f00366/f00366_2013-04-29-10-26-30.json",
    # '/home/vburns/Dropbox/ConchisData/2013-04-29/f00367/f00367_2013-04-29-10-26-37.json',
    "/home/vburns/Dropbox/ConchisData/2013-04-29/f00368/f00368_2013-04-29-10-26-43.json",
    "/home/vburns/Dropbox/ConchisData/2013-04-29/f00369/f00369_2013-04-29-10-26-53.json",
    # '/home/vburns/Dropbox/ConchisData/2013-04-29/f00370/f00370_2013-04-29-10-27-41.json',
Exemplo n.º 20
0
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00611/f00611_2013-09-27-10-23-07.json',
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00612/f00612_2013-09-27-10-23-02.json',
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00613/f00613_2013-09-27-10-22-56.json',
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00614/f00615_2013-09-27-10-22-51.json',
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00615/f00615_2013-09-27-10-22-46.json',
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00616/f00616_2013-09-27-10-22-42.json', #current imbalance
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00617/f00617_2013-09-27-10-32-05.json',
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00618/f00616_2013-09-27-10-31-57.json',
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00619/f00619_2013-09-27-10-31-48.json',#current imbalance
        '/home/vburns/Dropbox/ConchisData/2013-09-27/f00620/f00620_2013-09-27-10-31-38.json',
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00621/f00621_2013-09-27-10-31-30.json', #current imbalance
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00622/f00622_2013-09-27-10-31-22.json',
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00623/f00623_2013-09-27-10-31-15.json',
	'/home/vburns/Dropbox/ConchisData/2013-09-27/f00624/f00624_2013-09-27-10-31-05.json'
]
e_omr = aba.loadMultipleDataFiles(e_omr)

e_post_omr = [
#    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00609/f00609_2013-09-27-11-25-24.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00610/f00610_2013-09-27-11-25-49.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00611/f00611_2013-09-27-11-26-04.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00612/f00612_2013-09-27-11-26-20.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00613/f00613_2013-09-27-11-26-35.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00614/f00614_2013-09-27-11-27-06.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00615/f00615_2013-09-27-11-27-22.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00616/f00616_2013-09-27-11-27-37.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00617/f00617_2013-09-27-11-28-37.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00618/f00618_2013-09-27-11-28-52.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00619/f00619_2013-09-27-11-29-07.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00620/f00620_2013-09-27-11-29-17.json',
    '/home/vburns/Dropbox/ConchisData/2013-09-27/f00621/f00621_2013-09-27-11-29-31.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-06/f00392/f00392_2013-05-06-10-19-39.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-06/f00393/f00393_2013-05-06-10-19-47.json', #red color
 '/home/vburns/Dropbox/ConchisData/2013-05-06/f00394/f00394_2013-05-06-10-21-26.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-06/f00395/f00395_2013-05-06-10-21-17.json', #low velocity
 '/home/vburns/Dropbox/ConchisData/2013-05-06/f00396/f00396_2013-05-06-10-21-06.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-06/f00397/f00397_2013-05-06-10-21-03.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-07/f00406/f00406_2013-05-07-14-18-31.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-07/f00407/f00407_2013-05-07-14-18-22.json', #current imbalance
 '/home/vburns/Dropbox/ConchisData/2013-05-07/f00408/f00408_2013-05-07-14-18-20.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-07/f00409/f00409_2013-05-07-14-18-18.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-07/f00410/f00410_2013-05-07-14-15-15.json', #tracking
 '/home/vburns/Dropbox/ConchisData/2013-05-07/f00411/f00411_2013-05-07-14-15-17.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-07/f00412/f00412_2013-05-07-14-15-19.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-07/f00413/f00413_2013-05-07-14-15-21.json',
]
e_safe_first = aba.loadMultipleDataFiles(e_safe_first)

e_safe_shock = [
 '/home/vburns/Dropbox/ConchisData/2013-05-06/f00390/f00390_2013-05-06-10-55-27.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-06/f00391/f00391_2013-05-06-10-55-29.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-06/f00392/f00392_2013-05-06-10-55-31.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-06/f00393/f00393_2013-05-06-10-55-33.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-06/f00394/f00394_2013-05-06-10-56-35.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-06/f00395/f00395_2013-05-06-10-56-33.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-06/f00396/f00396_2013-05-06-10-56-31.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-06/f00397/f00397_2013-05-06-10-56-29.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-07/f00406/f00406_2013-05-07-14-49-23.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-07/f00407/f00407_2013-05-07-14-49-29.json',
'/home/vburns/Dropbox/ConchisData/2013-05-07/f00408/f00408_2013-05-07-14-49-35.json',
 '/home/vburns/Dropbox/ConchisData/2013-05-07/f00409/f00409_2013-05-07-14-49-43.json',
# '/home/vburns/Dropbox/ConchisData/2013-05-07/f00410/f00410_2013-05-07-14-46-49.json',
Exemplo n.º 22
0
import pylab
import scipy
import os

##make sure fish have been loaded
if len(e_first) < 1:
    print "No fish"
    1/0
else: 
    print "Fish data found"

#velocity analysis 
sm = 15; #smooth over 15 frames.
endWinLen = 5 * 60; #seconds

eBaseVel5_1a = aba.getMedianVelMulti(e_first, (0,900), smoothWinLen = sm)
eBaseVel5_1b = aba.getMedianVelMulti(e_first, (900,1800), smoothWinLen = sm)
cBaseVel_1a = aba.getMedianVelMulti(c_first, (0,900), smoothWinLen = sm)
cBaseVel_1b = aba.getMedianVelMulti(c_first, (900,1800), smoothWinLen = sm)

eBaseVel5_2a = aba.getMedianVelMulti(e_sec, (0,900), smoothWinLen = sm)
eBaseVel5_2b = aba.getMedianVelMulti(e_sec, (900,1800), smoothWinLen = sm)
cBaseVel_2a = aba.getMedianVelMulti(c_sec, (0,900), smoothWinLen = sm)
cBaseVel_2b = aba.getMedianVelMulti(c_sec, (900,1800), smoothWinLen = sm)

eBase5 = aba.getMedianVelMulti(e_shock, (0, 900), smoothWinLen = sm)
cBase = aba.getMedianVelMulti(c_shock, (0, 900), smoothWinLen = sm)
eEndVel5 = aba.getMedianVelMulti(e_shock, tRange=[-endWinLen,-0], smoothWinLen=sm)
cEndVel = aba.getMedianVelMulti(c_shock, tRange=[-endWinLen,-0], smoothWinLen = sm)
eBaseSame_1a = aba.getMedianVelMulti(e_same_first, (0, 900), smoothWinLen = sm)
eBaseSame_1b = aba.getMedianVelMulti(e_same_first, (900, 1800), smoothWinLen = sm)
import ArenaBehaviorAnalysis as aba
import pylab
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as pyplot

#first 15 min is baseline, then 60 bouts of 60 sec shocking (30 bouts total), then 5 min post
#bottom of novel tanks were changed to red
e_shockR = [
'/home/vburns/Dropbox/ConchisData/2013-03-24/f00233/f00233_2013-03-24-15-21-51.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-24/f00234/f00234_2013-03-24-15-22-03.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-24/f00236/f00236_2013-03-24-15-19-48.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-24/f00237/f00237_2013-03-24-15-19-47.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-24/f00238/f00238_2013-03-24-15-19-45.json',
]
e_shockR = aba.loadMultipleDataFiles(e_shockR)

e_shockS = [
'/home/vburns/Dropbox/ConchisData/2013-03-24/f00233/f00233_2013-03-24-16-15-39.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-24/f00234/f00234_2013-03-24-16-15-47.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-24/f00236/f00236_2013-03-24-16-14-42.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-24/f00237/f00237_2013-03-24-16-14-44.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-24/f00238/f00238_2013-03-24-16-14-46.json'
]
e_shockS= aba.loadMultipleDataFiles(e_shockS)

e_shockN = [
'/home/vburns/Dropbox/ConchisData/2013-03-24/f00233/f00233_2013-03-24-17-21-14.json',
'/home/vburns/Dropbox/ConchisData/2013-03-24/f00234/f00234_2013-03-24-17-21-21.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-24/f00236/f00236_2013-03-24-17-19-52.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-24/f00237/f00237_2013-03-24-17-19-50.json',
import pylab
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as pyplot
import pylab
import scipy

#omr stats
tp = 12
'''
ePreOMRstats = aba.getOMRScoreStatsMulti(e_omr, stateRange=[3,3], timePoint=tp)
eEndOMRstats = aba.getOMRScoreStatsMulti(e_omr, stateRange=[8,8], timePoint=tp)
ePostOMRstats_2a= aba.getOMRScoreStatsMulti(e_omr_post, stateRange=[3,3], timePoint=tp)
ePostOMRstats_2b = aba.getOMRScoreStatsMulti(e_omr_post, stateRange=[8,8], timePoint=tp)
'''
ePreOMRstatsSame_1a= aba.getOMRScoreStatsMulti(e_omr_same_pre, stateRange=[3,3], timePoint=tp)
ePreOMRstatsSame_1b = aba.getOMRScoreStatsMulti(e_omr_same_pre, stateRange=[8,8], timePoint=tp)
ePreOMRstatsSame = aba.getOMRScoreStatsMulti(e_omr_same, stateRange=[3,3], timePoint=tp)
#eEndOMRstatsSame = aba.getOMRScoreStatsMulti(e_omr_same, stateRange=[8,8], timePoint=tp)
eEndOMRstatsSame = aba.getOMRScoreStatsMulti(e_omr_same_last, stateRange=[8,8], timePoint=tp)
ePostOMRstatsSame_2a= aba.getOMRScoreStatsMulti(e_omr_same_post, stateRange=[3,3], timePoint=tp)
ePostOMRstatsSame_2b = aba.getOMRScoreStatsMulti(e_omr_same_post, stateRange=[8,8], timePoint=tp)

cPreOMRstats_1a= aba.getOMRScoreStatsMulti(c_omr_pre, stateRange=[3,3], timePoint=tp)
cPreOMRstats_1b = aba.getOMRScoreStatsMulti(c_omr_pre, stateRange=[8,8], timePoint=tp)
cPreOMRstats = aba.getOMRScoreStatsMulti(c_omr, stateRange=[3,3], timePoint=tp)
#cEndOMRstats = aba.getOMRScoreStatsMulti(c_omr, stateRange=[8,8], timePoint=tp)
cEndOMRstats = aba.getOMRScoreStatsMulti(c_omr_last, stateRange=[8,8], timePoint=tp)
cPostOMRstats_2a= aba.getOMRScoreStatsMulti(c_omr_post, stateRange=[3,3], timePoint=tp)
cPostOMRstats_2b = aba.getOMRScoreStatsMulti(c_omr_post, stateRange=[8,8], timePoint=tp)
Exemplo n.º 25
0
import pylab
import scipy


#first is 30 min in safe tank, then standard shocking, then 30 min in safe tank
e_shock5 = [
'/home/vburns/Dropbox/ConchisData/2013-03-29/f00239/f00239_2013-03-29-17-46-08.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00240/f00240_2013-03-29-17-46-14.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00241/f00241_2013-03-29-17-46-21.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00242/f00242_2013-03-29-17-46-29.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00243/f00243_2013-03-29-17-51-19.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00244/f00244_2013-03-29-17-51-24.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00245/f00245_2013-03-29-17-51-30.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00246/f00246_2013-03-29-17-51-35.json',
]
e_shock5 = aba.loadMultipleDataFiles(e_shock5)

e_shock8 = [
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00247/f00247_2013-03-29-19-52-28.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00248/f00248_2013-03-29-19-52-26.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00249/f00249_2013-03-29-19-52-24.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00250/f00250_2013-03-29-19-52-21.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00251/f00251_2013-03-29-19-53-39.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00252/f00252_2013-03-29-19-53-37.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00253/f00253_2013-03-29-19-53-34.json',
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00254/f00254_2013-03-29-19-53-32.json',
]
e_shock8= aba.loadMultipleDataFiles(e_shock8)

e_safe5_sec = [
 '/home/vburns/Dropbox/ConchisData/2013-03-29/f00239/f00239_2013-03-29-18-40-05.json',
Exemplo n.º 26
0
import pylab
import scipy
import os

#this is fish that is shocked and then replaced in same tank with new water
e_shock = [
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01193/f01193_2014-03-31-13-19-56.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01194/f01194_2014-03-31-13-20-05.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01195/f01195_2014-03-31-13-20-17.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01196/f01196_2014-03-31-13-20-28.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01197/f01197_2014-03-31-13-20-38.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01198/f01198_2014-03-31-13-20-51.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01199/f01199_2014-03-31-13-21-03.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01200/f01200_2014-03-31-13-21-18.json',
]
e_shock = aba.loadMultipleDataFiles(e_shock)

e_sec = [
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01193/f01193_2014-03-31-14-18-56.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01194/f01194_2014-03-31-14-19-14.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01195/f01195_2014-03-31-14-19-26.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01196/f01196_2014-03-31-14-19-48.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01197/f01197_2014-03-31-14-20-00.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01198/f01198_2014-03-31-14-20-11.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01199/f01199_2014-03-31-14-20-23.json',
 '/home/vburns/Dropbox/ConchisData/2014-03-31/f01200/f01200_2014-03-31-14-20-41.json',
]
e_sec = aba.loadMultipleDataFiles(e_sec)

print 'Done loading fish'
Exemplo n.º 27
0
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00844/f00844_2013-10-31-13-49-11.json',
# '/home/vburns/Dropbox/ConchisData/2013-10-31/f00845/f00845_2013-10-31-13-49-42.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00846/f00846_2013-10-31-13-49-35.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00847/f00847_2013-10-31-13-49-28.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00848/f00848_2013-10-31-13-49-20.json',
 '/home/vburns/Dropbox/ConchisData/2013-11-01/f00857/f00857_2013-11-01-13-21-13.json',
 '/home/vburns/Dropbox/ConchisData/2013-11-01/f00858/f00858_2013-11-01-13-21-19.json',
 '/home/vburns/Dropbox/ConchisData/2013-11-01/f00859/f00859_2013-11-01-13-21-27.json',
 '/home/vburns/Dropbox/ConchisData/2013-11-01/f00860/f00860_2013-11-01-13-21-34.json',
 '/home/vburns/Dropbox/ConchisData/2013-11-01/f00861/f00861_2013-11-01-13-21-42.json',
 '/home/vburns/Dropbox/ConchisData/2013-11-01/f00862/f00862_2013-11-01-13-21-48.json',
 '/home/vburns/Dropbox/ConchisData/2013-11-01/f00863/f00863_2013-11-01-13-21-58.json',
 '/home/vburns/Dropbox/ConchisData/2013-11-01/f00864/f00864_2013-11-01-13-22-03.json',

]
e_omr_same_pre=aba.loadMultipleDataFiles(e_omr_same_pre)

e_omr_same = [
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00833/f00833_2013-10-31-10-28-04.json',
# '/home/vburns/Dropbox/ConchisData/2013-10-31/f00834/f00834_2013-10-31-10-28-11.json',
# '/home/vburns/Dropbox/ConchisData/2013-10-31/f00835/f00835_2013-10-31-10-28-18.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00836/f00836_2013-10-31-10-28-24.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00841/f00841_2013-10-31-14-22-11.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00842/f00842_2013-10-31-14-22-04.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00843/f00843_2013-10-31-14-21-56.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00844/f00844_2013-10-31-14-21-50.json',
#'/home/vburns/Dropbox/ConchisData/2013-10-31/f00845/f00845_2013-10-31-14-22-35.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00846/f00846_2013-10-31-14-22-28.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00847/f00847_2013-10-31-14-22-21.json',
 '/home/vburns/Dropbox/ConchisData/2013-10-31/f00848/f00848_2013-10-31-14-22-17.json',
 '/home/vburns/Dropbox/ConchisData/2013-11-01/f00857/f00857_2013-11-01-13-55-06.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-17/f00165/f00165_2013-02-17-12-33-25.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-17/f00166/f00166_2013-02-17-12-33-22.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-17/f00167/f00167_2013-02-17-12-33-19.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-24/f00190/f00190_2013-02-24-13-54-44.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-24/f00191/f00191_2013-02-24-13-56-11.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-24/f00192/f00192_2013-02-24-13-55-53.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00193/f00193_2013-02-26-14-46-26.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00194/f00194_2013-02-26-14-46-23.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00195/f00195_2013-02-26-14-46-20.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00196/f00196_2013-02-26-14-46-18.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00197/f00197_2013-02-26-14-46-16.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00198/f00198_2013-02-26-14-46-14.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00199/f00199_2013-02-26-14-46-11.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00200/f00200_2013-02-26-14-46-09.json'
]
e_shockR = aba.loadMultipleDataFiles(e_shockR)

e_RTR = [
 '/home/vburns/Dropbox/ConchisData/2013-02-17/f00160/f00160_2013-02-17-11-45-31.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-17/f00161/f00161_2013-02-17-11-44-11.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-17/f00162/f00162_2013-02-17-11-44-48.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-17/f00164/f00164_2013-02-17-13-24-08.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-17/f00165/f00165_2013-02-17-13-24-41.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-17/f00166/f00166_2013-02-17-13-25-07.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-17/f00167/f00167_2013-02-17-13-25-49.json', 
 '/home/vburns/Dropbox/ConchisData/2013-02-24/f00190/f00190_2013-02-24-14-48-06.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-24/f00191/f00191_2013-02-24-14-47-47.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-24/f00192/f00192_2013-02-24-14-47-36.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00193/f00193_2013-02-26-15-38-30.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00194/f00194_2013-02-26-15-38-27.json',
 '/home/vburns/Dropbox/ConchisData/2013-02-26/f00195/f00195_2013-02-26-15-38-34.json',
Exemplo n.º 29
0
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00627/f00627_2013-09-27-14-19-21.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00628/f00628_2013-09-27-14-19-17.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00629/f00629_2013-09-27-14-19-13.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00630/f00630_2013-09-27-14-19-08.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00631/f00631_2013-09-27-14-19-04.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00632/f00632_2013-09-27-14-18-59.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00633/f00633_2013-09-27-14-22-01.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00634/f00634_2013-09-27-14-22-09.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00635/f00635_2013-09-27-14-22-17.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00636/f00636_2013-09-27-14-22-30.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00637/f00637_2013-09-27-14-22-43.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00638/f00638_2013-09-27-14-22-53.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00639/f00639_2013-09-27-14-23-03.json',
# '/home/vburns/Dropbox/ConchisData/2013-09-27/f00640/f00640_2013-09-27-14-23-12.json'
]
c_omr_5mm = aba.loadMultipleDataFiles(c_omr_5mm)

c_omr_2mm = ['/home/vburns/Dropbox/ConchisData/2013-09-30/f00649/f00649_2013-09-30-11-30-50.json',
             '/home/vburns/Dropbox/ConchisData/2013-09-30/f00650/f00650_2013-09-30-11-31-37.json',
             '/home/vburns/Dropbox/ConchisData/2013-09-30/f00651/f00651_2013-09-30-11-31-42.json',
             '/home/vburns/Dropbox/ConchisData/2013-09-30/f00652/f00652_2013-09-30-11-31-52.json',
             '/home/vburns/Dropbox/ConchisData/2013-09-30/f00653/f00653_2013-09-30-11-32-07.json',
             '/home/vburns/Dropbox/ConchisData/2013-09-30/f00654/f00654_2013-09-30-11-32-17.json',
             #'/home/vburns/Dropbox/ConchisData/2013-09-30/f00655/f00655_2013-09-30-11-32-24.json',
             '/home/vburns/Dropbox/ConchisData/2013-09-30/f00656/f00656_2013-09-30-11-32-31.json']
c_omr_2mm = aba.loadMultipleDataFiles(c_omr_2mm)

c_omr_8mm_slow = ['/home/vburns/Dropbox/ConchisData/2013-09-30/f00657/f00657_2013-09-30-14-30-02.json',
                  '/home/vburns/Dropbox/ConchisData/2013-09-30/f00658/f00658_2013-09-30-14-30-12.json',
                  '/home/vburns/Dropbox/ConchisData/2013-09-30/f00659/f00659_2013-09-30-14-30-20.json',
                  '/home/vburns/Dropbox/ConchisData/2013-09-30/f00660/f00660_2013-09-30-14-30-26.json',
Exemplo n.º 30
0
import matplotlib as mpl
import matplotlib.pyplot as pyplot
import pylab
import scipy

allfish = [
'/home/vburns/Dropbox/ConchisData/2013-04-21/f00350/f00350_2013-04-21-14-01-18.json',
 '/home/vburns/Dropbox/ConchisData/2013-04-21/f00351/f00351_2013-04-21-14-01-30.json',
 '/home/vburns/Dropbox/ConchisData/2013-04-21/f00352/f00352_2013-04-21-14-01-39.json',
 '/home/vburns/Dropbox/ConchisData/2013-04-21/f00353/f00353_2013-04-21-14-01-52.json',
 '/home/vburns/Dropbox/ConchisData/2013-04-21/f00354/f00354_2013-04-21-13-56-28.json',
 '/home/vburns/Dropbox/ConchisData/2013-04-21/f00355/f00355_2013-04-21-13-56-25.json',
 '/home/vburns/Dropbox/ConchisData/2013-04-21/f00356/f00356_2013-04-21-13-56-23.json',
 '/home/vburns/Dropbox/ConchisData/2013-04-21/f00357/f00357_2013-04-21-13-56-21.json'
]
allfish = aba.loadMultipleDataFiles(allfish)

sm = 15
sections = 15

fish_vel0 = aba.getMedianVelMulti(allfish, (0,900), smoothWinLen=sm)
fish_vel1 = aba.getMedianVelMulti(allfish, (900,1800), smoothWinLen=sm)
fish_vel2 = aba.getMedianVelMulti(allfish, (1800,2700), smoothWinLen=sm)
fish_vel3 = aba.getMedianVelMulti(allfish, (2700,3600), smoothWinLen=sm)

vel0 = np.array([np.array([fish_vel0[n]]) for n in range(len(fish_vel0))])
vel1 = np.array([np.array([fish_vel1[n]]) for n in range(len(fish_vel1))])
vel2 = np.array([np.array([fish_vel2[n]]) for n in range(len(fish_vel2))])
vel3 = np.array([np.array([fish_vel3[n]]) for n in range(len(fish_vel3))])

allvelocity = np.transpose(np.hstack((vel0, vel1, vel2, vel3)))