From 1413bc724bfad4afbdeb43f8f55952b1e05bbd78 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bayle <j2b.bayle@gmail.com> Date: Fri, 3 Jun 2022 19:05:43 +0200 Subject: [PATCH] Use elapsed time for clock drifts and TDIR tones --- lisainstrument/instrument.py | 18 ++++++++++-------- tests/test_instrument.py | 2 -- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py index 76d077f..f5ae4cd 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 bb97ee9..54adb73 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') -- GitLab