code
stringlengths
3
6.57k
RuntimeError(msg)
check_wavepadding(self, nids='good', npad=2)
print('Checking spike waveform padding')
sorted(self.neurons)
shape (nchans, npad)
np.diff(l, axis=1)
all()
np.diff(r, axis=1)
all()
if (wd[:, 0] == 0)
all()
if (wd[:, -1] == 0)
all()
RuntimeError(msg)
check_contiguous_nids(self)
contiguous (no gaps)
print('Checking that neuron IDs are contiguous')
np.array(list(self.neurons)
nids.sort()
if (np.diff(nids)
any()
RuntimeError('Neuron IDs are not contiguous, renumber all and try again')
exportptcsfiles(self, basepath, sortpath, user='', notes='')
self.check_ISIs()
self.check_wavealign()
self.check_wavepadding()
self.check_contiguous_nids()
str(datetime.datetime.now()
exportdt.split('.')
self.stream.is_multi()
print('Exporting "good" clusters to:')
zip(streams, tranges)
intround(dt)
exportptcsfile(self, stream, basepath, dt, exportdt, sortpath, user='', notes='')
us (spike times are stored as int64 us in .ptcs)
sorted(self.good)
spikets.sort()
spikets.searchsorted([stream.t0, stream.t1])
len(spikets)
PTCSNeuronRecord(neuron, spikets, nsamplebytes, descr='')
nrecs.append(nrec)
len(spikets)
len(nrecs)
os.path.join(basepath, stream.srcfnameroot)
os.mkdir(path)
os.path.join(path, fname)
open(fullfname, 'wb')
header.write(f)
nrec.write(f)
print(fullfname)
exportcsv(self, fname)
time (s)
sorted(self.good)
sids.append(neuron.sids)
chans.append(np.tile(neuron.chan, neuron.nspikes)
np.hstack(sids)
np.hstack(chans)
np.column_stack([tsecs, nids, chans])
print('Exporting (tsec, nid, chan)
np.savetxt(fname, data, fmt='%.6f, %d, %d')
exporttschid(self, basepath)
int64 (timestamp, channel, neuron id)
NotImplementedError('Needs to be redone to work with multiple streams')
str(datetime.datetime.now()
dt.split('.')
dt.replace(' ', '_')
dt.replace(':', '.')
srffnameroot.replace(' ', '_')
np.empty((len(spikes)
tschid.tofile(os.path.join(path, tschidfname)
print(tschidfname)
exportdin(self, basepath)
din(s)
file(s)
self.stream.is_multi()
print('Exporting DIN(s)
len(svrecs)
os.path.join(basepath, stream.srcfnameroot)
os.mkdir(path)
svrecs.astype(dinfiledtype)
svrecs.view(np.int64)
reshape(-1, 2)
recordings (<= ptc15)
svrects.searchsorted(dsprects)
np.split(svrecs, svalrecis)
len(dins)
len(dsprecs)
enumerate(dins)
len(dins)
len(dins)
os.path.join(path, dinfname)
din.tofile(fullfname)
print(fullfname)
exporttextheader(self, basepath)
header(s)
file(s)
self.stream.is_multi()
print('Exporting text header(s)
len(dsprecs)
os.path.join(basepath, stream.srcfnameroot)