'Makes the time series increasing.
Assumes that series is based on a counter which is occasionally reset, and
using this assumption converts the sequence to estimate the total number of
counts which occurred.
NOTE: Could give inacurate numbers in either of the following cases: 1)
Multiple resets occur between samples. 2) A reset is followed by a spike
larger than the previous level.'

def MakeIncreasing(self):

    offset = 0
    last_value = None
    for p in self.data:
        if (last_value and (last_value > p[0])):
            offset += last_value
        last_value = p[0]
        if offset:
            p[0] += offset
