diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py index 762149b4f5c8430b2190397ef71f8f999ae5fb2e..1062db019c1f58802a8099bd4abb1acd737119f0 100644 --- a/lisainstrument/instrument.py +++ b/lisainstrument/instrument.py @@ -1547,9 +1547,11 @@ class Instrument: logger.debug("Solving iteratively (tolerance=%s s, maxiter=%s)", self.clockinv_tolerance, self.clockinv_maxiter) - niter = 0 + # Drop samples at the edges to compute error + edge = min(100, len(timer_deviations) // 2 - 1) error = 0 - edge = 100 # drop samples at the edges to check convergence + + niter = 0 next_inverse = timer_deviations while not niter or error > self.clockinv_tolerance: if niter >= self.clockinv_maxiter: diff --git a/tests/test_instrument.py b/tests/test_instrument.py index 7b2d08b415a974207548ff055bb28540f88bb151..54adb731c58fedd3dcdf3855f0bd5df966c53c42 100644 --- a/tests/test_instrument.py +++ b/tests/test_instrument.py @@ -16,7 +16,6 @@ def test_run_no_aafilter(): instru = Instrument(size=100, aafilter=None) instru.simulate() -@pytest.mark.skip(reason="do not know why this fails") def test_run_no_upsampling(): """Test that simulations can run with no filter.""" instru = Instrument(size=100, physics_upsampling=1, aafilter=None)