diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py index 76d077fa044c96aa80627dee3e8dc3a4e1796f16..f5ae4cde84da6aaa0800890594b2c7684f360fc8 100755 --- a/lisainstrument/instrument.py +++ b/lisainstrument/instrument.py @@ -207,7 +207,8 @@ class Instrument: self.physics_dt = self.dt / self.physics_upsampling self.physics_fs = self.fs * self.physics_upsampling logger.info("Computing physics time vector (size=%s, dt=%s)", self.physics_size, self.physics_dt) - self.physics_t = self.t0 + np.arange(self.physics_size, dtype=np.float64) * self.physics_dt + self.physics_et = np.arange(self.physics_size, dtype=np.float64) * self.physics_dt # elapsed time + self.physics_t = self.t0 + self.physics_et # Telemetry sampling self.telemetry_downsampling = int(telemetry_downsampling) @@ -801,12 +802,13 @@ class Instrument: self.simulate_noises() logger.debug("Computing local timer deviations") + t = self.physics_et self.local_timer_deviations = \ - self.clock_offsets + \ - self.clock_freqoffsets * self.physics_t + \ - self.clock_freqlindrifts * self.physics_t**2 / 2 + \ - self.clock_freqquaddrifts * self.physics_t**3 / 3 + \ - ForEachSC(lambda sc: + self.clock_offsets \ + + self.clock_freqoffsets * t \ + + self.clock_freqlindrifts * t**2 / 2 \ + + self.clock_freqquaddrifts * t**3 / 3 \ + + ForEachSC(lambda sc: cumulative_trapezoid(np.broadcast_to( self.clock_noise_fluctuations_withinitial[sc], self.physics_size + self.initial_telemetry_physics_size), @@ -837,7 +839,7 @@ class Instrument: 0 if self.tdir_tone_amplitudes[mosa] == 0 \ else self.tdir_tone_amplitudes[mosa] * np.sin( 2 * np.pi * self.tdir_tone_frequencies[mosa] - * (self.physics_t + self.local_timer_deviations[mosa[0]]) + * (self.physics_et + self.local_timer_deviations[mosa[0]]) + self.tdir_tone_initial_phases[mosa] ) ) @@ -1333,7 +1335,7 @@ class Instrument: self.clock_noise_offsets = self.clock_freqoffsets else: logger.debug("Generating clock noise offsets") - t = self.physics_t + t = self.physics_et self.clock_noise_offsets = \ self.clock_freqoffsets \ + self.clock_freqlindrifts * t \ diff --git a/tests/test_instrument.py b/tests/test_instrument.py index bb97ee9972d855e9c58057c502fcba1c21ec091c..54adb731c58fedd3dcdf3855f0bd5df966c53c42 100755 --- a/tests/test_instrument.py +++ b/tests/test_instrument.py @@ -38,13 +38,11 @@ def test_esa_orbits_1_0_2(): instru = Instrument(size=100, orbits='tests/esa-orbits-1-0-2.h5') instru.simulate() -@pytest.mark.skip("see https://gitlab.in2p3.fr/lisa-simulation/instrument/-/issues/83") def test_keplerian_orbits_2_0_dev(): """Test that simulations can run with Keplerian orbit files v2.0.dev.""" instru = Instrument(size=100, orbits='tests/keplerian-orbits-2-0-dev.h5') instru.simulate() -@pytest.mark.skip("see https://gitlab.in2p3.fr/lisa-simulation/instrument/-/issues/83") def test_esa_trailing_orbits_2_0_dev(): """Test that simulations can run with ESA trailing orbit files v2.0.dev.""" instru = Instrument(size=100, orbits='tests/esa-trailing-orbits-2-0-dev.h5')