corner cases handled in additive_spline_chan.py. input data extended at the borders to have interpolation over full range. writes to db in chunks to save some ram.