Esempio n. 1
0
def resample(curves):
    n = len(curves)
    newSample = []
    for c in curves:
        targetDof = c.dof['avg']
        randCurve = curves[random.randint(0, n-1)]
        sourceDof = randCurve.dof['avg']
        newCurve = CorrCurves(frameRate = randCurve.frameRate)
        def scale(seq):
            return (seq / sourceDof) * targetDof
        newCurve.sab['avg'] = scale(randCurve.sab['avg'])
        newCurve.ssa['avg'] = scale(randCurve.ssa['avg'])
        newCurve.ssb['avg'] = scale(randCurve.ssb['avg'])
        newCurve.dof['avg'] = targetDof
        newSample.append(newCurve)
    return newSample
Esempio n. 2
0
def averageCurves(curves):
    return CorrCurves.average(curves)