index function

Extracting and replacing the index of raster time series