@@ -517,42 +517,12 @@ def get_passive_events(self):
517517 base_stim = 1
518518 pre_stim = 0.4
519519 post_stim = 1
520- stim_events = passive .get_stim_aligned_activity (stims , self .spikes ['times' ][self .spike_idx ][self .kp_idx ],
521- self .spikes ['depths' ][self .spike_idx ][self .kp_idx ],
522- pre_stim = pre_stim ,post_stim = post_stim , base_stim = base_stim )
523-
524- #T_BIN = 0.01
525- #D_BIN = 20
526- #base_stim = 1
527- #pre_stim = 0.4
528- #post_stim = 1
529- #n_bins = int((pre_stim + post_stim) / T_BIN)
530- #n_bins_base = int(np.ceil((base_stim - pre_stim) / T_BIN))
531- #R, times, depths = bincount2D(self.spikes['times'][self.spike_idx][self.kp_idx],
532- # self.spikes['depths'][self.spike_idx][self.kp_idx],
533- # T_BIN, D_BIN, ylim=[0, np.max(self.chn_coords[:, 1])])
534- #
535- #for stim_type in stim_types:
536- #
537- # stim_times = stims[stim_type]
538- # stim_intervals = np.c_[stim_times - pre_stim, stim_times + post_stim]
539- # base_intervals = np.c_[stim_times - base_stim, stim_times - pre_stim]
540- # idx_stim = np.searchsorted(times, stim_intervals)
541- # idx_base = np.searchsorted(times, base_intervals)
542- #
543- # stim_trials = np.zeros((depths.shape[0], n_bins, idx_stim.shape[0]))
544- # noise_trials = np.zeros((depths.shape[0], n_bins_base, idx_stim.shape[0]))
545- # for i, (st, ba) in enumerate(zip(idx_stim, idx_base)):
546- # stim_trials[:, :, i] = R[:, st[0]:st[1]]
547- # noise_trials[:, :, i] = R[:, ba[0]:ba[1]]
548- #
549- # # Average across trials
550- # avg_stim_trials = np.mean(stim_trials, axis=2)
551- # # Average across trials and time
552- # avg_base_trials = np.mean(np.mean(noise_trials, axis=2), axis=1)[:, np.newaxis]
553- # std_base_trials = np.std(np.mean(noise_trials, axis=2), axis=1)[:, np.newaxis]
554- # z_score = (avg_stim_trials - avg_base_trials) / std_base_trials
555- # z_score[np.isnan(z_score)] = 0
520+ stim_events = passive .get_stim_aligned_activity (stims , self .spikes ['times' ][self .spike_idx ]
521+ [self .kp_idx ], self .spikes ['depths' ]
522+ [self .spike_idx ][self .kp_idx ],
523+ pre_stim = pre_stim , post_stim = post_stim ,
524+ base_stim = base_stim )
525+
556526 for stim_type , z_score in stim_events .items ():
557527 xscale = (post_stim + pre_stim )/ z_score .shape [1 ]
558528 yscale = ((np .max (self .chn_coords [:, 1 ]) - np .min (self .chn_coords [:, 1 ]))
0 commit comments