In [1]:
%matplotlib inline
import matplotlib.pylab as plt
import seaborn as sns

from ephys import core, clust, viz

In [4]:
block_path = '/mnt/cube/nyoni-raw/test_data'

In [5]:
%%time
spikes = core.load_spikes(block_path)


---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-5-6f40be8dee31> in <module>()
----> 1 get_ipython().run_cell_magic(u'time', u'', u'spikes = core.load_spikes(block_path)')

/usr/local/anaconda/envs/pymne_mt/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_cell_magic(self, magic_name, line, cell)
   2115             magic_arg_s = self.var_expand(line, stack_depth)
   2116             with self.builtin_trap:
-> 2117                 result = fn(magic_arg_s, cell)
   2118             return result
   2119 

</usr/local/anaconda/envs/pymne_mt/lib/python2.7/site-packages/decorator.pyc:decorator-gen-60> in time(self, line, cell, local_ns)

/usr/local/anaconda/envs/pymne_mt/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    186     # but it's overkill for just that one bit of state.
    187     def magic_deco(arg):
--> 188         call = lambda f, *a, **k: f(*a, **k)
    189 
    190         if callable(arg):

/usr/local/anaconda/envs/pymne_mt/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in time(self, line, cell, local_ns)
   1191         else:
   1192             st = clock2()
-> 1193             exec(code, glob, local_ns)
   1194             end = clock2()
   1195             out = None

<timed exec> in <module>()

/usr/local/home/mturvey/Code/ephys-analysis/ephys/core.pyc in load_spikes(block_path, channel_group, clustering)
    280 
    281     '''
--> 282     with h5.File(find_kwik(block_path), 'r') as kf:
    283         spikes = pd.DataFrame(
    284             dict(cluster=kf['/channel_groups/{}/spikes/clusters/{}'.format(channel_group, clustering)][:],

/usr/local/home/mturvey/Code/ephys-analysis/ephys/core.pyc in decorated(*args, **kwargs)
     33     def decorated(*args, **kwargs):
     34         ls = glob.glob(find_file_func(*args, **kwargs))
---> 35         assert len(ls) == 1, ls
     36         return ls[0]
     37 

AssertionError: []

In [4]:
%%time
waveforms, cluster_map = clust.compute_cluster_waveforms_fast(block_path, spikes)


CPU times: user 1min 7s, sys: 5.13 s, total: 1min 12s
Wall time: 1min 12s

In [5]:
viz.plot_mean_cluster_waverforms(waveforms, cluster_map, sharey=False)



In [6]:
viz.plot_mean_cluster_waverforms(waveforms, cluster_map, sharey=True)