Beispiel #1
0
 def extract_ccw_ipsi_clipped_avgs(self):
     avgs = []
     for trial in self.raw_clipped_data:
         segments = mat_utils.cutAndGetMultiple(self.cmd, trial)
         for segment in segments:
             avgs.append(self.extract_ccw_ipsi_from_plot_segment(segment).mean())
     return avgs
Beispiel #2
0
    def n_segments(self):
        """
        Number of cycles cut from trial

        :return:
        """
        return len(mat_utils.cutAndGetMultiple(self.cmd, self.cmd))
Beispiel #3
0
    def extract_clipped_avgs(self):
        """
        To be used by clipped_avgs_per_trial_table

        :return: list of pairs of clockwise/counter_clockwise averages per trial
        """
        avgs_c_wise = []
        avgs_c_c_wise = []
        for trial in self.raw_clipped_data:
            segments = mat_utils.cutAndGetMultiple(self.cmd, trial)
            for segment in segments:
                avgs_c_wise.append(segment[:self.data_plot_segment_half].mean())
                avgs_c_c_wise.append(segment[self.data_plot_segment_half:].mean())
        return avgs_c_wise, avgs_c_c_wise
Beispiel #4
0
 def get_pooled_vms_bsl_cw_ccw(self):
     bsls = []
     cws = []
     ccws = []
     for w in self.raw_clipped_baselined:
         bsl = self.extract_bsl(w)
         bsls.extend(bsl)
         cycles = mat_utils.cutAndGetMultiple(self.cmd, w)
         for c in cycles:
             mid = int(len(c)/2)
             cw = c[:mid]
             cws.extend(cw)
             ccw = c[mid:]
             ccws.extend(ccw)
     bsls = np.array(bsls, dtype=np.float64)
     cws = np.array(cws, dtype=np.float64)
     ccws = np.array(ccws, dtype=np.float64)
     return bsls, cws, ccws
Beispiel #5
0
    def get_clipped_cycles(self):
        """

        .. warning::
            Will only work with 2 cycles (cutInHalf)

        :return columns: t1bsl1+t1cycle1, t1bsl2+t1cycle2, t2bsl1+t2cycle1, t2bsl2+t2cycle2
        :rtype: list
        """
        columns = []
        for trial in self.raw_clipped_data:
            bsl = self.extract_bsl(trial)
            bsls = mat_utils.cutInHalf(bsl)  # WARNING: works only with 2 cycles
            cycles = mat_utils.cutAndGetMultiple(self.cmd, trial)  # WARNING: works only with 2 cycles
            for segment_id in range(self.n_segments):
                column = np.hstack((bsls[segment_id], cycles[segment_id]))
                columns.append(column)
        return columns