Yes that must be it, my solution was `tfirst = int(tshift * sfreq) + (offset * sfreq)` which should be equivalent, I prefer yours.