def test_corr_matrix_size(self): """Check the correction matrix has the right shape""" rs = 7 max_iet = 24 max_corr = 24 corr_m = cls.generate_corr_matrix(max_iet=max_corr, max_hw_correction=max_iet, right_shift=rs) self.assertEqual(corr_m.shape, (max_corr + 1, max_iet + 1))
def test_corr_matrix(self): """Check the correction integer matrix is sensible""" rs = 7 corr_m = cls.generate_corr_matrix(max_iet=24, max_hw_correction=32, right_shift=rs) corr_int = 5 iet = 10 answer = ((iet * corr_int) >> rs) + iet self.assertEqual(corr_m[corr_int][iet], answer)