ch_slice function

Converts doy or dwy into a factor that is used to bin data