code
stringlengths
3
6.57k
np.loadtxt(fname, dtype=np.float32)
np.int32(data[:, 2:])
print('Parsed %r' % fname)
parse_charlies_output(self, fname=None)
np.loadtxt(fname, dtype=int)
write_spc_app_input(self)
self.get_spikes_sortedby('id')
self.get_component_matrix()
open(r'C:\home\mspacek\Desktop\Work\SPC\Weizmann\spc_app\spc_app_input.txt', 'w')
f.write('AFFX\tNAME\t')
f.write('s%d\t' % spike['id'])
f.write('\n')
enumerate(['Vpp', 'dt', 'x0', 'y0', 'sx', 'sy', 'theta'])
f.write(param+'\t'+param+'\t')
f.write('%f\t' % val)
f.write('\n')
f.close()
hcluster(self, t=1.0)
distrib (dt, s1, s2)
self.get_spikes_sortedby('id')
self.get_component_matrix()
print(X)
fclusterdata(X, t=t, method='single', metric='euclidean')
self.get_ids(cids, spikes)
export2Charlie(self, fname='spike_data', onlymaxchan=False, nchans=3, npoints=32)
datapoints (1/4, 3/4 wrt spike time)
np.log2(npoints)
update_wave(self.stream)
intround(self.spikes[0].wave.data.shape[-1] / 4)
np.empty(dims, dtype=np.float32)
np.arange(len(dm.data)
np.asarray(dm.coords)
list(self.spikes)
sids.sort()
np.asarray([chani])
d2s.argsort()
spike.update_wave(self.stream)
np.zeros(data.shape[-1], data.dtype)
row.extend(data[ti-npoints/4:ti+npoints*3/4])
str(datetime.datetime.now()
dt.split('.')
dt.replace(' ', '_')
dt.replace(':', '.')
np.savetxt(fname, output, fmt='%.1f', delimiter=' ')
match(self, templates=None, weighting='signal', sort=True)
disk. (First match is slow, subsequent ones are ~ 15X faster.)
sum(err**2)
abs(template_signal)
self.templates.values()
sys.stdout.write('matching')
time.time()
len(self.spikes)
template.get_stdev()
self.spikes.values()
spike.update_wave(tw)
np.asarray([templatewave.data, spikewave.data])
np.abs(tsdata)
max(axis=0)
sum(axis=None)
template.err.append((spike.id, intround(err)
np.asarray(template.err, dtype=np.int64)
len(template.err)
argsort()
sys.stdout.write('.')
print('\nmatch took %.3f sec' % (time.time()
Neuron(object)
__init__(self, sort, id=None)
WaveForm()
np.array([], dtype=int)
get_chans(self)
self.update_wave()
property(get_chans)
get_chan(self)
self.update_wave()
self.wave.data.ptp(axis=1)
argmax()
property(get_chan)
get_nspikes(self)
len(self.sids)
property(get_nspikes)
__getstate__(self)
self.__dict__.copy()
d.pop('X', None)
d.pop('Xhash', None)
get_wave(self)
self.update_wave()
self.update_wave()
update_wave(self)
len(self.sids)
RuntimeError("n%d has no spikes and its waveform can't be updated" % self.id)
sort.get_mean_wave(self.sids, nid=self.id)
sort.twts.copy()
__sub__(self, other)
getCommonWaveData(self, otherchan, otherchans, otherwavedata)
np.intersect1d(self.chans, otherchans, assume_unique=True)
len(chans)
ValueError('No common chans')
ValueError("maxchans aren't part of common chans")
self.chans.searchsorted(chans)
otherchans.searchsorted(chans)