예제 #1
0
파일: views.py 프로젝트: stephenlenzi/phy
    def _compute_correlograms(self, cluster_ids):

        # Keep spikes belonging to the selected clusters.
        ind = np.in1d(self.spike_clusters, cluster_ids)
        st = self.spike_times[ind]
        sc = self.spike_clusters[ind]

        # Take excerpts of the spikes.
        n_spikes_total = len(st)
        st = get_excerpts(st,
                          excerpt_size=self.excerpt_size,
                          n_excerpts=self.n_excerpts)
        sc = get_excerpts(sc,
                          excerpt_size=self.excerpt_size,
                          n_excerpts=self.n_excerpts)
        n_spikes_exerpts = len(st)
        logger.log(
            5,
            "Computing correlograms for clusters %s (%d/%d spikes).",
            ', '.join(map(str, cluster_ids)),
            n_spikes_exerpts,
            n_spikes_total,
        )

        # Compute all pairwise correlograms.
        ccg = correlograms(
            st,
            sc,
            cluster_ids=cluster_ids,
            sample_rate=self.sample_rate,
            bin_size=self.bin_size,
            window_size=self.window_size,
        )

        return ccg
예제 #2
0
파일: views.py 프로젝트: pombredanne/phy
    def _compute_correlograms(self, cluster_ids):

        # Keep spikes belonging to the selected clusters.
        ind = np.in1d(self.spike_clusters, cluster_ids)
        st = self.spike_times[ind]
        sc = self.spike_clusters[ind]

        # Take excerpts of the spikes.
        n_spikes_total = len(st)
        st = get_excerpts(st, excerpt_size=self.excerpt_size,
                          n_excerpts=self.n_excerpts)
        sc = get_excerpts(sc, excerpt_size=self.excerpt_size,
                          n_excerpts=self.n_excerpts)
        n_spikes_exerpts = len(st)
        logger.log(5, "Computing correlograms for clusters %s (%d/%d spikes).",
                   ', '.join(map(str, cluster_ids)),
                   n_spikes_exerpts, n_spikes_total,
                   )

        # Compute all pairwise correlograms.
        ccg = correlograms(st, sc,
                           cluster_ids=cluster_ids,
                           sample_rate=self.sample_rate,
                           bin_size=self.bin_size,
                           window_size=self.window_size,
                           )

        return ccg
예제 #3
0
 def _get_correlograms(self, cluster_ids, bin_size, window_size):
     spike_ids = self.selector.select_spikes(cluster_ids, 100000)
     st = self.model.spike_times[spike_ids]
     sc = self.supervisor.clustering.spike_clusters[spike_ids]
     return correlograms(
         st,
         sc,
         sample_rate=self.model.sample_rate,
         cluster_ids=cluster_ids,
         bin_size=bin_size,
         window_size=window_size,
     )