Discontinuity detection and removal from data time series