def convert2TimeIntervalLst(self): sem_lst = core.msk2Semlst(self.getYArray(), self.getYArray(), \ self.getTArray()) res = [] for sem in sem_lst: res.append((sem[0][0], sem[0][-1])) return res
def applyMaskByName(self, msk_name): '''Apply mask on signal to get segments of signal''' msk_seg = self.getMaskByName(msk_name) if msk_seg != None: sem_lst = core.msk2Semlst(msk_seg.getYArray(), self.getYArray(), \ self.getTArray()) seg_lst = [] for sem in sem_lst: seg_lst.append(StrainTimeSeriesSeg(sem, self.getSensorName())) return seg_lst else: return None
def createMeaningfulTimeIntervalLstFromAccel(accel_tss, filter_type = 'threshold_121'): '''Create meaninful time interval list from accelTimeSeriesSeg data, the filter is learnt in threhold_121 related method''' assert isinstance(accel_tss ,sb.AccelTimeSeriesSeg) == True,\ 'Must be AccelTimeSeriesSeg type' meaningful_time_interval_lst = [] data_arr = accel_tss.getYArray() tag_arr = accel_tss.getTArray() # Filter data if filter_type == 'threshold_121': mask_arr,occ_lst = wf.occFilterThres_seg121(data_arr, tag_arr) sem_lst = core.msk2Semlst(mask_arr, data_arr, tag_arr) #create list of AccelTimeSeriesSeg for sem in sem_lst: meaningful_time_interval_lst.append([sem[0][0],sem[0][-1]]) return meaningful_time_interval_lst