Any reason these two lines can't be kept instead of calculating the channel/timeBin separately in each of the below cases?