Fig WR clock fix xaxis factor

This commit is contained in:
Eric Teunis de Boone 2022-03-02 11:35:58 +01:00
parent 0e5b23aa24
commit c3d130a715
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python3
__doc__ = \
"""Generate some figures showing the alignment of clocks
in a White Rabbit system with GrandMaster setup.
"""
@ -66,8 +65,8 @@ def main(time_base = 10e-9):
dio_freq = 12.5*clock_freq # Hz
pps_in_early = -1.7/clock_freq #s
pps_in_width = 10e1/clock_freq #s
pps_out_width = 10e1/clock_freq #s
pps_in_width = 1e2/clock_freq #s
pps_out_width = 1e2/clock_freq #s
t = np.linspace(-2.25*1/clock_freq, 0.8*1/clock_freq, 5000) #
@ -86,7 +85,8 @@ def main(time_base = 10e-9):
## Random event timestamp
timestamped_event = t[first_shared_edge(dio, random_event_idx)]
# Create the figure
fig, axs = plt.subplots(4,1, sharex=True, gridspec_kw={'hspace': 0}, figsize=(16,4))
@ -121,7 +121,7 @@ def main(time_base = 10e-9):
if time_base == 10e-9:
axs[-1].set_xlabel("Time (ns)")
ticks = axs[-1].get_xticks()/time_base
ticks = axs[-1].get_xticks()*10/time_base # 10 was experimentally determined
axs[-1].set_xticklabels(np.floor(ticks))
else:
axs[-1].set_xlabel("Time (s)")

Binary file not shown.