Here is a worked example to get to a dataset that is ready for analysis.
All of the following steps assume that you’ve executed import span in a Python interpreter.
import span
tankname = 'some/path/to/a/tdt/tank/file'
tank = span.tdt.PandasTank(tankname)
sp = tank.spik # spikes is a computed property based on the names of events
# create an array of bools indicating which spikes have voltage values
# greater than 4 standard deviations from the mean
thr = sp.threshold(4 * sp.std())
# clear the refractory period of any spikes; in place to save memory
thr.clear_refrac(inplace=True)
# bin the data in 1 second bins
binned = clr.resample('S', how='sum')
# compute the cross-correlation of all channels
# note that there are a lot more options to this method
# you should explore the docs
xcorr = sp.xcorr(binned)
import span
tankname = 'some/path/to/a/tdt/tank/file'
tank = span.tdt.TdtTank(tankname)
sp = tank.spik
# create an array of bools indicating which spikes have voltage values
# greater than 4 standard deviations
thr = sp.threshold(4 * sp.std())
# clear the refractory period of any spikes
thr.clear_refrac(inplace=True)
# binned the data in 1 second bins
binned = clr.resample('S', how='sum')
# compute the cross-correlation of all channels
xcorr = sp.xcorr(binned)