Skip to content
Snippets Groups Projects
Commit 1f00271f authored by Jan Niklas Reinhardt's avatar Jan Niklas Reinhardt Committed by Jean-Baptiste Bayle
Browse files

Adjust definiion of physics sample offset

parent 04fada20
No related branches found
No related tags found
1 merge request!110Resolve "Correct the sampling of the TCB timer deviations"
......@@ -222,6 +222,8 @@ class Instrument:
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
# number of physics samples corresponding to the initial telemetry contacts
self.physics_sample_offset = int(num_initial_telemetry_contacts * physics_upsampling * telemetry_downsampling)
# Instrument topology
self.central_freq = float(central_freq)
......@@ -799,11 +801,15 @@ class Instrument:
logger.debug("Computing local timer deviations")
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:
cumulative_trapezoid(np.broadcast_to(
self.clock_noise_offsets[sc] + self.clock_noise_fluctuations[sc],
self.physics_size),
dx=self.physics_dt, initial=0) + self.clock_offsets[sc]
self.clock_noise_fluctuations_complete[sc],
self.physics_size + self.physics_sample_offset),
dx=self.physics_dt, initial=0)[self.physics_sample_offset:]
)
## Timer deviations from TCB
......@@ -815,11 +821,11 @@ class Instrument:
ForEachSC(lambda sc:
cumulative_trapezoid(np.broadcast_to(
self.clock_noise_fluctuations_complete[sc],
self.physics_size + int(self.num_initial_telemetry_contacts * self.physics_upsampling * self.telemetry_downsampling)),
dx=self.physics_dt)[::self.physics_upsampling * self.telemetry_downsampling] + \
self.physics_size + self.physics_sample_offset),
dx=self.physics_dt, initial=0)[::self.physics_upsampling * self.telemetry_downsampling] + \
self.tcb_sync_noises[sc]
# + \
#self.tps_proper_time_deviations[sc]
# self.tps_proper_time_deviations[sc]
)
## TDIR tone
......@@ -1332,13 +1338,12 @@ class Instrument:
logger.debug("Generating clock noise fluctuations")
times_offset = int(self.num_initial_telemetry_contacts * self.physics_upsampling * self.telemetry_downsampling)
self.clock_noise_fluctuations_complete = ForEachSC(lambda sc:
noises.clock(self.physics_fs,
self.physics_size + times_offset, self.clock_asds[sc])
self.physics_size + self.physics_sample_offset, self.clock_asds[sc])
)
self.clock_noise_fluctuations = ForEachSC(lambda sc:
self.clock_noise_fluctuations_complete[sc][times_offset:]
self.clock_noise_fluctuations_complete[sc][self.physics_sample_offset:]
)
## Modulation noise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment