In [1]:
## Init
from import ONE
from ibllib.misc import pprint
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

one = ONE() # need to instantiate the class to have the API.
In [2]:
## In this case we just lookup the session using the date
eid, ses ='olivier', date_range=['2018-08-24', '2018-08-24'], details=True)
In [3]:
## Now lists the available datasets for this EID
['_ibl_lickPiezo.raw', '_ibl_lickPiezo.timestamps', '_ibl_wheel.position', 'channels.brainLocation', 'channels.probe', 'channels.rawRow', '', 'channels.sitePositions', 'clusters._phy_annotation', 'clusters.depths', 'clusters.peakChannel', 'clusters.probes', 'clusters.templateWaveforms', 'clusters.waveformDuration', 'eye.area', 'eye.blink', 'eye.timestamps', 'eye.xyPos', 'licks.times', 'probes.description', 'probes.insertion', 'probes.rawFilename', 'probes.sitePositions', 'spikes.amps', 'spikes.clusters', 'spikes.depths', 'spikes.times', 'spontaneous.intervals', 'unknown']
In [4]:
## And then load a couple of datasets
xy, t = one.load(eid[0], dataset_types=['eye.xyPos', 'eye.timestamps'])
plt.plot(t[:,1], xy)
[<matplotlib.lines.Line2D at 0x7fe4218bc7f0>,
 <matplotlib.lines.Line2D at 0x7fe4218bca58>]
In [5]:
## Loads some spike data
st, sa = one.load(eid[0], dataset_types=['spikes.times', 'spikes.amps'])
In [6]:
## Plot spikes density accross the whole experiment with/without running average
bc = np.bincount(np.int64(st[:,0]-np.min(st[:,0])))
t = np.linspace(0,np.double(bc.size)/86400, bc.size)

ts = pd.Series(bc, t)
plt.plot(t*86400, bc)
plt.plot(t*86400, np.convolve(np.ones(30)/30, bc, 'same'))
[<matplotlib.lines.Line2D at 0x7fe421822390>]