diff --git a/pyerrors/obs.py b/pyerrors/obs.py index 2dcab477..239efc5c 100644 --- a/pyerrors/obs.py +++ b/pyerrors/obs.py @@ -323,8 +323,8 @@ class Obs: # Standard automatic windowing procedure tau = self.S[e_name] / np.log((2 * self.e_n_tauint[e_name][gapsize::gapsize] + 1) / (2 * self.e_n_tauint[e_name][gapsize::gapsize] - 1)) g_w = np.exp(- np.arange(1, len(tau) + 1) / tau) - tau / np.sqrt(np.arange(1, len(tau) + 1) * e_N) - for n in range(1, w_max): - if g_w[n - 1] < 0 or n >= w_max - 1: + for n in range(1, w_max // gapsize): + if g_w[n - 1] < 0 or n >= w_max // gapsize - 1: _compute_drho(gapsize * n) n *= gapsize self.e_tauint[e_name] = self.e_n_tauint[e_name][n] * (1 + (2 * n / gapsize + 1) / e_N) / (1 + 1 / e_N) # Bias correction hep-lat/0306017 eq. (49) diff --git a/tests/obs_test.py b/tests/obs_test.py index 3f65ecee..824feb77 100644 --- a/tests/obs_test.py +++ b/tests/obs_test.py @@ -1152,3 +1152,7 @@ def test_nan_obs(): o = pe.pseudo_Obs(1, .1, 'test') no = np.nan * o no.gamma_method() + + o.idl['test'] = [1, 5] + list(range(7, 2002, 2)) + no = np.NaN * o + no.gamma_method()