def genPeaks(data, tup): detType, smoothType, smoothCor = tup if smoothType is None: val = detectPeaksGCDC(data, detection={'type': detType}) val = np.transpose(val) else: val = np.transpose(detectPeaksGCDC(data, detection={'type': detType}, mooth={'type': smoothType, 'correct': smoothCor})) if len(val[0]) < 10: val = None return val
def getVelocity(data, cols): time = data.index velocity = dict() for v in cols: orgCol = "A" + v[1:] try: peaks = np.transpose(ac.detectPeaksGCDC(data, orgCol, smooth={'type': 'sg'}))[0] velocity[v] = get1DVel(time, data[orgCol], peaks) except: continue return pd.DataFrame.from_dict(velocity)