示例#1
0
文件: PeakSimple.py 项目: jessab/ML
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
示例#2
0
文件: Velocity.py 项目: jessab/ML
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)