In [1]:
%matplotlib inline
import pytry
import numpy as np
import pylab
import pandas
import seaborn


c:\users\terry\py3\lib\site-packages\IPython\html.py:14: ShimWarning: The `IPython.html` package has been deprecated since IPython 4.0. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.
  "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)

In [52]:
data = pytry.read('exp_f1_b')
T = float(data[0]['T'])


Error reading file "exp_f1_b\ForageTrial#20170624-142111-e6fb32c3.txt"

In [53]:
times = np.zeros((len(data), int(T/0.001)))
for i, d in enumerate(data):
    times[i][(d['score_times']/0.001).astype(int)] = 1000

In [55]:
import scipy.ndimage

seaborn.set_style("whitegrid")
mean = np.mean(times, axis=0)
meanf = scipy.ndimage.filters.gaussian_filter1d(mean, sigma=1000)

t = np.arange(len(times[0]))*0.001

pylab.plot(t, meanf)

for row in times:
    rowf = scipy.ndimage.filters.gaussian_filter1d(row, sigma=1000)
    pylab.plot(t, rowf, color='#666666', alpha=0.1)

pylab.xlabel('time (s)')
pylab.ylabel('targets per second')


Out[55]:
<matplotlib.text.Text at 0x26a9a3ea668>

In [ ]:


In [ ]: