peng/wave_functions.py
def _running_area(indep_vector, dep_vector):
    """Calculate running area under curve."""
    rect_height = np.minimum(dep_vector[:-1], dep_vector[1:])
    rect_base = np.diff(indep_vector)
    rect_area = np.multiply(rect_height, rect_base)
    triang_height = np.abs(np.diff(dep_vector))
    triang_area = 0.5 * np.multiply(triang_height, rect_base)
    return np.cumsum(np.concatenate((np.array([0.0]), triang_area + rect_area)))
def _running_area(indep_vector, dep_vector):
    """Calculate running area under curve."""
    rect_height = np.minimum(dep_vector[:-1], dep_vector[1:])
    rect_base = np.diff(indep_vector)
    rect_area = np.multiply(rect_height, rect_base)
    triang_height = np.abs(np.diff(dep_vector))
    triang_area = 0.5 * np.multiply(triang_height, rect_base)
    return np.cumsum(np.concatenate((np.array([0.0]), triang_area + rect_area)))
Calculate running area under curve.