slice function for time series