예제 #1
0
 def prev(self, event):
     self.time -= time_window
     tps = int(self.time * nsf.sampling_freq)
     tpe = int((self.time + time_window) * nsf.sampling_freq)
     ydata = nsf.spread_data(
         full_data[:, tps:tpe],
         channels_height=nsf.all_channels_height_on_probe,
         channels_used=shown_channels,
         row_spacing=1)
     time_axis = np.arange(self.time, (self.time + time_window),
                           1 / nsf.sampling_freq)
     for l in range(len(lines)):
         lines[l].set_data(time_axis, ydata[l, :])
     ax.relim()
     ax.autoscale(True, 'both', None)
     plt.draw()
def spread_lfp_pane(p):
    pane = lfp_data_panes[p, :, :]
    spread = ns_funcs.spread_data(pane, channels_heights, lfp_channels_used)
    spread = np.flipud(spread)
    return spread
예제 #3
0
}

shown_channels = good_channels_per_region['SubThalamic']

#plt.plot(nsf.spread_data(full_data[:, 2000000:2010000], channels_height=nsf.all_channels_height_on_probe, channels_used=shown_channels, row_spacing=1).T)

time_window = 0.5
time = 120
fig, ax = plt.subplots()
ax.set_autoscale_on(True)
plt.subplots_adjust(bottom=0.2)
tps = int(time * nsf.sampling_freq)
tpe = int((time + time_window) * nsf.sampling_freq)
time_axis = np.arange(time, (time + time_window), 1 / nsf.sampling_freq)
dat = nsf.spread_data(full_data[:, tps:tpe],
                      channels_height=nsf.all_channels_height_on_probe,
                      channels_used=shown_channels,
                      row_spacing=1)
lines = plt.plot(time_axis, dat.T)


class Index(object):
    time = time

    def next(self, event):
        self.time += time_window
        tps = int(self.time * nsf.sampling_freq)
        tpe = int((self.time + time_window) * nsf.sampling_freq)
        ydata = nsf.spread_data(
            full_data[:, tps:tpe],
            channels_height=nsf.all_channels_height_on_probe,
            channels_used=shown_channels,