Aligns a pair of ndarrays up to translation